Interface BrokerAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
BrokerBatchAdminSession
This session creates, updates, and deletes Brokers . 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
getBrokerFormForCreate() specifying the desired record Types or
none if no record Types are needed. The returned
BrokerForm 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 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.
For updates, BrokerForms are requested to the Broker
Id that is to be updated using getBrokerFormForUpdate() .
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.
The delete operations delete Brokers . 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.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier 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
-
getDistributorId
Id getDistributorId()Gets theDistributorIdassociated with this session.- Returns:
- the
Distributor Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getDistributor
Gets theDistributorassociated with this session.- Returns:
- the distributor
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateBrokers
boolean canCreateBrokers()Tests if this user can createBrokers. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aBrokerwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseifBrokercreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateBrokerWithRecordTypes
Tests if this user can create a singleBrokerusing the desired record types. WhileProvisioningManager.getBrokerRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificBroker. Providing an empty array tests if aBrokercan be created with no records.- Parameters:
brokerRecordTypes- array of broker record types- Returns:
trueifBrokercreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-brokerRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getBrokerFormForCreate
BrokerForm getBrokerFormForCreate(Type[] brokerRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the broker form for creating new brokers. A new form should be requested for each create transaction.- Parameters:
brokerRecordTypes- array of broker record types- Returns:
- the broker form
- Throws:
NullArgumentException-brokerRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createBroker
Broker createBroker(BrokerForm brokerForm) throws OperationFailedException, PermissionDeniedException Creates a newBroker.- Parameters:
brokerForm- the form for thisBroker- Returns:
- the new
Broker - Throws:
IllegalStateException-brokerFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-brokerFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-brokerFormdid not originate fromgetBrokerFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateBrokers
boolean canUpdateBrokers()Tests if this user can updateBrokers. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aBrokerwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.- Returns:
falseifBrokermodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getBrokerFormForUpdate
BrokerForm getBrokerFormForUpdate(Id brokerId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the broker form for updating an existing broker. A new broker form should be requested for each update transaction.- Parameters:
brokerId- theIdof theBroker- Returns:
- the broker form
- Throws:
NotFoundException-brokerIdis not foundNullArgumentException-brokerIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateBroker
Updates an existing broker.- Parameters:
brokerForm- the form containing the elements to be updated- Throws:
IllegalStateException-brokerFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-brokerFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-brokerFormdid not originate fromgetBrokerFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteBrokers
boolean canDeleteBrokers()Tests if this user can deleteBrokers. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aBrokerwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.- Returns:
falseifBrokerdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteBroker
void deleteBroker(Id brokerId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aBroker.- Parameters:
brokerId- theIdof theBrokerto remove- Throws:
NotFoundException-brokerIdnot foundNullArgumentException-brokerIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageBrokerAliases
boolean canManageBrokerAliases()Tests if this user can manageIdaliases forBrokers. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifBrokeraliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasBroker
void aliasBroker(Id brokerId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aBrokerfor the purpose of creating compatibility. The primaryIdof theBrokeris determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another broker, it is reassigned to the given brokerId.- Parameters:
brokerId- theIdof aBrokeraliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-brokerIdnot foundNullArgumentException-brokerIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canAssignQueues
boolean canAssignQueues()Tests if this user can assign queues to brokers. A return of true does not guarantee successful authorization. A return of false indicates that it is known assigning a queue will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer queue operations to an unauthorized user.- Returns:
falseif queue assignment is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
addQueue
void addQueue(Id brokerId, Id queueId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds a queue to a broker.- Parameters:
brokerId- the brokerIdIdqueueId- the queueId- Throws:
AlreadyExistsException- queue already part of workNotFoundException-queueIdorbrokerIdis not foundNullArgumentException-queueIdorbrokerIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
removeQueue
void removeQueue(Id brokerId, Id queueId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes a queue from a broker.- Parameters:
brokerId- the brokerIdqueueId- the queueId- Throws:
NotFoundException- queue is not part of brokerNullArgumentException-brokerIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-