|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.filteredpush.mapper.datapolicymapper.SpecifyAdapter
public class SpecifyAdapter
A adapter for a specify database instance. It talks to the specify through a group of HTTP protocols and authenticate the user through OAuth. Author: Lei Dou $Id:$
| Constructor Summary | |
|---|---|
SpecifyAdapter()
|
|
| 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 |
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.Object> obj)
Update a record in the data source with the specified type and value. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SpecifyAdapter()
| Method Detail |
|---|
public void setContext(java.util.Map<java.lang.String,java.lang.String> context)
setContext in interface DataSourceAdaptercontext - public DataPolicy getDataPolicy()
getDataPolicy in interface DataPolicyAdapter
public 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
findByIdentifiers in interface DataPolicyAdapterobjType - 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.
public 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
find in interface DataPolicyAdapterobjType - 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.
public java.util.Map<java.lang.String,java.lang.String> get(java.lang.String objType,
java.lang.String identifier)
throws UnAuthenticated,
InvalidParameter,
InternalException,
OAuthRedirectException,
LocalDataSourceAccessException
get in interface DataPolicyAdapterobjType - 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.
public 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
add in interface DataPolicyAdapterobjType - 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.
public void update(java.lang.String objType,
java.util.Map<java.lang.String,java.lang.Object> obj)
throws UnAuthenticated,
InvalidParameter,
MissingInformationException,
UniqueIdentificationException,
InternalException,
OAuthRedirectException,
LocalDataSourceAccessException
update in interface DataPolicyAdapterobjType - 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.
public void delete(java.lang.String objType,
java.lang.String identifier)
throws UnAuthenticated,
InvalidParameter,
InternalException,
OAuthRedirectException,
LocalDataSourceAccessException
delete in interface DataPolicyAdapterobjType - 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 | |||||||||