public interface CompositionAdminSession extends OsidSession
This session creates, updates, and deletes Compositions.
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
Composition, a CompositionForm is requested using
getCompositionFormForCreate() specifying the desired record
Types or none if no record Types are needed.
The returned CompositionForm 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 CompositionForm
is submiited to a create operation, it cannot be reused with another
create operation unless the first operation was unsuccessful. Each
CompositionForm corresponds to an attempted transaction.
For updates, CompositionForms are requested to the
Composition Id that is to be updated using
getCompositionFormForUpdate(). Similarly, the
CompositionForm has metadata about the data that can be updated
and it can perform validation before submitting the update. The
CompositionForm can only be used once for a successful update and
cannot be reused.
The delete operations delete Compositions. To unmap a
Composition from the current Repository, the
CompositionRepositoryAssignmentSession should be used.
These delete operations attempt to remove the Bid itself
thus removing it from all known Repository 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 |
addCompositionChild(Id compositionId,
Id childCompositionId)
Adds a composition to a parent composition.
|
void |
aliasComposition(Id compositionId,
Id aliasId)
Adds an
Id to a Composition for the
purpose of creating compatibility. |
boolean |
canCreateCompositions()
Tests if this user can create
Compositions. |
boolean |
canCreateCompositionWithRecordTypes(Type[] compositionRecordTypes)
Tests if this user can create a single
Composition
using the desired record types. |
boolean |
canDeleteCompositions()
Tests if this user can delete
Compositions. |
boolean |
canManageCompositionAliases()
Tests if this user can manage
Id aliases for
Compositions. |
boolean |
canUpdateCompositions()
Tests if this user can update
Compositions. |
Composition |
createComposition(CompositionForm composiitonForm)
Creates a new
Composition. |
void |
deleteComposition(Id compositionId)
Deletes a
Composition. |
void |
deleteCompositionNode(Id compositionId)
Deletes a
Composition and all contained children. |
CompositionForm |
getCompositionFormForCreate(Type[] compositionRecordTypes)
Gets the composition form for creating new compositions.
|
CompositionForm |
getCompositionFormForUpdate(Id compositionId)
Gets the composition form for updating an existing composition.
|
Repository |
getRepository()
Gets the
Repository associated with this session. |
Id |
getRepositoryId()
Gets the
Repository Id associated with
this session. |
void |
removeCompositionChild(Id compositionId,
Id childCompositionId)
Removes a composition from a parent composition.
|
void |
updateComposition(CompositionForm composiitonForm)
Updates an existing composition.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseId getRepositoryId()
Repository Id associated with
this session. Repository Id associated with this sessionmandatory - This method must be implemented. Repository getRepository() throws OperationFailedException, PermissionDeniedException
Repository associated with this session. Repository associated with this sessionOperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canCreateCompositions()
Compositions. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating a Composition will
result in a PERMISSION_DENIED. This is intended as a
hint to an application that may not wish to offer create operations to
unauthorized users. false if Composition creation is
not authorized, true otherwisemandatory - This method must be implemented. boolean canCreateCompositionWithRecordTypes(Type[] compositionRecordTypes)
Composition
using the desired record types. While
RepositoryManager.getCompositionRecordTypes() can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Composition.
Providing an empty array tests if a Composition can be
created with no records.compositionRecordTypes - array of composition record types true if Composition creation
using the specified Types is supported,
false otherwiseNullArgumentException - compositionRecordTypes
is null mandatory - This method must be implemented. CompositionForm getCompositionFormForCreate(Type[] compositionRecordTypes) throws OperationFailedException, PermissionDeniedException
compositionRecordTypes - array of composition record typesNullArgumentException - compositionRecordTypes
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. Composition createComposition(CompositionForm composiitonForm) throws OperationFailedException, PermissionDeniedException
Composition. composiitonForm - the form for this Composition Composition IllegalStateException - compositionForm
already used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - compositionForm
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - compositionForm
did not originate from getCompositionFormForCreate()
mandatory - This method must be implemented. boolean canUpdateCompositions()
Compositions. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating a Composition will
result in a PERMISSION_DENIED. This is intended as a
hint to an application that may not wish to offer update operations to
unauthorized users. false if Composition
modification is not authorized, true otherwisemandatory - This method must be implemented. CompositionForm getCompositionFormForUpdate(Id compositionId) throws NotFoundException, OperationFailedException, PermissionDeniedException
compositionId - the Id of the Composition
NotFoundException - compositionId is not
foundNullArgumentException - compositionId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updateComposition(CompositionForm composiitonForm) throws OperationFailedException, PermissionDeniedException
composiitonForm - the form containing the elements to be updatedIllegalStateException - compositionForm
already used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - compositionForm
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - compositionForm
did not originate from getCompositionFormForUpdate()
mandatory - This method must be implemented. boolean canDeleteCompositions()
Compositions. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known deleting a Composition will
result in a PERMISSION_DENIED. This is intended as a
hint to an application that may not wish to offer delete operations to
unauthorized users. false if Composition deletion is
not authorized, true otherwisemandatory - This method must be implemented. void deleteComposition(Id compositionId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Composition. compositionId - the Id of the Composition
to removeNotFoundException - compositionId not
foundNullArgumentException - compositionId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void deleteCompositionNode(Id compositionId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Composition and all contained children.compositionId - the Id of the Composition
to removeNotFoundException - compositionId not
foundNullArgumentException - compositionId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void addCompositionChild(Id compositionId, Id childCompositionId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
compositionId - the Id of a parent
Composition childCompositionId - the Id of a child
Composition AlreadyExistsException - childCompositionId
is already a child of compositionId NotFoundException - compositionId or
childCompositionId is not foundNullArgumentException - compositionId or
childCompositionId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void removeCompositionChild(Id compositionId, Id childCompositionId) throws NotFoundException, OperationFailedException, PermissionDeniedException
compositionId - the Id of a parent
Composition childCompositionId - the Id of a child
Composition NotFoundException - compositionId or
childCompositionId is not found or not relatedNullArgumentException - compositionId or
childCompositionId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageCompositionAliases()
Id aliases for
Compositions. 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 Composition aliasing is
not authorized, true otherwisemandatory - This method must be implemented. void aliasComposition(Id compositionId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to a Composition for the
purpose of creating compatibility. The primary Id of
the Composition is determined by the provider. The new
Id is an alias to the primary Id. If the
alias is a pointer to another composition, it is reassigned to the
given composition Id. compositionId - the Id of a Composition
aliasId - the alias Id AlreadyExistsException - aliasId is in
use as a primary Id NotFoundException - compositionId not
foundNullArgumentException - compositionId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.