public interface StateLookupSession extends OsidSession
This session defines methods for retrieving states. A State
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:
States
with the StateAdminSession.
The methods useFederatedProcessView()
and
useIsolatedProcessView()
behave as a radio group and one should be
selected before invoking any lookup methods.
States may have an additional records indicated by their respective
record types. The record may not be accessed through a cast of the
State.
Modifier and Type | Method and Description |
---|---|
boolean |
canLookupStates()
Tests if this user can perform
State lookups. |
Process |
getProcess()
Gets the
Process associated with this session. |
Id |
getProcessId()
Gets the
Process Id associated with this
session. |
State |
getState(Id stateId)
Gets the
State specified by its Id. |
StateList |
getStates()
Gets all
States. |
StateList |
getStatesByGenusType(Type stateGenusType)
Gets a
StateList corresponding to the given state genus
Type which does not include states of types derived
from the specified Type. |
StateList |
getStatesByIds(IdList stateIds)
Gets a
StateList corresponding to the given
IdList. |
StateList |
getStatesByParentGenusType(Type stateGenusType)
Gets a
StateList corresponding to the given state genus
Type and include any additional states with genus types
derived from the specified Type. |
StateList |
getStatesByRecordType(Type stateRecordType)
Gets a
StateList containing the given state record
Type. |
StateList |
getValidNextStates(Id stateId)
Gets the next valid states for the given state.
|
void |
useComparativeStateView()
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 |
useFederatedProcessView()
Federates the view for methods in this session.
|
void |
useIsolatedProcessView()
Isolates the view for methods in this session.
|
void |
usePlenaryStateView()
A complete view of the
State returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getProcessId()
Process
Id
associated with this
session. Process Id
associated with this sessionmandatory
- This method must be implemented. Process getProcess() throws OperationFailedException, PermissionDeniedException
Process
associated with this session. Process
associated with this sessionOperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canLookupStates()
State
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 useComparativeStateView()
mandatory
- This method is must be implemented. void usePlenaryStateView()
State
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 useFederatedProcessView()
mandatory
- This method is must be implemented. void useIsolatedProcessView()
mandatory
- This method is must be implemented. State getState(Id stateId) throws NotFoundException, OperationFailedException, PermissionDeniedException
State
specified by its Id.
In
plenary mode, the exact Id
is found or a
NOT_FOUND
results. Otherwise, the returned State
may have a different Id
than requested, such as
the case where a duplicate Id
was assigned to a
State
and retained for compatibility.stateId
- the Id
of the State
to
retrieve State
NotFoundException
- no State
found with
the given Id
NullArgumentException
- stateId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. StateList getStatesByIds(IdList stateIds) throws NotFoundException, OperationFailedException, PermissionDeniedException
StateList
corresponding to the given
IdList.
In plenary mode, the returned list contains all of the
states 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 States
may be omitted from the list and
may present the elements in any order including returning a unique
set.stateIds
- the list of Ids
to retrieve State list
NotFoundException
- an Id was
not foundNullArgumentException
- stateIdLs
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. StateList getStatesByGenusType(Type stateGenusType) throws OperationFailedException, PermissionDeniedException
StateList
corresponding to the given state genus
Type
which does not include states of types derived
from the specified Type.
In plenary mode, the returned
list contains all known states or an error results. Otherwise, the
returned list may contain only those states that are accessible
through this session.stateGenusType
- a state genus type State
listNullArgumentException
- stateGenusType
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. StateList getStatesByParentGenusType(Type stateGenusType) throws OperationFailedException, PermissionDeniedException
StateList
corresponding to the given state genus
Type
and include any additional states with genus types
derived from the specified Type.
In plenary mode, the
returned list contains all known states or an error results.
Otherwise, the returned list may contain only those states that are
accessible through this session.stateGenusType
- a state genus type State
listNullArgumentException
- stateGenusType
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. StateList getStatesByRecordType(Type stateRecordType) throws OperationFailedException, PermissionDeniedException
StateList
containing the given state record
Type.
In plenary mode, the returned list contains all
known states or an error results. Otherwise, the returned list may
contain only those states that are accessible through this session.stateRecordType
- a state record type State
listNullArgumentException
- stateRecordType
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. StateList getStates() throws OperationFailedException, PermissionDeniedException
States.
In plenary mode, the returned list
contains all known states or an error results. Otherwise, the returned
list may contain only those states that are accessible through this
session. States
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. StateList getValidNextStates(Id stateId) throws NotFoundException, OperationFailedException, PermissionDeniedException
stateId
- a state Id
States
NotFoundException
- stateId
is not foundNullArgumentException
- stateId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.