public interface PoolAdminSession extends OsidSession
This session creates, updates, and deletes Pools. 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
Pool, a PoolForm is requested using
getPoolFormForCreate() specifying the desired broker and record
Types or none if no record Types are needed.
The returned PoolForm 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 PoolForm is submiited to a
create operation, it cannot be reused with another create operation unless
the first operation was unsuccessful. Each PoolForm
corresponds to an attempted transaction.
For updates, PoolForms are requested to the Pool
Id that is to be updated using
getPoolFormForUpdate(). Similarly, the PoolForm has
metadata about the data that can be updated and it can perform validation
before submitting the update. The PoolForm can only be used
once for a successful update and cannot be reused.
The delete operations delete Pools. To unmap a
Pool from the current Distributor, the
PoolDistributorAssignmentSession should be used. These delete
operations attempt to remove the Pool itself thus removing
it from all known Distributor 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 |
aliasPool(Id poolId,
Id aliasId)
Adds an
Id to a Pool for the purpose of
creating compatibility. |
boolean |
canCreatePools()
Tests if this user can create
Pools. |
boolean |
canCreatePoolWithRecordTypes(Type[] poolRecordTypes)
Tests if this user can create a single
Pool using the
desired record types. |
boolean |
canDeletePools()
Tests if this user can delete
Pools. |
boolean |
canManagePoolAliases()
Tests if this user can manage
Id aliases for
Pools. |
boolean |
canUpdatePools()
Tests if this user can update
Pools. |
Pool |
createPool(PoolForm poolForm)
Creates a new
Pool. |
void |
deletePool(Id poolId)
Deletes a
Pool. |
Distributor |
getDistributor()
Gets the
Distributor associated with this session. |
Id |
getDistributorId()
Gets the
Distributor Id associated with
this session. |
PoolForm |
getPoolFormForCreate(Id brokerId,
Type[] poolRecordTypes)
Gets the pool form for creating new pools.
|
PoolForm |
getPoolFormForUpdate(Id poolId)
Gets the pool form for updating an existing pool.
|
void |
updatePool(PoolForm poolForm)
Updates an existing pool.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseId getDistributorId()
Distributor Id associated with
this session. Distributor Id associated with this sessionmandatory - This method must be implemented. Distributor getDistributor() throws OperationFailedException, PermissionDeniedException
Distributor associated with this session.OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canCreatePools()
Pools. A return of true
does not guarantee successful authorization. A return of false
indicates that it is known creating a Pool 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 Pool creation is not
authorized, true otherwisemandatory - This method must be implemented. boolean canCreatePoolWithRecordTypes(Type[] poolRecordTypes)
Pool using the
desired record types. While
ProvisioningManager.getPoolRecordTypes() can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Pool. Providing an
empty array tests if a Pool can be created with no
records.poolRecordTypes - array of pool record types true if Pool creation using the
specified record Types is supported,
false otherwiseNullArgumentException - poolRecordTypes
is null mandatory - This method must be implemented. PoolForm getPoolFormForCreate(Id brokerId, Type[] poolRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
brokerId - a broker Id poolRecordTypes - array of pool record typesNotFoundException - brokerId is not
foundNullArgumentException - brokerId or
poolRecordTypes is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. Pool createPool(PoolForm poolForm) throws OperationFailedException, PermissionDeniedException
Pool. poolForm - the form for this Pool Pool IllegalStateException - poolForm already
used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - poolForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - poolForm did not
originate from getPoolFormForCreate() mandatory - This method must be implemented. boolean canUpdatePools()
Pools. A return of true
does not guarantee successful authorization. A return of false
indicates that it is known updating a Pool 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 Pool modification is
not authorized, true otherwisemandatory - This method must be implemented. PoolForm getPoolFormForUpdate(Id poolId) throws NotFoundException, OperationFailedException, PermissionDeniedException
poolId - the Id of the Pool NotFoundException - poolId is not foundNullArgumentException - poolId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updatePool(PoolForm poolForm) throws OperationFailedException, PermissionDeniedException
poolForm - the form containing the elements to be updatedIllegalStateException - poolForm already
used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - poolForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - poolForm did not
originate from getPoolFormForUpdate() mandatory - This method must be implemented. boolean canDeletePools()
Pools. A return of true
does not guarantee successful authorization. A return of false
indicates that it is known deleting a Pool 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 Pool deletion is not
authorized, true otherwisemandatory - This method must be implemented. void deletePool(Id poolId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Pool. poolId - the Id of the Pool to
removeNotFoundException - poolId not foundNullArgumentException - poolId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManagePoolAliases()
Id aliases for
Pools. 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 Pool aliasing is not
authorized, true otherwisemandatory - This method must be implemented. void aliasPool(Id poolId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to a Pool for the purpose of
creating compatibility. The primary Id of the
Pool is determined by the provider. The new Id
performs as an alias to the primary Id. If the alias is
a pointer to another pool, it is reassigned to the given pool
Id. poolId - the Id of a Pool aliasId - the alias Id AlreadyExistsException - aliasId is
already assignedNotFoundException - poolId not foundNullArgumentException - poolId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.