|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.filteredpush.mapper.datapolicymapper.DataPolicyMapperImpl
public class DataPolicyMapperImpl
An implementation class of the mapper based on data policy. Author: Lei Dou $Id:$
| Constructor Summary | |
|---|---|
DataPolicyMapperImpl()
|
|
| Method Summary | |
|---|---|
java.lang.String |
add(java.lang.String objType,
java.util.Map<java.lang.String,java.lang.String> data)
Add the record of specified type in the local data source. |
void |
delete(java.lang.String objType,
java.lang.String identifier)
Delete the record in specified type with the specified identifier from the local data source. |
java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
get(java.lang.String objType,
java.util.Map<java.lang.String,java.lang.String> data)
Find the records of the specified type and with the specified value. |
java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
getByIdentifiers(java.lang.String objType,
java.util.Map<java.lang.String,java.lang.String> identifiers)
Find the record in the local data source with the specified type and identified by the specific identifiers. |
java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
getFillin(java.lang.String objType,
java.util.Map<java.lang.String,java.lang.String> data)
Get the possible fill-in from the local data source for the input proposed change. |
java.util.List<org.filteredpush.data.definition.BasicFieldDefinition> |
getObjectDef(java.lang.String objType)
Get the list of field definition for the specified record. |
void |
setAdapterWithClass(DataSourceAdapter adapter)
Set the adapter class used by this mapper. |
void |
setAdapterWithName(java.lang.String adapterClassQN)
Set the class name (including the package name) of the adapter used by this mapper. |
void |
setContext(java.util.Map<java.lang.String,java.lang.String> context)
Set the context, e.g. |
void |
update(java.lang.String objType,
java.util.Map<java.lang.String,java.lang.String> data)
Update the record in specified type with the specified type and value in the local data source. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DataPolicyMapperImpl()
| Method Detail |
|---|
public void setContext(java.util.Map<java.lang.String,java.lang.String> context)
setContext in interface Mappercontext -
public void setAdapterWithClass(DataSourceAdapter adapter)
throws UnsupportedAdapter
setAdapterWithClass in interface Mapperadapter - Adapter class.
UnsupportedAdapter
public void setAdapterWithName(java.lang.String adapterClassQN)
throws AdapterNotFound,
UnsupportedAdapter
setAdapterWithName in interface MapperadapterClassQN - Adapter class name.
AdapterNotFound
UnsupportedAdapter
public java.util.List<java.util.Map<java.lang.String,java.lang.String>> getByIdentifiers(java.lang.String objType,
java.util.Map<java.lang.String,java.lang.String> identifiers)
throws UnAuthenticated,
InvalidParameter,
InternalException,
OAuthRedirectException,
ConverterException,
LocalDataSourceAccessException
getByIdentifiers in interface DataPolicyMapperobjType - The type of the target record.identifiers - The list of identifiers identifying the target record.
UnAuthenticated - If the adapter can't be authenticated to access the local
data source.
InvalidParameter - If the input value is not valid.
InternalException - Indicates internal error happening in the local data source
to answer this query.
OAuthRedirectException - If redirection to the OAuth authentication page is needed.
LocalDataSourceAccessException - If the local data source can't be accessed for some reason.
ConverterException - If the data conversion fails.
public java.util.List<java.util.Map<java.lang.String,java.lang.String>> get(java.lang.String objType,
java.util.Map<java.lang.String,java.lang.String> data)
throws UnAuthenticated,
InvalidParameter,
InternalException,
OAuthRedirectException,
ConverterException,
LocalDataSourceAccessException
get in interface DataPolicyMapperobjType - The type of the target record.data - The value to be matched.
UnAuthenticated - If the adapter can't be authenticated to access the local
data source.
InvalidParameter - If the input value is not valid.
InternalException - Indicates internal error happening in the local data source
to answer this query.
OAuthRedirectException - If redirection to the OAuth authentication page is needed.
LocalDataSourceAccessException - If the local data source can't be accessed for some reason.
ConverterException - If the data conversion fails.
public java.util.List<java.util.Map<java.lang.String,java.lang.String>> getFillin(java.lang.String objType,
java.util.Map<java.lang.String,java.lang.String> data)
throws UnAuthenticated,
InvalidParameter,
InternalException,
OAuthRedirectException,
ConverterException,
LocalDataSourceAccessException
getFillin in interface DataPolicyMapperobjType - The type of the target record.data - The proposed change.
UnAuthenticated - If the adapter can't be authenticated to access the local
data source.
InvalidParameter - If the input value is not valid.
InternalException - Indicates internal error happening in the local data source
to answer this query.
OAuthRedirectException - If redirection to the OAuth authentication page is needed.
LocalDataSourceAccessException - If the local data source can't be accessed for some reason.
ConverterException - If the data conversion fails.
public java.lang.String add(java.lang.String objType,
java.util.Map<java.lang.String,java.lang.String> data)
throws UnAuthenticated,
InvalidParameter,
MissingInformationException,
UniqueIdentificationException,
InternalException,
OAuthRedirectException,
ConverterException,
LocalDataSourceAccessException,
ObjectExistException
add in interface DataPolicyMapperobjType - The type of the target record.data - The value of the target record to be created.
UnAuthenticated - If the adapter can't be authenticated to access the local
data source.
InvalidParameter - If the input value is not valid.
InternalException - Indicates internal error happening in the local data source
to answer this query.
OAuthRedirectException - If redirection to the OAuth authentication page is needed.
LocalDataSourceAccessException - If the local data source can't be accessed for some reason.
ConverterException - If the data conversion fails.
MissingInformationException - If the information provided to create the record is not
enough. E.g. the information to create higher taxon is needed
when a taxon is inserted and its higher taxon doesn't exist.
UniqueIdentificationException - If more than one records (could be the referenced record) are
matched according to the input value while only one is
expected. E.g. when insert an identification record, a
gci_botanist (representing the identifier) record will be
found and its id will be used to create the identification
record. But if only the identifier's name is provided and
more than one gci_botanist records are matched, then the
system won't be able to know which record should be used. In
this case, this exception will be thrown out.
ObjectExistException - If the record of the specified type with the specified value
already exists in the local data source.
public void update(java.lang.String objType,
java.util.Map<java.lang.String,java.lang.String> data)
throws UnAuthenticated,
InvalidParameter,
MissingInformationException,
UniqueIdentificationException,
InternalException,
OAuthRedirectException,
ConverterException,
LocalDataSourceAccessException,
ObjectExistException
update in interface DataPolicyMapperobjType - The type of the target record.data - The value of the target record to be updated.
UnAuthenticated - If the adapter can't be authenticated to access the local
data source.
InvalidParameter - If the input value is not valid.
InternalException - Indicates internal error happening in the local data source
to answer this query.
OAuthRedirectException - If redirection to the OAuth authentication page is needed.
LocalDataSourceAccessException - If the local data source can't be accessed for some reason.
ConverterException - If the data conversion fails.
MissingInformationException - If the information provided to create the record is not
enough. E.g. the information to create higher taxon is needed
when a taxon is inserted and its higher taxon doesn't exist.
UniqueIdentificationException - If more than one records (could be the referenced record) are
matched according to the input value while only one is
expected. E.g. when insert an identification record, a
gci_botanist (representing the identifier) record will be
found and its id will be used to create the identification
record. But if only the identifier's name is provided and
more than one gci_botanist records are matched, then the
system won't be able to know which record should be used. In
this case, this exception will be thrown out.
ObjectExistException - If the record of the specified type with the specified value
already exists in the
public void delete(java.lang.String objType,
java.lang.String identifier)
throws UnAuthenticated,
InvalidParameter,
InternalException,
OAuthRedirectException,
ConverterException,
LocalDataSourceAccessException
delete in interface DataPolicyMapperobjType - The type of the target record.identifier - The primary key of the target record.
UnAuthenticated - If the adapter can't be authenticated to access the local
data source.
InvalidParameter - If the input value is not valid.
InternalException - Indicates internal error happening in the local data source
to answer this query.
OAuthRedirectException - If redirection to the OAuth authentication page is needed.
LocalDataSourceAccessException - If the local data source can't be accessed for some reason.
ConverterException - If the data conversion fails.public java.util.List<org.filteredpush.data.definition.BasicFieldDefinition> getObjectDef(java.lang.String objType)
When the object has cross reference to another object, the mapper will go to the referenced object definition and grab the field definition. This process could be recursive.
The major usage of this method is to generate the table in the webUI to present the existing local dataset and the "new" data. It would also be useful in other cases to help interpret and validate the data.
getObjectDef in interface DataPolicyMapperobjType - The type of the target record.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||