public interface QueueAdminSession extends OsidSession
This session creates, updates, and deletes Queues.
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
Queue,
a QueueForm
is requested using
getQueueFormForCreate()
specifying the desired broker and record
Types
or none if no record Types
are needed.
The returned QueueForm
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 QueueForm
is submiited to
a create operation, it cannot be reused with another create operation
unless the first operation was unsuccessful. Each QueueForm
corresponds to an attempted transaction.
For updates, QueueForms
are requested to the
Queue
Id
that is to be updated using
getQueueFormForUpdate().
Similarly, the QueueForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The QueueForm
can
only be used once for a successful update and cannot be reused.
The delete operations delete Queues.
To unmap a
Queue
from the current Distributor,
the
QueueDistributorAssignmentSession
should be used. These delete
operations attempt to remove the Queue
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 |
aliasQueue(Id queueId,
Id aliasId)
Adds an
Id to a Queue for the purpose of
creating compatibility. |
boolean |
canCreateQueue()
Tests if this user can create queues.
|
boolean |
canCreateQueueWithRecordTypes(Type[] queueRecordTypes)
Tests if this user can create a single
Queue using the
desired record types. |
boolean |
canDeleteQueues()
Tests if this user can delete queues.
|
boolean |
canManageQueueAliases()
Tests if this user can manage
Id aliases for queues. |
boolean |
canUpdateQueues()
Tests if this user can update queues.
|
Queue |
createQueue(QueueForm queueForm)
Creates a new
Queue. |
void |
deleteQueue(Id queueId)
Deletes a
Queue. |
Distributor |
getDistributor()
Gets the
Distributor associated with this session. |
Id |
getDistributorId()
Gets the
Distributor Id associated with
this session. |
QueueForm |
getQueueFormForCreate(Id brokerId,
Type[] queueRecordTypes)
Gets the queue form for creating new queues.
|
QueueForm |
getQueueFormForUpdate(Id queueId)
Gets the queue form for updating an existing queue.
|
void |
updateQueue(QueueForm queueForm)
Updates an existing queue.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id 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 canCreateQueue()
Queue
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 Queue
creation is not
authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateQueueWithRecordTypes(Type[] queueRecordTypes)
Queue
using the
desired record types. While
ProvisioningManager.getQueueRecordTypes()
can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Queue.
Providing
an empty array tests if a Queue
can be created with no
records.queueRecordTypes
- array of queue record types true
if Queue
creation using the
specified record Types
is supported,
false
otherwiseNullArgumentException
- queueRecordTypes
is null
mandatory
- This method must be implemented. QueueForm getQueueFormForCreate(Id brokerId, Type[] queueRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
brokerId
- a broker Id
queueRecordTypes
- array of queue record typesNotFoundException
- brokerId
is not
foundNullArgumentException
- brokerId
or
queueRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Queue createQueue(QueueForm queueForm) throws OperationFailedException, PermissionDeniedException
Queue.
queueForm
- the form for this Queue
Queue
IllegalStateException
- queueForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- queueForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- queueForm
did not
originate from getQueueFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateQueues()
Queue
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 Queue
modification is
not authorized, true
otherwisemandatory
- This method must be implemented. QueueForm getQueueFormForUpdate(Id queueId) throws NotFoundException, OperationFailedException, PermissionDeniedException
queueId
- the Id
of the Queue
NotFoundException
- queueId
is not foundNullArgumentException
- queueId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateQueue(QueueForm queueForm) throws OperationFailedException, PermissionDeniedException
queueForm
- the form containing the elements to be updatedIllegalStateException
- queueForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- queueForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- queueForm
did not
originate from getQueueFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteQueues()
Queue
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 Queue
deletion is not
authorized, true
otherwisemandatory
- This method must be implemented. void deleteQueue(Id queueId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Queue.
queueId
- the Id
of the Queue
to
removeNotFoundException
- queueId
not foundNullArgumentException
- queueId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageQueueAliases()
Id
aliases for queues. 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 Queue
aliasing is not
authorized, true
otherwisemandatory
- This method must be implemented. void aliasQueue(Id queueId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Queue
for the purpose of
creating compatibility. The primary Id
of the
Queue
is determined by the provider. The new Id
performs as an alias to the primary Id
. If the alias
is a pointer to another queue, it is reassigned to the given queue
Id.
queueId
- the Id
of a Queue
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- queueId
not foundNullArgumentException
- queueId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.