public interface ResourceLookupSession extends OsidSession
This session defines methods for retrieving resources. A
Resource
is an arbitrary entity that may represent a person, place
or thing used to identify an object used in various services.
This lookup session defines several views:
Resources
with the ResourceAdminSession.
The methods useFederatedBinView()
and
useIsolatedBinView()
behave as a radio group and one should be
selected before invoking any lookup methods.
Resources may have an additional records indicated by their respective
record types. The record may not be accessed through a cast of the
Resource.
Modifier and Type | Method and Description |
---|---|
boolean |
canLookupResources()
Tests if this user can perform
Resource lookups. |
Bin |
getBin()
Gets the
Bin associated with this session. |
Id |
getBinId()
Gets the
Bin Id associated with this
session. |
Resource |
getResource(Id resourceId)
Gets the
Resource specified by its Id. |
ResourceList |
getResources()
Gets all
Resources. |
ResourceList |
getResourcesByGenusType(Type resourceGenusType)
Gets a
ResourceList corresponding to the given resource
genus Type which does not include resources of types
derived from the specified Type. |
ResourceList |
getResourcesByIds(IdList resourceIds)
Gets a
ResourceList corresponding to the given
IdList. |
ResourceList |
getResourcesByParentGenusType(Type resourceGenusType)
Gets a
ResourceList corresponding to the given resource
genus Type and include any additional resources with
genus types derived from the specified Type. |
ResourceList |
getResourcesByRecordType(Type resourceRecordType)
Gets a
ResourceList containing the given resource
record Type. |
void |
useComparativeResourceView()
The returns from the lookup methods may omit or translate elements
based on this session, such as authorization, and not result in an
error.
|
void |
useFederatedBinView()
Federates the view for methods in this session.
|
void |
useIsolatedBinView()
Isolates the view for methods in this session.
|
void |
usePlenaryResourceView()
A complete view of the
Resource returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getBinId()
Bin
Id
associated with this
session. Bin Id
associated with this sessionmandatory
- This method must be implemented. Bin getBin() throws OperationFailedException, PermissionDeniedException
Bin
associated with this session. Bin
associated with this sessionOperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canLookupResources()
Resource
lookups. A
return of true does not guarantee successful authorization. A return
of false indicates that it is known all methods in this session will
result in a PERMISSION_DENIED.
This is intended as a
hint to an application that may opt not to offer lookup operations. false
if lookup methods are not authorized,
true
otherwisemandatory
- This method must be implemented. void useComparativeResourceView()
mandatory
- This method is must be implemented. void usePlenaryResourceView()
Resource
returns is desired.
Methods will return what is requested or result in an error. This view
is used when greater precision is desired at the expense of
interoperability.mandatory
- This method is must be implemented. void useFederatedBinView()
mandatory
- This method is must be implemented. void useIsolatedBinView()
mandatory
- This method is must be implemented. Resource getResource(Id resourceId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Resource
specified by its Id.
In plenary mode, the exact Id
is found or a
NOT_FOUND
results. Otherwise, the returned Resource
may have a different Id
than requested, such as
the case where a duplicate Id
was assigned to a
Resource
and retained for compatibility.resourceId
- the Id
of the Resource
to retrieve Resource
NotFoundException
- no Resource
found
with the given Id
NullArgumentException
- resourceId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. ResourceList getResourcesByIds(IdList resourceIds) throws NotFoundException, OperationFailedException, PermissionDeniedException
ResourceList
corresponding to the given
IdList.
In plenary mode, the returned list contains all of the
resources specified in the Id
list, in the order of the
list, including duplicates, or an error results if an Id
in the supplied list is not found or inaccessible. Otherwise,
inaccessible Resources
may be omitted from the list and
may present the elements in any order including returning a unique
set.resourceIds
- the list of Ids
to retrieve Resource
listNotFoundException
- an Id was
not foundNullArgumentException
- resourceIds
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. ResourceList getResourcesByGenusType(Type resourceGenusType) throws OperationFailedException, PermissionDeniedException
ResourceList
corresponding to the given resource
genus Type
which does not include resources of types
derived from the specified Type.
In plenary mode, the
returned list contains all known resources or an error results.
Otherwise, the returned list may contain only those resources that are
accessible through this session.resourceGenusType
- a resource genus type Resource
listNullArgumentException
- resourceGenusType
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. ResourceList getResourcesByParentGenusType(Type resourceGenusType) throws OperationFailedException, PermissionDeniedException
ResourceList
corresponding to the given resource
genus Type
and include any additional resources with
genus types derived from the specified Type.
In plenary
mode, the returned list contains all known resources or an error
results. Otherwise, the returned list may contain only those resources
that are accessible through this session.resourceGenusType
- a resource genus type Resource
listNullArgumentException
- resourceGenusType
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. ResourceList getResourcesByRecordType(Type resourceRecordType) throws OperationFailedException, PermissionDeniedException
ResourceList
containing the given resource
record Type.
In plenary mode, the returned list
contains all known resources or an error results. Otherwise, the
returned list may contain only those resources that are accessible
through this session.resourceRecordType
- a resource record type Resource
listNullArgumentException
- resourceRecordType
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. ResourceList getResources() throws OperationFailedException, PermissionDeniedException
Resources.
In plenary mode, the returned list
contains all known resources or an error results. Otherwise, the
returned list may contain only those resources that are accessible
through this session. Resources
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.