Interface AuthorizationAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
AuthorizationBatchAdminSession
This session creates, updates, and deletes Authorizations . The
data for create and update is provided by the consumer via the form
object. OsidForms are requested for each create or update and may
not be reused.
Create and update operations differ in their usage. To create an
Authorization , an AuthorizationForm is requested using
getAuthorizationFormForCreate() specifying the desired
relationship peers and record Types or none if no record
Types are needed. The returned AuthorizationForm will indicate
that it is to be used with a create operation and can be used to examine
metdata or validate data prior to creation. Once the
AuthorizationForm is submiited to a create operation, it cannot be reused
with another create operation unless the first operation was unsuccessful.
Each AuthorizationForm corresponds to an attempted transaction.
For updates, AuthorizationForms are requested to the
Authorization Id that is to be updated using
getAuthorizationFormForUpdate() . Similarly, the
AuthorizationForm has metadata about the data that can be updated and it
can perform validation before submitting the update. The
AuthorizationForm can only be used once for a successful update and
cannot be reused.
The delete operations delete Authorizations . To unmap an
Authorization from the current Vault , the
AuthorizationVaultAssignmentSession should be used. These delete
operations attempt to remove the Authorization itself thus
removing it from all known Vault catalogs.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasAuthorization(Id authorizationId, Id aliasId) Adds anIdto anAuthorizationfor the purpose of creating compatibility.booleanTests if this user can createAuthorizations.booleancanCreateAuthorizationWithRecordTypes(Type[] authorizationRecordTypes) Tests if this user can create a singleAuthorizationusing the desired record types.booleanTests if this user can deleteAuthorizations.booleanTests if this user can manageIdaliases forAuthorizations.booleanTests if this user can updateAuthorizations.createAuthorization(AuthorizationForm authorizationForm) Creates a new explicitAuthorization.voiddeleteAuthorization(Id authorizationId) Deletes theAuthorizationidentified by the givenId.getAuthorizationFormForCreateForAgent(Id agentId, Id functionId, Id qualifierId, Type[] authorizationRecordTypes) Gets the authorization form for creating new authorizations.getAuthorizationFormForCreateForResource(Id resourceId, Id functionId, Id qualifierId, Type[] authorizationRecordTypes) Gets the authorization form for creating new authorizations.getAuthorizationFormForCreateForResourceAndTrust(Id resourceId, Id trustId, Id functionId, Id qualifierId, Type[] authorizationRecordTypes) Gets the authorization form for creating new authorizations.getAuthorizationFormForUpdate(Id authorizationId) Gets the authorization form for updating an existing authorization.getVault()Gets theVaultassociated with this session.Gets theVaultIdassociated with this session.voidupdateAuthorization(AuthorizationForm authorizationForm) Updates an existing authorizationMethods 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
-
getVaultId
Id getVaultId()Gets theVaultIdassociated with this session.- Returns:
- the
Vault Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getVault
Gets theVaultassociated with this session.- Returns:
- the
Vaultassociated with this session - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateAuthorizations
boolean canCreateAuthorizations()Tests if this user can createAuthorizations. 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 create operations to unauthorized users.- Returns:
falseifAuthorizationcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateAuthorizationWithRecordTypes
Tests if this user can create a singleAuthorizationusing the desired record types. WhileAuthorizationManager.getAuthorizationRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificAuthorization. Providing an empty array tests if anAuthorizationcan be created with no records.- Parameters:
authorizationRecordTypes- array of authorization record types- Returns:
trueifAuthorizationcreation using the specifiedTypesis supported,falseotherwise- Throws:
NullArgumentException-authorizationRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getAuthorizationFormForCreateForAgent
AuthorizationForm getAuthorizationFormForCreateForAgent(Id agentId, Id functionId, Id qualifierId, Type[] authorizationRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the authorization form for creating new authorizations. A new form should be requested for each create transaction.- Parameters:
agentId- the agentIdfunctionId- the functionIdqualifierId- the qualifierIdauthorizationRecordTypes- array of authorization record types- Returns:
- the authorization form
- Throws:
NotFoundException-agentId, functionIdorqualifierIdis not foundNullArgumentException-agentId, functionId, qualifierIdorauthorizationRecordTypesisnullOperationFailedException-unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form with requested record types- Compliance:
mandatory- This method must be implemented.
-
getAuthorizationFormForCreateForResource
AuthorizationForm getAuthorizationFormForCreateForResource(Id resourceId, Id functionId, Id qualifierId, Type[] authorizationRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the authorization form for creating new authorizations. A new form should be requested for each create transaction.- Parameters:
resourceId- the resourceIdfunctionId- the functionIdqualifierId- the qualifierIdauthorizationRecordTypes- array of authorization record types- Returns:
- the authorization form
- Throws:
NotFoundException-resourceId, functionIdorqualifierIdis not foundNullArgumentException-resourceId, functionId, qualifierId, orauthorizationRecordTypesisnullOperationFailedException-unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form with requested record types- Compliance:
mandatory- This method must be implemented.
-
getAuthorizationFormForCreateForResourceAndTrust
AuthorizationForm getAuthorizationFormForCreateForResourceAndTrust(Id resourceId, Id trustId, Id functionId, Id qualifierId, Type[] authorizationRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the authorization form for creating new authorizations. A new form should be requested for each create transaction.- Parameters:
resourceId- a resourceIdtrustId- anIdfor a circle of trustfunctionId- a functionIdqualifierId- the qualifierIdauthorizationRecordTypes- array of authorization record types- Returns:
- the authorization form
- Throws:
NotFoundException-resourceId, trustId, functionId, orqualifieridis not foundNullArgumentException-resourceId, trustId,resourceId, qualifierIdorauthorizationRecordTypesisnullOperationFailedException-unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form with requested record types- Compliance:
mandatory- This method must be implemented.
-
createAuthorization
Authorization createAuthorization(AuthorizationForm authorizationForm) throws OperationFailedException, PermissionDeniedException Creates a new explicitAuthorization.- Parameters:
authorizationForm- the authorization form- Returns:
the newAuthorization- Throws:
IllegalStateException-authorizationFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-authorizationFormisnullOperationFailedException-unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-authorizationFormdid not originate from this service- Compliance:
mandatory- This method must be implemented.
-
canUpdateAuthorizations
boolean canUpdateAuthorizations()Tests if this user can updateAuthorizations. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating anAuthorizationwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.- Returns:
falseif authorization modification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getAuthorizationFormForUpdate
AuthorizationForm getAuthorizationFormForUpdate(Id authorizationId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the authorization form for updating an existing authorization. A new authorization form should be requested for each update transaction.- Parameters:
authorizationId- theIdof theAuthorization- Returns:
- the authorization form
- Throws:
NotFoundException-authorizationIdis not foundNullArgumentException-authorizationIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateAuthorization
void updateAuthorization(AuthorizationForm authorizationForm) throws OperationFailedException, PermissionDeniedException Updates an existing authorization- Parameters:
authorizationForm- the authorizationId- Throws:
IllegalStateException-authorizationFormalready used in an update transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-authorizationFormisnullOperationFailedException-unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-authorizationFormdid not originate fromgetAuthorizationFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteAuthorizations
boolean canDeleteAuthorizations()Tests if this user can deleteAuthorizations. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting anAuthorizationwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.- Returns:
falseifAuthorizationdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteAuthorization
void deleteAuthorization(Id authorizationId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes theAuthorizationidentified by the givenId.- Parameters:
authorizationId- theIdof theAuthorizationto delete- Throws:
NotFoundException- anAuthorizationwas not found identified by the givenIdNullArgumentException-authorizationIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageAuthorizationAliases
boolean canManageAuthorizationAliases()Tests if this user can manageIdaliases forAuthorizations. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifAuthorizationaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasAuthorization
void aliasAuthorization(Id authorizationId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto anAuthorizationfor the purpose of creating compatibility. The primaryIdof theAuthorizationis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another authorization. it is reassigned to the given authorizationId.- Parameters:
authorizationId- theIdof anAuthorizationaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-authorizationIdnot foundNullArgumentException-authorizationIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-