Interface BrokerBatchAdminSession
- All Superinterfaces:
AutoCloseable, BrokerAdminSession, Closeable, OsidSession, OsidSession
This session creates, updates, and deletes Brokers 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
Broker , a BrokerForm is requested using
getBrokerFormsForCreate() specifying the desiredrecord Types or
none if no record Types are needed. Each of the returned
BrokerForms 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 BrokerForm is submiited to a create operation, it cannot be
reused with another create operation unless the first operation was
unsuccessful. Each BrokerForm corresponds to an attempted
transaction.
The BrokerForms returned from
getBrokerFormsForCreate() may be linked to the originating request
through the peer Ids of the BrokerForm . In the case where
there may be duplicates, any BrokerForm of the same peer
Ids may be used for a create operation.
Once a batch of BrokerForms are submitted for create, a
CreateResponse is returned for each BrokerForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createBrokers() , errors specific to
an individual BrokerForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
BrokerForm through the BrokerForm Id .
For updates, BrokerForms are requested to the Broker
Id that is to be updated using getBrokerFormsForUpdate()
where the reference Id in the BrokerForm may be used to
link the request. Similarly, the BrokerForm has metadata about the
data that can be updated and it can perform validation before submitting
the update. The BrokerForm can only be used once for a successful
update and cannot be reused.
Once a batch of BrokerForms are submitted for update, an
UpdateResponse is returned for each BrokerForm , although
the ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateBrokers() , errors specific to
an individual BrokerForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
BrokerForm through the BrokerForm Id .
The delete operations delete Brokers in bulk. To unmap a
Broker from the current Distributor , the
BrokerDistributorAssignmentSession should be used. These delete
operations attempt to remove the Broker itself thus removing it
from all known Distributor catalogs. Bulk delete operations return
the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasBrokers(AliasRequestList aliasRequests) Adds anIdto aBrokerfor the purpose of creating compatibility.createBrokers(BrokerBatchFormList brokerForms) Creates a new set ofBrokers.Deletes allBrokersin thisDistributor.deleteBrokers(IdList brokerIds) Deletes brokers for the givenIds.getBrokerFormsForCreate(long number, Type[] brokerRecordTypes) Gets the broker forms for creating a bunch of new brokers.getBrokerFormsForUpdate(IdList brokerIds) Gets the broker forms for updating an existing set of brokers.updateBrokers(BrokerBatchFormList brokerForms) Updates existing brokers.Methods inherited from interface BrokerAdminSession
addQueue, aliasBroker, canAssignQueues, canCreateBrokers, canCreateBrokerWithRecordTypes, canDeleteBrokers, canManageBrokerAliases, canUpdateBrokers, createBroker, deleteBroker, getBrokerFormForCreate, getBrokerFormForUpdate, getDistributor, getDistributorId, removeQueue, updateBrokerModifier and TypeMethodDescriptionvoidAdds a queue to a broker.voidaliasBroker(Id brokerId, Id aliasId) Adds anIdto aBrokerfor the purpose of creating compatibility.booleanTests if this user can assign queues to brokers.booleanTests if this user can createBrokers.booleancanCreateBrokerWithRecordTypes(Type[] brokerRecordTypes) Tests if this user can create a singleBrokerusing the desired record types.booleanTests if this user can deleteBrokers.booleanTests if this user can manageIdaliases forBrokers.booleanTests if this user can updateBrokers.createBroker(BrokerForm brokerForm) Creates a newBroker.voiddeleteBroker(Id brokerId) Deletes aBroker.getBrokerFormForCreate(Type[] brokerRecordTypes) Gets the broker form for creating new brokers.getBrokerFormForUpdate(Id brokerId) Gets the broker form for updating an existing broker.Gets theDistributorassociated with this session.Gets theDistributorIdassociated with this session.voidremoveQueue(Id brokerId, Id queueId) Removes a queue from a broker.voidupdateBroker(BrokerForm brokerForm) Updates an existing broker.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.
-
Method Details
-
getBrokerFormsForCreate
BrokerBatchFormList getBrokerFormsForCreate(long number, Type[] brokerRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the broker forms for creating a bunch of new brokers.- Parameters:
number- the number of forms to retrievebrokerRecordTypes- array of broker record types to be included in each create operation or an empty list if none- Returns:
- the broker forms
- Throws:
NullArgumentException-brokerRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createBrokers
CreateResponseList createBrokers(BrokerBatchFormList brokerForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofBrokers. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
brokerForms- the broker forms- Returns:
- the create responses
- Throws:
NullArgumentException-brokerFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getBrokerFormsForUpdate
BrokerBatchFormList getBrokerFormsForUpdate(IdList brokerIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the broker forms for updating an existing set of brokers. A new broker form should be requested for each update transaction.- Parameters:
brokerIds- theIdsof theBroker- Returns:
- the broker form
- Throws:
NotFoundException- abrokerIdis not foundNullArgumentException-brokerIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateBrokers
UpdateResponseList updateBrokers(BrokerBatchFormList brokerForms) throws OperationFailedException, PermissionDeniedException Updates existing brokers. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
brokerForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-brokerFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllBrokers
Deletes allBrokersin thisDistributor.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteBrokers
DeleteResponseList deleteBrokers(IdList brokerIds) throws OperationFailedException, PermissionDeniedException Deletes brokers for the givenIds.- Parameters:
brokerIds- theIdsof the brokers to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-brokerIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasBrokers
AliasResponseList aliasBrokers(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aBrokerfor the purpose of creating compatibility. The primaryIdof theBrokeris determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another broker, it is reassigned to the given brokerId.- 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.
-