public interface ChainAdminSession extends 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.
| Modifier and Type | Method and Description |
|---|---|
void |
aliasChain(Id chainId,
Id aliasId)
Adds an
Id to a Chain for the purpose of
creating compatibility. |
boolean |
canCreateChains()
Tests if this user can create chains.
|
boolean |
canCreateChainWithRecordTypes(Type[] chainRecordTypes)
Tests if this user can create a single
Chain using the
desired record types. |
boolean |
canDeleteChains()
Tests if this user can delete chains.
|
boolean |
canManageChainAliases()
Tests if this user can manage
Id aliases for
Chains. |
boolean |
canUpdateChains()
Tests if this user can update chains.
|
Chain |
createChain(ChainForm chainForm)
Creates a new
Chain. |
void |
deleteChain(Id chainId)
Deletes a
Chain. |
Antimatroid |
getAntimatroid()
Gets the
Antimatroid associated with this session. |
Id |
getAntimatroidId()
Gets the
Antimatroid Id associated with
this session. |
ChainForm |
getChainFormForCreate(Type[] chainRecordTypes)
Gets the chain form for creating new chains.
|
ChainForm |
getChainFormForUpdate(Id chainId)
Gets the chain form for updating an existing chain.
|
void |
updateChain(ChainForm chainForm)
Updates an existing chain.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseId getAntimatroidId()
Antimatroid Id associated with
this session. Antimatroid Id associated with this sessionmandatory - This method must be implemented. Antimatroid getAntimatroid() throws OperationFailedException, PermissionDeniedException
Antimatroid associated with this session.OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canCreateChains()
Chain will result in a
PERMISSION_DENIED. This is intended as a hint to an
application that may opt not to offer create operations to an
unauthorized user. false if Chain creation is not
authorized, true otherwisemandatory - This method must be implemented. boolean canCreateChainWithRecordTypes(Type[] chainRecordTypes)
Chain using the
desired record types. While
SequencingManager.getChainRecordTypes() can be used to examine
which records are supported, this method tests which record(s) are
required for creating a specific Chain. Providing an
empty array tests if a Chain can be created with no
records.chainRecordTypes - array of chain record types true if Chain creation using the
specified record Types is supported,
false otherwiseNullArgumentException - chainRecordTypes
is null mandatory - This method must be implemented. ChainForm getChainFormForCreate(Type[] chainRecordTypes) throws OperationFailedException, PermissionDeniedException
chainRecordTypes - array of chain record typesNullArgumentException - chainRecordTypes
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. Chain createChain(ChainForm chainForm) throws NotFoundException, OperationFailedException, PermissionDeniedException
Chain. chainForm - the form for this Chain Chain IllegalStateException - chainForm
already used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNotFoundException - resourceId or
inputId is not foundNullArgumentException - chainForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - chainForm did not
originate from getChainFormForCreate() mandatory - This method must be implemented. boolean canUpdateChains()
Chain will result in a
PERMISSION_DENIED. This is intended as a hint to an
application that may opt not to offer update operations to an
unauthorized user. false if Chain modification is
not authorized, true otherwisemandatory - This method must be implemented. ChainForm getChainFormForUpdate(Id chainId) throws NotFoundException, OperationFailedException, PermissionDeniedException
chainId - the Id of the Chain NotFoundException - chainId is not foundNullArgumentException - chainId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updateChain(ChainForm chainForm) throws OperationFailedException, PermissionDeniedException
chainForm - the form containing the elements to be updatedIllegalStateException - chainForm
already used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - chainForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - chainForm did not
originate from getChainFormForUpdate() mandatory - This method must be implemented. boolean canDeleteChains()
Chain will result in a
PERMISSION_DENIED. This is intended as a hint to an
application that may opt not to offer delete operations to an
unauthorized user. false if Chain deletion is not
authorized, true otherwisemandatory - This method must be implemented. void deleteChain(Id chainId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Chain. chainId - the Id of the Chain to
removeNotFoundException - chainId not foundNullArgumentException - chainId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageChainAliases()
Id aliases for
Chains. A return of true does not guarantee successful
authorization. A return of false indicates that it is known changing
an alias will result in a PERMISSION_DENIED. This is
intended as a hint to an application that may opt not to offer alias
operations to an unauthorized user. false if Chain aliasing is not
authorized, true otherwisemandatory - This method must be implemented. void aliasChain(Id chainId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to a Chain for the purpose of
creating compatibility. The primary Id of the
Chain is determined by the provider. The new Id
performs as an alias to the primary Id . If the alias
is a pointer to another chain, it is reassigned to the given chain
Id. chainId - the Id of a Chain aliasId - the alias Id AlreadyExistsException - aliasId is
already assignedNotFoundException - chainId not foundNullArgumentException - chainId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.