Interface StateLookupSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, 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:
- comparative view: elements may be silently omitted or re-ordered
- plenary view: provides a complete result set or is an error condition
- isolated process view: All state methods in this session operate,
retrieve and pertain to states defined explicitly in the current
process. Using an isolated view is useful for managing
Stateswith theStateAdminSession. - federated process view: All state methods in this session operate, retrieve and pertain to all states defined in this process and any other states implicitly available in this process through process inheritence.
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 .
-
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if this user can performStatelookups.Gets theProcessassociated with this session.Gets theProcessIdassociated with this session.Gets theStatespecified by itsId.Gets allStates.getStatesByGenusType(Type stateGenusType) Gets aStateListcorresponding to the given state genusTypewhich does not include states of types derived from the specifiedType.getStatesByIds(IdList stateIds) Gets aStateListcorresponding to the givenIdList.getStatesByParentGenusType(Type stateGenusType) Gets aStateListcorresponding to the given state genusTypeand include any additional states with genus types derived from the specifiedType.getStatesByRecordType(Type stateRecordType) Gets aStateListcontaining the given state recordType.getValidNextStates(Id stateId) Gets the next valid states for the given state.voidThe returns from the lookup methods may omit or translate elements based on this session, such as authorization, and not result in an error.voidFederates the view for methods in this session.voidIsolates the view for methods in this session.voidA complete view of theStatereturns is desired.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getProcessId
Id getProcessId()Gets theProcessIdassociated with this session.- Returns:
- the
Process Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getProcess
Gets theProcessassociated with this session.- Returns:
- the
Processassociated with this session - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canLookupStates
boolean canLookupStates()Tests if this user can performStatelookups. 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 aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer lookup operations.- Returns:
falseif lookup methods are not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
useComparativeStateView
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. This view is used when greater interoperability is desired at the expense of precision.- Compliance:
mandatory- This method is must be implemented.
-
usePlenaryStateView
void usePlenaryStateView()A complete view of theStatereturns 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.- Compliance:
mandatory- This method is must be implemented.
-
useFederatedProcessView
void useFederatedProcessView()Federates the view for methods in this session. A federated view will include states in processes which are children of this process in the process hierarchy.- Compliance:
mandatory- This method is must be implemented.
-
useIsolatedProcessView
void useIsolatedProcessView()Isolates the view for methods in this session. An isolated view restricts lookups to this process only.- Compliance:
mandatory- This method is must be implemented.
-
getState
State getState(Id stateId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets theStatespecified by itsId. In plenary mode, the exactIdis found or aNOT_FOUNDresults. Otherwise, the returnedStatemay have a differentIdthan requested, such as the case where a duplicateIdwas assigned to aStateand retained for compatibility.- Parameters:
stateId- theIdof theStateto retrieve- Returns:
- the returned
State - Throws:
NotFoundException- noStatefound with the givenIdNullArgumentException-stateIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getStatesByIds
StateList getStatesByIds(IdList stateIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets aStateListcorresponding to the givenIdList. In plenary mode, the returned list contains all of the states specified in theIdlist, in the order of the list, including duplicates, or an error results if anIdin the supplied list is not found or inaccessible. Otherwise, inaccessibleStatesmay be omitted from the list and may present the elements in any order including returning a unique set.- Parameters:
stateIds- the list ofIdsto retrieve- Returns:
- the returned
State list - Throws:
NotFoundException- anId wasnot foundNullArgumentException-stateIdLsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getStatesByGenusType
StateList getStatesByGenusType(Type stateGenusType) throws OperationFailedException, PermissionDeniedException Gets aStateListcorresponding to the given state genusTypewhich does not include states of types derived from the specifiedType. 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.- Parameters:
stateGenusType- a state genus type- Returns:
- the returned
Statelist - Throws:
NullArgumentException-stateGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getStatesByParentGenusType
StateList getStatesByParentGenusType(Type stateGenusType) throws OperationFailedException, PermissionDeniedException Gets aStateListcorresponding to the given state genusTypeand include any additional states with genus types derived from the specifiedType. 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.- Parameters:
stateGenusType- a state genus type- Returns:
- the returned
Statelist - Throws:
NullArgumentException-stateGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getStatesByRecordType
StateList getStatesByRecordType(Type stateRecordType) throws OperationFailedException, PermissionDeniedException Gets aStateListcontaining the given state recordType. 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.- Parameters:
stateRecordType- a state record type- Returns:
- the returned
Statelist - Throws:
NullArgumentException-stateRecordTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getStates
Gets allStates. 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.- Returns:
- a list of
States - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getValidNextStates
StateList getValidNextStates(Id stateId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the next valid states for the given state.- Parameters:
stateId- a stateId- Returns:
- the valid next
States - Throws:
NotFoundException-stateIdis not foundNullArgumentException-stateIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-