public interface BrokerAdminSession extends OsidSession
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.
Modifier and Type | Method and Description |
---|---|
void |
addQueue(Id brokerId,
Id queueId)
Adds a queue to a broker.
|
void |
aliasBroker(Id brokerId,
Id aliasId)
Adds an
Id to a Broker for the purpose
of creating compatibility. |
boolean |
canAssignQueues()
Tests if this user can assign queues to brokers.
|
boolean |
canCreateBrokers()
Tests if this user can create
Brokers. |
boolean |
canCreateBrokerWithRecordTypes(Type[] brokerRecordTypes)
Tests if this user can create a single
Broker using the
desired record types. |
boolean |
canDeleteBrokers()
Tests if this user can delete
Brokers. |
boolean |
canManageBrokerAliases()
Tests if this user can manage
Id aliases for
Brokers. |
boolean |
canUpdateBrokers()
Tests if this user can update
Brokers. |
Broker |
createBroker(BrokerForm brokerForm)
Creates a new
Broker. |
void |
deleteBroker(Id brokerId)
Deletes a
Broker. |
BrokerForm |
getBrokerFormForCreate(Type[] brokerRecordTypes)
Gets the broker form for creating new brokers.
|
BrokerForm |
getBrokerFormForUpdate(Id brokerId)
Gets the broker form for updating an existing broker.
|
Distributor |
getDistributor()
Gets the
Distributor associated with this session. |
Id |
getDistributorId()
Gets the
Distributor Id associated with
this session. |
void |
removeQueue(Id brokerId,
Id queueId)
Removes a queue from a broker.
|
void |
updateBroker(BrokerForm brokerForm)
Updates an existing broker.
|
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 canCreateBrokers()
Brokers.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known creating a Broker
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 Broker
creation is not
authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateBrokerWithRecordTypes(Type[] brokerRecordTypes)
Broker
using the
desired record types. While
ProvisioningManager.getBrokerRecordTypes()
can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Broker.
Providing
an empty array tests if a Broker
can be created with no
records.brokerRecordTypes
- array of broker record types true
if Broker
creation using
the specified record Types
is supported,
false
otherwiseNullArgumentException
- brokerRecordTypes
is null
mandatory
- This method must be implemented. BrokerForm getBrokerFormForCreate(Type[] brokerRecordTypes) throws OperationFailedException, PermissionDeniedException
brokerRecordTypes
- array of broker record typesNullArgumentException
- brokerRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Broker createBroker(BrokerForm brokerForm) throws OperationFailedException, PermissionDeniedException
Broker.
brokerForm
- the form for this Broker
Broker
IllegalStateException
- brokerForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- brokerForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- brokerForm
did
not originate from getBrokerFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateBrokers()
Brokers.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known updating a Broker
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 Broker
modification is
not authorized, true
otherwisemandatory
- This method must be implemented. BrokerForm getBrokerFormForUpdate(Id brokerId) throws NotFoundException, OperationFailedException, PermissionDeniedException
brokerId
- the Id
of the Broker
NotFoundException
- brokerId
is not
foundNullArgumentException
- brokerId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateBroker(BrokerForm brokerForm) throws OperationFailedException, PermissionDeniedException
brokerForm
- the form containing the elements to be updatedIllegalStateException
- brokerForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- brokerForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- brokerForm
did
not originate from getBrokerFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteBrokers()
Brokers.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known deleting a Broker
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 Broker
deletion is not
authorized, true
otherwisemandatory
- This method must be implemented. void deleteBroker(Id brokerId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Broker.
brokerId
- the Id
of the Broker
to
removeNotFoundException
- brokerId
not foundNullArgumentException
- brokerId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageBrokerAliases()
Id
aliases for
Brokers.
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 Broker
aliasing is not
authorized, true
otherwisemandatory
- This method must be implemented. void aliasBroker(Id brokerId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Broker
for the purpose
of creating compatibility. The primary Id
of the
Broker
is determined by the provider. The new Id
performs as an alias to the primary Id.
If the
alias is a pointer to another broker, it is reassigned to the given
broker Id.
brokerId
- the Id
of a Broker
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- brokerId
not foundNullArgumentException
- brokerId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canAssignQueues()
PERMISSION_DENIED.
This is intended as a hint to an
application that may opt not to offer queue operations to an
unauthorized user. false
if queue assignment is not authorized,
true
otherwisemandatory
- This method must be implemented. void addQueue(Id brokerId, Id queueId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
brokerId
- the brokerId Id
queueId
- the queue Id
AlreadyExistsException
- queue already part of workNotFoundException
- queueId
or
brokerId
is not foundNullArgumentException
- queueId
or
brokerId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void removeQueue(Id brokerId, Id queueId) throws NotFoundException, OperationFailedException, PermissionDeniedException
brokerId
- the broker Id
queueId
- the queue Id
NotFoundException
- queue is not part of brokerNullArgumentException
- brokerId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.