Interface ResourceAgentSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session provides methods to retrieve Resource to
Agent mappings. An Agent may map to only one Resource
while a Resource may map to multiple Agents .
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
-
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if this user can perform checks of resource/agent mappings.booleanTests if this user can perform lookups of resource/agent mappings.getAgentIdsByResource(Id resourceId) Gets the list ofAgentIdsassociated with aResource.getAgentIdsByResources(IdList resourceIds) Gets the list ofAgentIdsassociated with any of the givenResources.getAgentsByResource(Id resourceId) Gets the list ofAgentIdsassociated with aResource.getAgentsByResources(IdList resourceIds) Gets the list ofAgentsassociated with any of the givenResources.getBin()Gets theBinassociated with this session.getBinId()Gets theBinIdassociated with this session.getResourceByAgent(Id agentId) Gets theResourcedirectly associated with the given agent.getResourceIdByAgent(Id agentId) Gets theResourceIddirectly associated with the given agent.booleanisAgentForResource(Id agentId, Id resourceId) Tests if the givenAgentis associated with the givenResource.booleanisAgentForResources(Id agentId, IdList resourceIds) Tests if the givenAgentis associated with any of the givenResources.voidThe returns from the lookup methods may omit or translate elements based on this session, such as authorization, and not result in an error.voidReturns the Agents only directly mapped to the given Resource.voidFederates the view for methods in this session.voidReturns theAgentsdirectly mapped to the Resource and any Resource implied by the given Resource through grouping or demographic rules.voidIsolates the view for methods in this session.voidA complete view of theAgentreturns 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
-
getBinId
Id getBinId()Gets theBinIdassociated with this session.- Returns:
- the
Bin Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getBin
Gets theBinassociated with this session.- Returns:
- the
Binassociated with this session - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canLookupResourceAgentMappings
boolean canLookupResourceAgentMappings()Tests if this user can perform lookups of resource/agent mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known lookup 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 to unauthorized users.- Returns:
falseif looking up mappings is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
useComparativeAgentView
void useComparativeAgentView()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.
-
usePlenaryAgentView
void usePlenaryAgentView()A complete view of theAgentreturns 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.
-
useFederatedBinView
void useFederatedBinView()Federates the view for methods in this session. A federated view will include resources in bins which are children of this bin in the bin hierarchy.- Compliance:
mandatory- This method is must be implemented.
-
useIsolatedBinView
void useIsolatedBinView()Isolates the view for methods in this session. An isolated view restricts lookups to this bin only.- Compliance:
mandatory- This method is must be implemented.
-
useImplicitResourceView
void useImplicitResourceView()Returns theAgentsdirectly mapped to the Resource and any Resource implied by the given Resource through grouping or demographic rules.- Compliance:
mandatory- This method is must be implemented.
-
useExplciitResourceView
void useExplciitResourceView()Returns the Agents only directly mapped to the given Resource.- Compliance:
mandatory- This method is must be implemented.
-
getResourceIdByAgent
Id getResourceIdByAgent(Id agentId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets theResourceIddirectly associated with the given agent.- Parameters:
agentId-Idof theAgent- Returns:
- associated resource
- Throws:
NotFoundException-agentIdis not foundNullArgumentException-agentIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getResourceByAgent
Resource getResourceByAgent(Id agentId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets theResourcedirectly associated with the given agent.- Parameters:
agentId-Idof theAgent- Returns:
- associated resource
- Throws:
NotFoundException-agentIdis not foundNullArgumentException-agentIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getAgentIdsByResource
IdList getAgentIdsByResource(Id resourceId) throws OperationFailedException, PermissionDeniedException Gets the list ofAgentIdsassociated with aResource. In implicit resource mode,Agentsare returns for the givenResourceand anyResourceimplied through grouping or demographic rules. Otherwise, onlyAgentsexplicitly mapped to the givenResourceare returned.- Parameters:
resourceId-Idof aResource- Returns:
- list of agent
Ids - Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getAgentsByResource
AgentList getAgentsByResource(Id resourceId) throws OperationFailedException, PermissionDeniedException Gets the list ofAgentIdsassociated with aResource. In implicit resource mode,Agentsare returns for the givenResourceand anyResourceimplied through grouping or demographic rules. Otherwise, onlyAgentsexplicitly mapped to the givenResourceare returned.- Parameters:
resourceId-Idof aResource- Returns:
- list of agents
- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getAgentIdsByResources
IdList getAgentIdsByResources(IdList resourceIds) throws OperationFailedException, PermissionDeniedException Gets the list ofAgentIdsassociated with any of the givenResources. In implicit resource mode,Agentsare returns for the givenResourceand anyResourceimplied through grouping or demographic rules. Otherwise, onlyAgentsexplicitly mapped to the givenResourceare returned.- Parameters:
resourceIds-Idsof theResources- Returns:
- list of agent
Ids - Throws:
NullArgumentException-resourceIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getAgentsByResources
AgentList getAgentsByResources(IdList resourceIds) throws OperationFailedException, PermissionDeniedException Gets the list ofAgentsassociated with any of the givenResources. In implicit resource mode,Agentsare returns for the givenResourceand anyResourceimplied through grouping or demographic rules. Otherwise, onlyAgentsexplicitly mapped to the givenResourceare returned.- Parameters:
resourceIds-Idsof theResources- Returns:
- list of agents
- Throws:
NullArgumentException-resourceIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCheckResourceAgentMappings
boolean canCheckResourceAgentMappings()Tests if this user can perform checks of resource/agent mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known lookup 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 to unauthorized users.- Returns:
falseif checking up mappings is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
isAgentForResource
boolean isAgentForResource(Id agentId, Id resourceId) throws OperationFailedException, PermissionDeniedException Tests if the givenAgentis associated with the givenResource. In implicit resource mode, the givenResourceand anyResourceimplied through grouping or demographic rules are checked. Otherwise, only the givenResourceis checked.- Parameters:
agentId-Idof anAgentresourceId-Idof aResource- Returns:
trueofagentIdis associated with the givenresourceId,falseotherwise- Throws:
NullArgumentException-agentIdorresourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
isAgentForResources
boolean isAgentForResources(Id agentId, IdList resourceIds) throws OperationFailedException, PermissionDeniedException Tests if the givenAgentis associated with any of the givenResources. In implicit resource mode, the givenResourceand anyResourceimplied through grouping or demographic rules are checked. Otherwise, only the givenResourceis checked.- Parameters:
agentId-Idof anAgentresourceIds-Idsof theResources- Returns:
trueofagentIdis associated with any of the givenresourceIds,falseotherwise- Throws:
NullArgumentException-agentIdorresourceIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-