public interface ResourceManager
ResourceManager
is to provide a unified interface of resource management, allowing developers to manage
the namespace, queue and routing resources.
Create, set, get and delete are the four basic operations of ResourceManager
.
ResourceManager
also supports dynamic fetch and update of resource attributes.
MessagingAccessPoint.resourceManager()
()} is the unique method to obtain a ResourceManager
instance.
Changes made through this instance will immediately apply to the message-oriented middleware (MOM) behind MessagingAccessPoint
.
Modifier and Type | Method and Description |
---|---|
void |
createNamespace(String nsName)
Creates a
Namespace resource with some preset attributes. |
void |
createQueue(String queueName)
Creates a
Queue resource in the configured namespace with some preset attributes. |
void |
deleteNamespace(String nsName)
Deletes an existing namespace.
|
void |
deleteQueue(String queueName)
Deletes an existing queue resource.
|
void |
filter(String queueName,
String filterString)
In order to enable consumers to get the message in the specified mode, the filter rule follows the sql standard
to filter out messages.
|
Set<String> |
listNamespaces()
Gets the namespace list in the current
MessagingAccessPoint . |
Set<String> |
listQueues(String nsName)
Gets the queue list in the specific namespace.
|
void |
routing(String sourceQueue,
String targetQueue)
Routing from sourceQueue to targetQueue.
|
void |
switchNamespace(String targetNamespace)
Switch to an existing namespace.
|
void createNamespace(String nsName)
Namespace
resource with some preset attributes.
A namespace wraps the OMS resources in an abstract concept that makes it appear to the users within the namespace that they have their own isolated instance of the global OMS resources.
nsName
- the name of the new namespace.OMSSecurityException
- when have no authority to create namespace.OMSTimeOutException
- when the given timeout elapses before the create operation completes.OMSDestinationException
- when this given destination has been created in the server.OMSRuntimeException
- when the ResourceManager
fails to create namespace due to some internal
error.void deleteNamespace(String nsName)
nsName
- the namespace needs to be deleted.OMSSecurityException
- when have no authority to delete this namespace.OMSTimeOutException
- when the given timeout elapses before the delete operation completes.OMSDestinationException
- when have no given destination in the server.OMSRuntimeException
- when the ResourceManager
fails to delete the namespace due to some internal
error.void switchNamespace(String targetNamespace)
targetNamespace
- the namespace needs to be switched.OMSSecurityException
- when have no authority to delete this namespace.OMSTimeOutException
- when the given timeout elapses before the delete operation completes.OMSDestinationException
- when have no given destination in the server.OMSRuntimeException
- when the ResourceManager
fails to delete the namespace due to some internal
error.Set<String> listNamespaces()
MessagingAccessPoint
.OMSSecurityException
- when have no authority to delete this namespace.OMSTimeOutException
- when the given timeout elapses before the list operation completes.OMSRuntimeException
- when the ResourceManager
fails to list the namespace due to some internal
error.void createQueue(String queueName)
Queue
resource in the configured namespace with some preset attributes.
The standard OMS Queue
schema must start with the Namespace
prefix:
<namespace_name>://<queue_name>
queueName
- the name of the new queue.OMSSecurityException
- when have no authority to create this queue.OMSTimeOutException
- when the given timeout elapses before the create operation completes.OMSDestinationException
- when the given destination has been created in the server.OMSRuntimeException
- when the ResourceManager
fails to delete the namespace due to some internal
error.void deleteQueue(String queueName)
queueName
- the queue needs to be deleted.OMSSecurityException
- when have no authority to delete this namespace.OMSTimeOutException
- when the given timeout elapses before the delete operation completes.OMSDestinationException
- when have no given destination in the server.OMSRuntimeException
- when the ResourceManager
fails to delete the namespace due to some internal
error.Set<String> listQueues(String nsName)
nsName
- the specific namespace.OMSSecurityException
- when have no authority to delete this namespace.OMSTimeOutException
- when the given timeout elapses before the list operation completes.OMSRuntimeException
- when the ResourceManager
fails to list the namespace due to some internal
error.void filter(String queueName, String filterString)
queueName
- queue name.filterString
- SQL expression to filter out messages.OMSSecurityException
- when have no authority to add this filter.OMSTimeOutException
- when the given timeout elapses before the add filter operation completes.OMSRuntimeException
- when the ResourceManager
fails to add a new filter due to some internal
error.void routing(String sourceQueue, String targetQueue)
sourceQueue
- source queue, process messages received from producer and duplicate those to target queue.targetQueue
- receive messages from source queue.OMSSecurityException
- when have no authority to add this routing.OMSTimeOutException
- when the given timeout elapses before the routing operation completes.OMSRuntimeException
- when the ResourceManager
fails to add a new routing due to some internal
error.Copyright © 2017–2020 OpenMessaging. All rights reserved.