Interface AuthorizationBatchAdminSession
- All Superinterfaces:
AuthorizationAdminSession, AutoCloseable, Closeable, OsidSession, OsidSession
This session creates, updates, and deletes Authorizations in
bulk. 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
getAuthorizationFormsForCreate() specifying the desired qualifier,
resource, and record Types or none if no record Types are
needed. Each of the returned AuthorizationForms 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 an
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.
The AuthorizationForms returned from
getAuthorizationFormsForCreate() may be linked to the originating request
through the peer Ids of the AuthorizationForm . In the
case where there may be duplicates, any AuthorizationForm of the
same peer Ids may be used for a create operation.
Once a batch of AuthorizationForms are submitted for create, a
CreateResponse is returned for each AuthorizationForm ,
although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from createAuthorizations() ,
errors specific to an individual AuthorizationForm are indicated
in the corresponding CreateResponse . CreateResponses may
be linked to the originating AuthorizationForm through the
AuthorizationForm Id .
For updates, AuthorizationForms are requested to the
Authorization Id that is to be updated using
getAuthorizationFormsForUpdate() where the reference Id in the
AuthorizationForm may be used to link the request. 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.
Once a batch of AuthorizationForms are submitted for update,
an UpdateResponse is returned for each AuthorizationForm ,
although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from updateAuthorizations() ,
errors specific to an individual AuthorizationForm are indicated
in the corresponding UpdateResponse . UpdateResponses may
be linked to the originating AuthorizationForm through the
AuthorizationForm Id .
The delete operations delete Authorizations in bulk. 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. Bulk delete operations
return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasAuthorizations(AliasRequestList aliasRequests) Adds anIdto anAuthorizationfor the purpose of creating compatibility.createAuthorizations(AuthorizationBatchFormList authorizationForms) Creates a new set ofAuthorizations.Deletes allAuthorizationsin thisVault.deleteAuthorizations(IdList authorizationIds) Deletes authorizations for the givenIds.deleteAuthorizationsForQualifier(Id qualifierId) Deletes all authorizations for the given qualifier.deleteAuthorizationsForResource(Id resourceId) Deletes all authorizations for the given resource.Deletes authorizations expired before the given date.getAuthorizationFormsForCreateForAgents(AuthorizationAgentPeerList peers, Type[] authorizationRecordTypes) Gets the authorization forms for creating a bunch of new authorizations using agents.getAuthorizationFormsForCreateForResources(AuthorizationResourcePeerList peers, Type[] authorizationRecordTypes) Gets the authorization forms for creating a bunch of new authorizations using resources.getAuthorizationFormsForCreateForResourcesAndTrusts(AuthorizationTrustPeerList peers, Type[] authorizationRecordTypes) Gets the authorization forms for creating a bunch of new authorizations using resources and trusts.getAuthorizationFormsForUpdate(IdList authorizationIds) Gets the authorization forms for updating an existing set of authorizations.updateAuthorizations(AuthorizationBatchFormList authorizationForms) Updates existing authorizations.Methods inherited from interface AuthorizationAdminSession
aliasAuthorization, canCreateAuthorizations, canCreateAuthorizationWithRecordTypes, canDeleteAuthorizations, canManageAuthorizationAliases, canUpdateAuthorizations, createAuthorization, deleteAuthorization, getAuthorizationFormForCreateForAgent, getAuthorizationFormForCreateForResource, getAuthorizationFormForCreateForResourceAndTrust, getAuthorizationFormForUpdate, getVault, getVaultId, updateAuthorizationModifier 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
-
getAuthorizationFormsForCreateForAgents
AuthorizationBatchFormList getAuthorizationFormsForCreateForAgents(AuthorizationAgentPeerList peers, Type[] authorizationRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the authorization forms for creating a bunch of new authorizations using agents. An AuthorizationForm is returned for each qualifier and agent pair.- Parameters:
peers- the authorization peersauthorizationRecordTypes- array of authorization record types to be included in each create operation or an empty list if none- Returns:
- the authorization forms
- Throws:
NotFoundException- anagentId, functionId, orqualifierIdis not foundNullArgumentException-peersorauthorizationRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
getAuthorizationFormsForCreateForResources
AuthorizationBatchFormList getAuthorizationFormsForCreateForResources(AuthorizationResourcePeerList peers, Type[] authorizationRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the authorization forms for creating a bunch of new authorizations using resources. An AuthorizationForm is returned for each qualifier and agent pair.- Parameters:
peers- the authorization peersauthorizationRecordTypes- array of authorization record types to be included in each create operation or an empty list if none- Returns:
- the authorization forms
- Throws:
NotFoundException- aresourceId, functionId, orqualifierIdis not foundNullArgumentException-peersorauthorizationRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
getAuthorizationFormsForCreateForResourcesAndTrusts
AuthorizationBatchFormList getAuthorizationFormsForCreateForResourcesAndTrusts(AuthorizationTrustPeerList peers, Type[] authorizationRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the authorization forms for creating a bunch of new authorizations using resources and trusts. An AuthorizationForm is returned for each qualifier and agent pair.- Parameters:
peers- the authorization peersauthorizationRecordTypes- array of authorization record types to be included in each create operation or an empty list if none- Returns:
- the authorization forms
- Throws:
NotFoundException- aresourceId, trustId, functionId, orqualifierIdis not foundNullArgumentException-peersorauthorizationRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createAuthorizations
CreateResponseList createAuthorizations(AuthorizationBatchFormList authorizationForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofAuthorizations. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
authorizationForms- the authorization forms- Returns:
- the create responses
- Throws:
NullArgumentException-authorizationFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getAuthorizationFormsForUpdate
AuthorizationBatchFormList getAuthorizationFormsForUpdate(IdList authorizationIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the authorization forms for updating an existing set of authorizations. A new authorization form should be requested for each update transaction.- Parameters:
authorizationIds- theIdsof theAuthorization- Returns:
- the authorization form
- Throws:
NotFoundException- anauthorizationIdis not foundNullArgumentException-authorizationIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateAuthorizations
UpdateResponseList updateAuthorizations(AuthorizationBatchFormList authorizationForms) throws OperationFailedException, PermissionDeniedException Updates existing authorizations. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
authorizationForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-authorizationFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllAuthorizations
DeleteResponseList deleteAllAuthorizations() throws OperationFailedException, PermissionDeniedExceptionDeletes allAuthorizationsin thisVault.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAuthorizations
DeleteResponseList deleteAuthorizations(IdList authorizationIds) throws OperationFailedException, PermissionDeniedException Deletes authorizations for the givenIds.- Parameters:
authorizationIds- theIdsof the authorizations to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-authorizationIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAuthorizationsForResource
DeleteResponseList deleteAuthorizationsForResource(Id resourceId) throws OperationFailedException, PermissionDeniedException Deletes all authorizations for the given resource.- Parameters:
resourceId- anIdof a resource- Returns:
- the delete responses
- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAuthorizationsForQualifier
DeleteResponseList deleteAuthorizationsForQualifier(Id qualifierId) throws OperationFailedException, PermissionDeniedException Deletes all authorizations for the given qualifier.- Parameters:
qualifierId- anIdof a qualifier- Returns:
- the delete responses
- Throws:
NullArgumentException-qualifierIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteIneffectiveAuthorizationsByDate
DeleteResponseList deleteIneffectiveAuthorizationsByDate(DateTime date) throws OperationFailedException, PermissionDeniedException Deletes authorizations expired before the given date.- Parameters:
date- a date- Returns:
- the delete responses
- Throws:
NullArgumentException-dateisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasAuthorizations
AliasResponseList aliasAuthorizations(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto anAuthorizationfor the purpose of creating compatibility. The primaryIdof theAuthorizationis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another authorization, it is reassigned to the given entryId.- Parameters:
aliasRequests- the alias requests- Returns:
- the alias responses
- Throws:
NullArgumentException-aliasRequestsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-