public interface DistributorAdminSession extends OsidSession
This session creates, updates, and deletes Distributors.
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
Distributor, a DistributorForm is requested using
getDistributorFormForCreate() specifying the desired record
Types or none if no record Types are needed.
The returned DistributorForm 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 DistributorForm
is submiited to a create operation, it cannot be reused with another
create operation unless the first operation was unsuccessful. Each
DistributorForm corresponds to an attempted transaction.
For updates, DistributorForms are requested to the
Distributor Id that is to be updated using
getDistributorFormForUpdate(). Similarly, the
DistributorForm has metadata about the data that can be updated
and it can perform validation before submitting the update. The
DistributorForm can only be used once for a successful update and
cannot be reused.
The delete operations delete Distributors.
This session includes an Id aliasing mechanism to
assign an external Id to an internally assigned Id.
| Modifier and Type | Method and Description |
|---|---|
void |
aliasDistributor(Id distributorId,
Id aliasId)
Adds an
Id to a Distributor for the
purpose of creating compatibility. |
boolean |
canCreateDistributors()
Tests if this user can create
Distributors. |
boolean |
canCreateDistributorWithRecordTypes(Type[] distributorRecordTypes)
Tests if this user can create a single
Distributor
using the desired record types. |
boolean |
canDeleteDistributors()
Tests if this user can delete
Distributors. |
boolean |
canManageDistributorAliases()
Tests if this user can manage
Id aliases for
Distributors. |
boolean |
canUpdateDistributors()
Tests if this user can update
Distributors. |
Distributor |
createDistributor(DistributorForm distributorForm)
Creates a new
Distributor. |
void |
deleteDistributor(Id distributorId)
Deletes a
Distributor. |
DistributorForm |
getDistributorFormForCreate(Type[] distributorRecordTypes)
Gets the distributor form for creating new distributors.
|
DistributorForm |
getDistributorFormForUpdate(Id distributorId)
Gets the distributor form for updating an existing distributor.
|
void |
updateDistributor(DistributorForm distributorForm)
Updates an existing distributor
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseboolean canCreateDistributors()
Distributors. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating a Distributor. 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 Distributor creation is
not authorized, true otherwisemandatory - This method must be implemented. boolean canCreateDistributorWithRecordTypes(Type[] distributorRecordTypes)
Distributor
using the desired record types. While
ProvisioningManager.getDistributorRecordTypes() can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Distributor.
Providing an empty array tests if a Distributor can be
created with no records.distributorRecordTypes - array of distributor record types true if Distributor creation
using the specified record Types is supported,
false otherwiseNullArgumentException - distributorRecordTypes
is null mandatory - This method must be implemented. DistributorForm getDistributorFormForCreate(Type[] distributorRecordTypes) throws OperationFailedException, PermissionDeniedException
distributorRecordTypes - array of distributor record typesNullArgumentException - distributorRecordTypes
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. Distributor createDistributor(DistributorForm distributorForm) throws OperationFailedException, PermissionDeniedException
Distributor. distributorForm - the form for this Distributor Distributor IllegalStateException - distributorForm
already used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - distributorForm
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - distributorForm
did not originate from getDistributorFormForCreate()
mandatory - This method must be implemented. boolean canUpdateDistributors()
Distributors. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating a Distributor 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 Distributor
modification is not authorized, true otherwisemandatory - This method must be implemented. DistributorForm getDistributorFormForUpdate(Id distributorId) throws NotFoundException, OperationFailedException, PermissionDeniedException
distributorId - the Id of the Distributor
NotFoundException - distributorId is not
foundNullArgumentException - distributorId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updateDistributor(DistributorForm distributorForm) throws OperationFailedException, PermissionDeniedException
distributorForm - the form containing the elements to be updatedIllegalStateException - distributorForm
already used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - distributorForm
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - distributorForm
did not originate from getDistributorFormForUpdate()
mandatory - This method must be implemented. boolean canDeleteDistributors()
Distributors. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known deleting a Distributor 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 Distributor deletion is
not authorized, true otherwisemandatory - This method must be implemented. void deleteDistributor(Id distributorId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Distributor. distributorId - the Id of the Distributor
to removeNotFoundException - distributorId not
foundNullArgumentException - distributorId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageDistributorAliases()
Id aliases for
Distributors. 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 Distributor aliasing is
not authorized, true otherwisemandatory - This method must be implemented. void aliasDistributor(Id distributorId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to a Distributor for the
purpose of creating compatibility. The primary Id of
the Distributor is determined by the provider. The new
Id performs as an alias to the primary Id.
distributorId - the Id of a Distributor
aliasId - the alias Id AlreadyExistsException - aliasId is
already assignedNotFoundException - distributorId not
foundNullArgumentException - distributorId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.