Interface CircleOfTrustSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session examines the relationship between Agents and
Trusts.
- isolated agency view: All agent methods in this session operate, retrieve and pertain to trusts defined explicitly in the current agency.
- federated agency view: All trust methods in this session operate, retrieve and pertain to all trusts defined in this agency and any other trusts implicitly available in this agency through agency inheritence.
Like all OsidSessions, CircleOfTrustSessions are
dedicated to single processing threads and a single authenticated user.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if this user can look up trusts for agents.Gets theAgencyassociated with this session.Gets theAgencyIdassociated with this session.Gets a trust level for the given agent.booleanisInCircle(Id agentId) Tests if the given agent is inside the given circle of trust.voidFederates the view for methods in this session.voidIsolates the view for methods in this session.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatTypes, getLocales, isAuthenticated, startTransaction, supportsTransactions
-
Method Details
-
getAgencyId
Id getAgencyId()Gets theAgencyIdassociated with this session.- Returns:
- the
Agency Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getAgency
Gets theAgencyassociated with this session.- Returns:
- the
Agencyassociated with this session - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canLookupTrustCircles
boolean canLookupTrustCircles()Tests if this user can look up trusts for agents. A return of true does not guarantee successful authorization. A return of false indicates that it is known these methods will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to users outside the circle.- Returns:
falseif trust methods are not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
useFederatedAgencyView
void useFederatedAgencyView()Federates the view for methods in this session. A federated view will include trusts in agencies which are children of this agency in the agency hierarchy.- Compliance:
mandatory- This method must be implemented.
-
useIsolatedAgencyView
void useIsolatedAgencyView()Isolates the view for methods in this session. An isolated view restricts lookups to this agency only.- Compliance:
mandatory- This method must be implemented.
-
getTrust
Trust getTrust(Id agentId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets a trust level for the given agent. AnAgentmay be in one circle of trust that, in turn, is inside another circle of trust. To test whether an agent is inside a specific circle, useIsInCircle().- Parameters:
agentId- an agentId- Returns:
- the trust
- Throws:
NotFoundException-agentIdis not foundNullArgumentException-agentIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
isInCircle
Tests if the given agent is inside the given circle of trust.- Parameters:
agentId- an agentId- Returns:
trueif the agent is in the given trust,falseif agent not found or is outside the circle- Throws:
NullArgumentException-agentIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-