|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface DataPolicyAdapter
The interface for the adapter which is implemented based on the data policy.
| Method Summary | |
|---|---|
java.lang.String |
add(java.lang.String objType,
java.util.Map<java.lang.String,java.lang.Object> obj)
Insert a record into the data source with the specified type and value. |
void |
delete(java.lang.String objType,
java.lang.String identifier)
Delete a record in the data source with the specified type and primary key. |
java.util.List<java.lang.String> |
find(java.lang.String objType,
java.util.Map<java.lang.String,java.lang.Object> obj)
Find the record that is in the specified type and has the specified value and return their primary keys. |
java.util.List<java.lang.String> |
findByIdentifiers(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.Map<java.lang.String,java.lang.String> |
get(java.lang.String objType,
java.lang.String identifier)
Return the object with the specified type and the primary key. |
DataPolicy |
getDataPolicy()
Return the data policy used by this adapter. |
void |
update(java.lang.String objType,
java.util.Map<java.lang.String,java.lang.Object> obj)
Update a record in the data source with the specified type and value. |
| Methods inherited from interface org.filteredpush.mapper.DataSourceAdapter |
|---|
setContext |
| Method Detail |
|---|
DataPolicy getDataPolicy()
java.util.List<java.lang.String> findByIdentifiers(java.lang.String objType,
java.util.Map<java.lang.String,java.lang.String> identifiers)
throws UnAuthenticated,
InvalidParameter,
InternalException,
OAuthRedirectException,
LocalDataSourceAccessException
objType - 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.
java.util.List<java.lang.String> find(java.lang.String objType,
java.util.Map<java.lang.String,java.lang.Object> obj)
throws UnAuthenticated,
InvalidParameter,
InternalException,
OAuthRedirectException,
LocalDataSourceAccessException
objType - The type of record to be find.obj - The value that the target record should have.
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.
java.util.Map<java.lang.String,java.lang.String> get(java.lang.String objType,
java.lang.String identifier)
throws UnAuthenticated,
InvalidParameter,
InternalException,
OAuthRedirectException,
LocalDataSourceAccessException
objType - The type of record to be find.identifier - The primary key.
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.
java.lang.String add(java.lang.String objType,
java.util.Map<java.lang.String,java.lang.Object> obj)
throws UnAuthenticated,
InvalidParameter,
MissingInformationException,
UniqueIdentificationException,
InternalException,
OAuthRedirectException,
LocalDataSourceAccessException
objType - The type of record to be inserted.obj - The value of the object to be inserted.
UnAuthenticated - If the adapter can't be authenticated to access the local data source.
InvalidParameter - If the input value is not valid.
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.
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.
void update(java.lang.String objType,
java.util.Map<java.lang.String,java.lang.Object> obj)
throws UnAuthenticated,
InvalidParameter,
MissingInformationException,
UniqueIdentificationException,
InternalException,
OAuthRedirectException,
LocalDataSourceAccessException
objType - The type of record to be updated.obj - The value that the object to be updated to. The primary key of the object must be contained so that
the to be updated object could be identified.
UnAuthenticated - If the adapter can't be authenticated to access the local data source.
InvalidParameter - If the input value is not valid.
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 updated 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.
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.
void delete(java.lang.String objType,
java.lang.String identifier)
throws UnAuthenticated,
InvalidParameter,
InternalException,
OAuthRedirectException,
LocalDataSourceAccessException
objType - The type of record to be deleted.identifier - The primary key of the object to be deleted.
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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||