Interface ChainAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session creates, updates, and deletes Chains . 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 a
Chain , a ChainForm is requested using
getChainFormForCreate() specifying the desired record Types or
none if no record Types are needed. The returned ChainForm
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
ChainForm is submiited to a create operation, it cannot be reused
with another create operation unless the first operation was unsuccessful.
Each ChainForm corresponds to an attempted transaction.
For updates, ChainForms are requested to the Chain
Id that is to be updated using getChainFormForUpdate() .
Similarly, the ChainForm has metadata about the data that can be
updated and it can perform validation before submitting the update. The
ChainForm can only be used once for a successful update and cannot
be reused.
The delete operations delete Chains . To unmap a Chain
from the current Antimatroid , the
ChainAntimatroidAssignmentSession should be used. These delete operations
attempt to remove the Chain itself thus removing it from all known
Antimatroid catalogs.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasChain(Id chainId, Id aliasId) Adds anIdto aChainfor the purpose of creating compatibility.booleanTests if this user can create chains.booleancanCreateChainWithRecordTypes(Type[] chainRecordTypes) Tests if this user can create a singleChainusing the desired record types.booleanTests if this user can delete chains.booleanTests if this user can manageIdaliases forChains.booleanTests if this user can update chains.createChain(ChainForm chainForm) Creates a newChain.voiddeleteChain(Id chainId) Deletes aChain.Gets theAntimatroidassociated with this session.Gets theAntimatroidIdassociated with this session.getChainFormForCreate(Type[] chainRecordTypes) Gets the chain form for creating new chains.getChainFormForUpdate(Id chainId) Gets the chain form for updating an existing chain.voidupdateChain(ChainForm chainForm) Updates an existing chain.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
-
getAntimatroidId
Id getAntimatroidId()Gets theAntimatroidIdassociated with this session.- Returns:
- the
Antimatroid Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getAntimatroid
Gets theAntimatroidassociated with this session.- Returns:
- the antimatroid
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateChains
boolean canCreateChains()Tests if this user can create chains. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aChainwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseifChaincreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateChainWithRecordTypes
Tests if this user can create a singleChainusing the desired record types. WhileSequencingManager.getChainRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificChain. Providing an empty array tests if aChaincan be created with no records.- Parameters:
chainRecordTypes- array of chain record types- Returns:
trueifChaincreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-chainRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getChainFormForCreate
ChainForm getChainFormForCreate(Type[] chainRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the chain form for creating new chains. A new form should be requested for each create transaction.- Parameters:
chainRecordTypes- array of chain record types- Returns:
- the chain form
- Throws:
NullArgumentException-chainRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createChain
Chain createChain(ChainForm chainForm) throws NotFoundException, OperationFailedException, PermissionDeniedException Creates a newChain.- Parameters:
chainForm- the form for thisChain- Returns:
- the new
Chain - Throws:
IllegalStateException-chainFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNotFoundException-resourceIdorinputIdis not foundNullArgumentException-chainFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-chainFormdid not originate fromgetChainFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateChains
boolean canUpdateChains()Tests if this user can update chains. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aChainwill 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:
falseifChainmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getChainFormForUpdate
ChainForm getChainFormForUpdate(Id chainId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the chain form for updating an existing chain. A new chain form should be requested for each update transaction.- Parameters:
chainId- theIdof theChain- Returns:
- the chain form
- Throws:
NotFoundException-chainIdis not foundNullArgumentException-chainIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateChain
Updates an existing chain.- Parameters:
chainForm- the form containing the elements to be updated- Throws:
IllegalStateException-chainFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-chainFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-chainFormdid not originate fromgetChainFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteChains
boolean canDeleteChains()Tests if this user can delete chains. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aChainwill 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:
falseifChaindeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteChain
void deleteChain(Id chainId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aChain.- Parameters:
chainId- theIdof theChainto remove- Throws:
NotFoundException-chainIdnot foundNullArgumentException-chainIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageChainAliases
boolean canManageChainAliases()Tests if this user can manageIdaliases forChains. 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:
falseifChainaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasChain
void aliasChain(Id chainId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aChainfor the purpose of creating compatibility. The primaryIdof theChainis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another chain, it is reassigned to the given chainId.- Parameters:
chainId- theIdof aChainaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-chainIdnot foundNullArgumentException-chainIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-