public interface AgentLookupSession extends OsidSession
This session provides methods for retrieving Agent
objects. The Agent represents the authenticated entity.
Agents generally map to resources although this isn't always the case.
This session defines two sets of views which offer differing behaviors when retrieving multiple objects.
Generally, the comparative view should be used for most applications as it permits operation even if there a particular element is inaccessible. For example, a hierarchy output can be plugged into a lookup method to retrieve all objects known to a hierarchy, but it may not be necessary to break execution if a node from the hierarchy no longer exists. However, some administrative applications may need to know whether it had retrieved an entire set of objects and may sacrifice some interoperability for the sake of precision.
Agents may have an additional records indicated by their respective
record types. The record may not be accessed through a cast of the
Agent.
| Modifier and Type | Method and Description |
|---|---|
boolean |
canLookupAgents()
Tests if this user can perform
Agent lookups. |
Agency |
getAgency()
Gets the
Agency associated with this session. |
Id |
getAgencyId()
Gets the
Agency Id associated with this
session. |
Agent |
getAgent(Id agentId)
Gets the
Agent specified by its Id. |
AgentList |
getAgents()
Gets all
Agents. |
AgentList |
getAgentsByGenusType(Type agentGenusType)
Gets an
AgentList corresponding to the given agent
genus Type which does not include agents of genus types
derived from the specified Type. |
AgentList |
getAgentsByIds(IdList agentIds)
Gets an
AgentList corresponding to the given
IdList. |
AgentList |
getAgentsByParentGenusType(Type agentGenusType)
Gets an
AgentList corresponding to the given agent
genus Type and include any additional agents with genus
types derived from the specified Type. |
AgentList |
getAgentsByRecordType(Type agentRecordType)
Gets an
AgentList containing the given agent record
Type. |
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.
|
void |
useFederatedAgencyView()
Federates the view for methods in this session.
|
void |
useIsolatedAgencyView()
Isolates the view for methods in this session.
|
void |
usePlenaryAgentView()
A complete view of the
Agent returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseId getAgencyId()
Agency Id associated with this
session. Agency Id associated with this sessionmandatory - This method must be implemented. Agency getAgency() throws OperationFailedException, PermissionDeniedException
Agency associated with this session. Agency associated with this sessionOperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canLookupAgents()
Agent 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 useComparativeAgentView()
mandatory - This method is must be implemented. void usePlenaryAgentView()
Agent 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 useFederatedAgencyView()
mandatory - This method is must be implemented. void useIsolatedAgencyView()
mandatory - This method is must be implemented. Agent getAgent(Id agentId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Agent specified by its Id. In
plenary mode, the exact Id is found or a
NOT_FOUND results. Otherwise, the returned Agent
may have a different Id than requested, such as
the case where a duplicate Id was assigned to an
Agent and retained for compatibility.agentId - the Id of an Agent Agent NotFoundException - no Agent found with
the given Id NullArgumentException - agentId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. AgentList getAgentsByIds(IdList agentIds) throws NotFoundException, OperationFailedException, PermissionDeniedException
AgentList corresponding to the given
IdList. In plenary mode, the returned list contains all of the
agents 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 Agents may be omitted from the list and
may present the elements in any order including returning a unique
set.agentIds - a list of agent Ids Agent list NotFoundException - an Id was not foundNullArgumentException - agentIds is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. AgentList getAgentsByGenusType(Type agentGenusType) throws OperationFailedException, PermissionDeniedException
AgentList corresponding to the given agent
genus Type which does not include agents of genus types
derived from the specified Type. In plenary mode, the
returned list contains all known agents or an error results.
Otherwise, the returned list may contain only those agents that are
accessible through this session.agentGenusType - an agent genus type Agent listNullArgumentException - agentGenusType
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. AgentList getAgentsByParentGenusType(Type agentGenusType) throws OperationFailedException, PermissionDeniedException
AgentList corresponding to the given agent
genus Type and include any additional agents with genus
types derived from the specified Type. In plenary mode,
the returned list contains all known agents or an error results.
Otherwise, the returned list may contain only those agents that are
accessible through this session.agentGenusType - an agent genus type Agent listNullArgumentException - agentGenusType
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. AgentList getAgentsByRecordType(Type agentRecordType) throws OperationFailedException, PermissionDeniedException
AgentList containing the given agent record
Type. In plenary mode, the returned list contains all
known agents or an error results. Otherwise, the returned list may
contain only those agents that are accessible through this session.agentRecordType - an agent record type Agent listNullArgumentException - agentRecordType
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. AgentList getAgents() throws OperationFailedException, PermissionDeniedException
Agents. In plenary mode, the returned list
contains all known agents or an error results. Otherwise, the returned
list may contain only those agents that are accessible through this
session. Agents OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.