public interface CommissionAdminSession extends OsidSession
This session creates, updates, and deletes Commissions.
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
Commission, a CommissionForm is requested using
getCommissionFormForCreate() specifying the desired
relationship peers and record Types or none if no record
Types are needed. The returned CommissionForm
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 CommissionForm is submiited to a create operation, it
cannot be reused with another create operation unless the first operation
was unsuccessful. Each CommissionForm corresponds to an
attempted transaction.
For updates, CommissionForms are requested to the
Commission Id that is to be updated using
getCommissionFormForUpdate(). Similarly, the
CommissionForm has metadata about the data that can be updated and
it can perform validation before submitting the update. The
CommissionForm can only be used once for a successful update and
cannot be reused.
The delete operations delete Commissions. To unmap a
Commission from the current Foundry, the
CommissionFoundryAssignmentSession should be used. These
delete operations attempt to remove the Commission itself
thus removing it from all known Foundry 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 |
aliasCommission(Id commissionId,
Id aliasId)
Adds an
Id to a Commission for the
purpose of creating compatibility. |
boolean |
canCreateCommissions()
Tests if this user can create
Commissions. |
boolean |
canCreateCommissionWithRecordTypes(Type[] commissionRecordTypes)
Tests if this user can create a single
Commission using
the desired record types. |
boolean |
canDeleteCommissions()
Tests if this user can delete
Commissions. |
boolean |
canManageCommissionAliases()
Tests if this user can manage
Id aliases for
Commissions. |
boolean |
canUpdateCommissions()
Tests if this user can update
Commissions. |
Commission |
createCommission(CommissionForm commissionForm)
Creates a new
Commission. |
void |
deleteCommission(Id commissionId)
Deletes a
Commission. |
CommissionForm |
getCommissionFormForCreate(Id resourceId,
Id workId,
Type[] commissionRecordTypes)
Gets the commission form for creating new commissions.
|
CommissionForm |
getCommissionFormForUpdate(Id commissionId)
Gets the commission form for updating an existing commission.
|
Foundry |
getFoundry()
Gets the
Foundry associated with this session. |
Id |
getFoundryId()
Gets the
Foundry Id associated with this
session. |
void |
updateCommission(CommissionForm commissionForm)
Updates an existing commission.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseId getFoundryId()
Foundry Id associated with this
session. Foundry Id associated with this sessionmandatory - This method must be implemented. Foundry getFoundry() throws OperationFailedException, PermissionDeniedException
Foundry associated with this session.OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canCreateCommissions()
Commissions. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating a Commission 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 Commission creation is
not authorized, true otherwisemandatory - This method must be implemented. boolean canCreateCommissionWithRecordTypes(Type[] commissionRecordTypes)
Commission using
the desired record types. While
ResourcingManager.getCommissionRecordTypes() can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Commission.
Providing an empty array tests if a Commission can be
created with no records.commissionRecordTypes - array of commission record types true if Commission creation
using the specified record Types is supported,
false otherwiseNullArgumentException - commissionRecordTypes
is null mandatory - This method must be implemented. CommissionForm getCommissionFormForCreate(Id resourceId, Id workId, Type[] commissionRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
resourceId - the Id for the resourceworkId - the Id for the workcommissionRecordTypes - array of commission record typesNotFoundException - resourceId or
workId is not foundNullArgumentException - resourceId, workId,
or commissionRecordTypes is null
OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. Commission createCommission(CommissionForm commissionForm) throws OperationFailedException, PermissionDeniedException
Commission. commissionForm - the form for this Commission Commission IllegalStateException - commissionForm
already used for a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - commissionForm
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - commissionForm
did no originate from getCommissionFormForCreate()
mandatory - This method must be implemented. boolean canUpdateCommissions()
Commissions. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating a Commission 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 Commission modification
is not authorized, true otherwisemandatory - This method must be implemented. CommissionForm getCommissionFormForUpdate(Id commissionId) throws NotFoundException, OperationFailedException, PermissionDeniedException
commissionId - the Id of the Commission
NotFoundException - commissionId is not
foundNullArgumentException - commissionId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updateCommission(CommissionForm commissionForm) throws OperationFailedException, PermissionDeniedException
commissionForm - the form containing the elements to be updatedIllegalStateException - commissionForm
already used for an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - commissionForm
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - commissionForm
did no originate from getCommissionFormForUpdate()
mandatory - This method must be implemented. boolean canDeleteCommissions()
Commissions. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known deleting a Commission 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 Commission deletion is
not authorized, true otherwisemandatory - This method must be implemented. void deleteCommission(Id commissionId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Commission. commissionId - the Id of the Commission
to removeNotFoundException - commissionId not
foundNullArgumentException - commissionId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageCommissionAliases()
Id aliases for
Commissions. 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 Commission aliasing is
not authorized, true otherwisemandatory - This method must be implemented. void aliasCommission(Id commissionId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to a Commission for the
purpose of creating compatibility. The primary Id of
the Commission is determined by the provider. The new
Id performs as an alias to the primary Id.
If the alias is a pointer to another commission, it is
reassigned to the given commission Id. commissionId - the Id of a Commission
aliasId - the alias Id AlreadyExistsException - aliasId is
already assignedNotFoundException - commissionId not
foundNullArgumentException - commissionId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.