Interface QueueBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession, QueueAdminSession
This session creates, updates, and deletes Queues in bulk. 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
getQueueFormsForCreate() specifying the desired broker and record
Types or none if no record Types are needed. Each of the returned
QueueForms 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 a 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.
The QueueForms returned from getQueueFormsForCreate()
may be linked to the originating request through the peer Ids of
the QueueForm . In the case where there may be duplicates, any
QueueForm of the same peer Ids may be used for a create
operation.
Once a batch of QueueForms are submitted for create, a
CreateResponse is returned for each QueueForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createQueues() , errors specific to an
individual QueueForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
QueueForm through the QueueForm Id .
For updates, QueueForms are requested to the Queue
Id that is to be updated using getQueueFormsForUpdate()
where the reference Id in the QueueForm may be used to
link the request. 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.
Once a batch of QueueForms are submitted for update, an
UpdateResponse is returned for each QueueForm , although the
ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateQueues() , errors specific to an
individual QueueForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
QueueForm through the QueueForm Id .
The delete operations delete Queues in bulk. 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. Bulk delete operations return the results in
DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasQueues(AliasRequestList aliasRequests) Adds anIdto aQueuefor the purpose of creating compatibility.createQueues(QueueBatchFormList queueForms) Creates a new set ofQueues.Deletes allQueuesin thisDistributor.deleteQueues(IdList queueIds) Deletes queues for the givenIds.deleteQueuesForBroker(Id broekrId) Deletes queues for the given broker.getQueueFormsForCreate(IdList brokerIds, Type[] queueRecordTypes) Gets the queue forms for creating a bunch of new queues.getQueueFormsForUpdate(IdList queueIds) Gets the queue forms for updating an existing set of queues.updateQueues(QueueBatchFormList queueForms) Updates existing queues.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.Methods inherited from interface QueueAdminSession
aliasQueue, canCreateQueue, canCreateQueueWithRecordTypes, canDeleteQueues, canManageQueueAliases, canUpdateQueues, createQueue, deleteQueue, getDistributor, getDistributorId, getQueueFormForCreate, getQueueFormForUpdate, updateQueueModifier and TypeMethodDescriptionvoidaliasQueue(Id queueId, Id aliasId) Adds anIdto aQueuefor the purpose of creating compatibility.booleanTests if this user can create queues.booleancanCreateQueueWithRecordTypes(Type[] queueRecordTypes) Tests if this user can create a singleQueueusing the desired record types.booleanTests if this user can delete queues.booleanTests if this user can manageIdaliases for queues.booleanTests if this user can update queues.createQueue(QueueForm queueForm) Creates a newQueue.voiddeleteQueue(Id queueId) Deletes aQueue.Gets theDistributorassociated with this session.Gets theDistributorIdassociated with this session.getQueueFormForCreate(Id brokerId, Type[] queueRecordTypes) Gets the queue form for creating new queues.getQueueFormForUpdate(Id queueId) Gets the queue form for updating an existing queue.voidupdateQueue(QueueForm queueForm) Updates an existing queue.
-
Method Details
-
getQueueFormsForCreate
QueueBatchFormList getQueueFormsForCreate(IdList brokerIds, Type[] queueRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the queue forms for creating a bunch of new queues. A form is returned for each supplied broker.- Parameters:
brokerIds- a list of brokerIdsqueueRecordTypes- array of queue record types to be included in each create operation or an empty list if none- Returns:
- the queue forms
- Throws:
NotFoundException- abrokerIdis not foundNullArgumentException-peersorqueueRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createQueues
CreateResponseList createQueues(QueueBatchFormList queueForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofQueues. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
queueForms- the queue forms- Returns:
- the create responses
- Throws:
NullArgumentException-queueFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getQueueFormsForUpdate
QueueBatchFormList getQueueFormsForUpdate(IdList queueIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the queue forms for updating an existing set of queues. A new queue form should be requested for each update transaction.- Parameters:
queueIds- theIdsof theQueue- Returns:
- the queue form
- Throws:
NotFoundException- aqueueIdis not foundNullArgumentException-queueIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateQueues
UpdateResponseList updateQueues(QueueBatchFormList queueForms) throws OperationFailedException, PermissionDeniedException Updates existing queues. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
queueForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-queueFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllQueues
Deletes allQueuesin thisDistributor.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteQueues
DeleteResponseList deleteQueues(IdList queueIds) throws OperationFailedException, PermissionDeniedException Deletes queues for the givenIds.- Parameters:
queueIds- theIdsof the queues to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-queueIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteQueuesForBroker
DeleteResponseList deleteQueuesForBroker(Id broekrId) throws OperationFailedException, PermissionDeniedException Deletes queues for the given broker.- Parameters:
broekrId- theIdof a broker- Returns:
- the delete responses
- Throws:
NullArgumentException-brokerIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasQueues
AliasResponseList aliasQueues(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aQueuefor the purpose of creating compatibility. The primaryIdof theQueueis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another queue, it is reassigned to the given queueId.- Parameters:
aliasRequests- the alias requests- Returns:
- the alias responses
- Throws:
NullArgumentException-aliasRequestsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-