public class AndesAdminService
extends org.wso2.carbon.core.AbstractAdmin
| Modifier and Type | Class and Description |
|---|---|
class |
AndesAdminService.CustomQueueComparator
A comparator class to order queues.
|
class |
AndesAdminService.CustomSubscriptionComparator
A comparator class to order subscriptions.
|
| Constructor and Description |
|---|
AndesAdminService() |
| Modifier and Type | Method and Description |
|---|---|
void |
addQueueAndAssignPermission(String queueName,
QueueRolePermission[] queueRolePermissionsDTO)
Add a queue with the given name and assign permissions
|
Message[] |
browseQueue(String queueName,
long nextMessageIdToRead,
int maxMsgCount)
Browse the given queue name by start index and max messages count
|
boolean |
checkCurrentUserHasAddQueuePermission()
Check if current user has add permission.
|
boolean |
checkCurrentUserHasBrowseMessagesInDLCPermission()
Check if current user has browse messages in dlc permission.
|
boolean |
checkCurrentUserHasBrowseQueuePermission()
Check if current user has browse permission.
|
boolean |
checkCurrentUserHasDeleteMessagesInDLCPermission()
Check if current user has delete messages in dlc permission.
|
boolean |
checkCurrentUserHasDeleteQueuePermission()
Check if current user has delete permission.
|
boolean |
checkCurrentUserHasPublishPermission(String queueName)
Check if current user is has publish permission for a queue.
|
boolean |
checkCurrentUserHasPurgeQueuePermission()
Check if current user has purge permission.
|
boolean |
checkCurrentUserHasQueueSubscriptionClosePermission()
Evaluate current logged in user has close subscription permission for queue subscriptions .
|
boolean |
checkCurrentUserHasRerouteMessagesInDLCPermission()
Check if current user has reroute messages in dlc permission.
|
boolean |
checkCurrentUserHasRestoreMessagesInDLCPermission()
Check if current user has restore messages in dlc permission.
|
boolean |
checkCurrentUserHasTopicSubscriptionClosePermission()
Evaluate current logged in user has close subscription permission for topic subscriptions.
|
boolean |
checkUserHasAddQueuePermission(String username)
Check if given user has add permission.
|
boolean |
checkUserHasBrowseMessagesInDLCPermission(String username)
Check if given user has browse messages in dlc permission.
|
boolean |
checkUserHasBrowseQueuePermission(String username)
Check if given user has browse permission.
|
boolean |
checkUserHasDeleteMessagesInDLCPermission(String username)
Check if given user has delete messages in dlc permission.
|
boolean |
checkUserHasDeleteQueuePermission(String username)
Check if given user has delete permission.
|
boolean |
checkUserHasPublishPermission(String queueName,
String userName)
Check if a user has publishing permission for a queue.
|
boolean |
checkUserHasPurgeQueuePermission(String username)
Check if given user has purge permission.
|
boolean |
checkUserHasRerouteMessagesInDLCPermission(String username)
Check if given user has reroute messages in dlc permission.
|
boolean |
checkUserHasRestoreMessagesInDLCPermission(String username)
Check if given user has restore messages in dlc permission.
|
void |
closeSubscription(boolean isDurable,
String subscriptionID,
String subscribedQueueOrTopicName,
String protocolType,
String destinationType,
String subscriberQueueName)
Close subscription defined by subscription ID forcibly
|
void |
deleteMessagesFromDeadLetterQueue(long[] messageIDs,
String destinationQueueName)
Delete messages from the Dead Letter Queue and delete their content.
|
void |
deleteQueue(String queueName)
Deletes a queue.
|
void |
deleteTopicFromRegistry(String topicName,
String subscriptionId)
Delete topic related resources from registry
|
void |
dumpMessageStatus()
Invoke MBean operations and dump status of all messages.
|
Queue[] |
getAllQueues()
Gets all queues.
|
Subscription[] |
getAllSubscriptions()
Gets all subscriptions.
|
Queue |
getDLCQueue()
Retrieve the DLC queue for the domain
|
Subscription[] |
getFilteredSubscriptions(boolean isDurable,
boolean isActive,
String protocolType,
String destinationType,
String filteredNamePattern,
boolean isFilteredNameByExactMatch,
String identifierPattern,
boolean isIdentifierPatternByExactMatch,
String ownNodeId,
int pageNumber,
int subscriptionCountPerPage)
Retrieve subscriptions matching to the given search criteria.
|
long |
getMessageCount(String destinationName,
String msgPattern)
Gets the message count for a queue
Suppressing 'UnusedDeclaration' as it is called by webservice
|
int |
getMessageCountForSubscriber(String subscriptionID,
boolean durable,
String protocolType,
String destinationType)
Gets the number of messages remaining for a subscriber.
|
Message[] |
getMessageMetadataInDeadLetterChannel(String targetQueue,
long startMessageId,
int pageLimit)
Returns a paginated list of message metadata destined for the inputQueueName but currently living in the
Dead Letter Channel.
|
Message[] |
getMessagesInDLCForQueue(String queueName,
long nextMessageIdToRead,
int maxMsgCount)
Gets the number of messages in DLC fora given queue name by start index and max messages
count
|
Set<String> |
getNamesOfAllDurableQueues()
Get a list of names of durable queues created in the broker
|
long |
getNumberOfMessagesInDLCForQueue(String queueName)
Gets the number of messages in DLC belonging to a specific queue.
|
long |
getPendingMessageCount(String queueName)
Get the pending message count for the specified subscription
|
Queue |
getQueueByName(String queueName)
Retrieve an
Queue with the number of messages remaining in the
database by passing a queue name |
QueueRolePermission[] |
getQueueRolePermission(String queueName)
Get all permission of the given queue name
|
Subscription[] |
getSubscriptions(String isDurable,
String isActive,
String protocolType,
String destinationType)
Retrieve subscriptions matching the given criteria.
|
long |
getTotalMessagesInQueue(String queueName)
Total messages in the given queue
|
int |
getTotalSubscriptionCountForSearchResult(boolean isDurable,
boolean isActive,
String protocolType,
String destinationType,
String filteredNamePattern,
boolean isFilteredNameByExactMatch,
String identifierPattern,
boolean isIdentifierPatternByExactMatch,
String ownNodeId)
Returns the total subscription count relevant to a particular search criteria.
|
String[] |
getUserRoles()
Get roles of the current logged user
If user has admin role, then all available roles will be return
|
void |
purgeMessagesOfQueue(String queueName)
Deletes all messages from a queue.
|
String |
rerouteAllMessagesFromDeadLetterChannelForQueue(String sourceQueue,
String targetQueue,
int internalBatchSize)
Move messages destined for the input sourceQueue into a different targetQueue.
|
long |
rerouteSelectedMessagesFromDeadLetterChannel(long[] messageIDs,
String newDestinationQueueName,
String destinationQueueName)
Restore messages from the Dead Letter Queue to another queue in the same tenant.
|
long |
restoreSelectedMessagesFromDeadLetterChannel(long[] messageIDs,
String destinationQueueName)
Restore messages from the Dead Letter Queue to their original queues.
|
boolean |
sendMessage(String queueName,
String jmsType,
String jmsCorrelationID,
int numberOfMessages,
String message,
int deliveryMode,
int priority,
long expireTime)
Send messages to given queue
|
void |
updatePermission(String queueName,
QueueRolePermission[] queueRolePermissionsDTO)
Update the permission of the given queue name
|
getAxisConfig, getConfigContext, getConfigSystemRegistry, getConfigUserRegistry, getGovernanceRegistry, getGovernanceSystemRegistry, getGovernanceUserRegistry, getHttpSession, getLocalRepo, getRegistry, getTenantDomain, getUsername, getUserRealm, setConfigurationContext, setPermissionUpdateTimestamppublic Queue getQueueByName(String queueName) throws BrokerManagerAdminException
Queue with the number of messages remaining in the
database by passing a queue namequeueName - name of the queueBrokerManagerAdminExceptionpublic Queue getDLCQueue() throws BrokerManagerAdminException
Queue with the number of messages in the dlcBrokerManagerAdminExceptionpublic Queue[] getAllQueues() throws BrokerManagerAdminException
BrokerManagerAdminExceptionpublic Set<String> getNamesOfAllDurableQueues() throws BrokerManagerAdminException
BrokerManagerAdminException - on error while retrieving informationpublic long getMessageCount(String destinationName, String msgPattern) throws BrokerManagerAdminException
destinationName - Destination name.msgPattern - Value should be either 'queue' or 'topic'.BrokerManagerAdminExceptionpublic void deleteQueue(String queueName) throws BrokerManagerAdminException
queueName - Queue name.BrokerManagerAdminExceptionpublic void deleteTopicFromRegistry(String topicName, String subscriptionId) throws BrokerManagerAdminException
topicName - Topic NamesubscriptionId - Subscription IDBrokerManagerAdminExceptionpublic long restoreSelectedMessagesFromDeadLetterChannel(long[] messageIDs,
String destinationQueueName)
throws BrokerManagerAdminException
messageIDs - Browser Message Id / External Message Id list.destinationQueueName - Dead Letter Queue name for the respective tenant.BrokerManagerAdminExceptionpublic long rerouteSelectedMessagesFromDeadLetterChannel(long[] messageIDs,
String newDestinationQueueName,
String destinationQueueName)
throws BrokerManagerAdminException
messageIDs - Browser Message Id / External Message Id list.newDestinationQueueName - The new destination queue for the messages in the same tenant.destinationQueueName - Dead Letter Queue name for the respective tenant.BrokerManagerAdminExceptionpublic void deleteMessagesFromDeadLetterQueue(long[] messageIDs,
String destinationQueueName)
throws BrokerManagerAdminException
messageIDs - Browser Message Id / External Message Id list to be deleted.destinationQueueName - Dead Letter Queue name for the respective tenant.BrokerManagerAdminExceptionpublic void purgeMessagesOfQueue(String queueName) throws BrokerManagerAdminException
queueName - Queue name.BrokerManagerAdminExceptionpublic void closeSubscription(boolean isDurable,
String subscriptionID,
String subscribedQueueOrTopicName,
String protocolType,
String destinationType,
String subscriberQueueName)
throws BrokerManagerAdminException
isDurable - is subscriber durable or notsubscriptionID - ID of the subscriptionsubscribedQueueOrTopicName - queue / topic name of the subscribed destinationprotocolType - The protocol type of the subscriptions to closedestinationType - The destination type of the subscriptions to closesubscriberQueueName - The bind queue of the subscriberBrokerManagerAdminExceptionpublic Subscription[] getAllSubscriptions() throws BrokerManagerAdminException
Subscription.BrokerManagerAdminExceptionpublic Subscription[] getSubscriptions(String isDurable, String isActive, String protocolType, String destinationType) throws BrokerManagerAdminException
isDurable - Are the subscriptions to be retrieved durable (true/false)isActive - Are the subscriptions to be retrieved active (true/false/*, * meaning any)protocolType - The protocol type of the subscriptions to be retrieveddestinationType - The destination type of the subscriptions to be retrievedBrokerManagerAdminExceptionpublic Subscription[] getFilteredSubscriptions(boolean isDurable, boolean isActive, String protocolType, String destinationType, String filteredNamePattern, boolean isFilteredNameByExactMatch, String identifierPattern, boolean isIdentifierPatternByExactMatch, String ownNodeId, int pageNumber, int subscriptionCountPerPage) throws BrokerManagerAdminException
isDurable - are the subscriptions to be retrieve durable (true/ false)isActive - are the subscriptions to be retrieved active (true/false)protocolType - the protocol type of the subscriptions to be retrieveddestinationType - the destination type of the subscriptions to be retrievedfilteredNamePattern - queue or topic name pattern to search the subscriptions ("" for all)isFilteredNameByExactMatch - exactly match the name or notidentifierPattern - identifier pattern to search the subscriptions ("" for all)isIdentifierPatternByExactMatch - exactly match the identifier or notownNodeId - node Id of the node which own the subscriptionspageNumber - page number in the pagination tablesubscriptionCountPerPage - number of subscriptions to be shown in the UI per pageBrokerManagerAdminException - throws when an error occurspublic int getTotalSubscriptionCountForSearchResult(boolean isDurable,
boolean isActive,
String protocolType,
String destinationType,
String filteredNamePattern,
boolean isFilteredNameByExactMatch,
String identifierPattern,
boolean isIdentifierPatternByExactMatch,
String ownNodeId)
throws BrokerManagerAdminException
isDurable - are the subscriptions to be retrieve durable (true/ false)isActive - are the subscriptions to be retrieved active (true/false)protocolType - the protocol type of the subscriptions to be retrieveddestinationType - the destination type of the subscriptions to be retrievedfilteredNamePattern - queue or topic name pattern to search the subscriptions ("" for all)isFilteredNameByExactMatch - exactly match the name or notidentifierPattern - identifier pattern to search the subscriptions ("" for all)isIdentifierPatternByExactMatch - exactly match the identifier or notownNodeId - node Id of the node which own the subscriptionsBrokerManagerAdminException - hrows when an error occurspublic long getNumberOfMessagesInDLCForQueue(String queueName) throws BrokerManagerAdminException
queueName - The name of the queue.BrokerManagerAdminExceptionpublic Message[] getMessagesInDLCForQueue(String queueName, long nextMessageIdToRead, int maxMsgCount) throws BrokerManagerAdminException
queueName - Name of the queuenextMessageIdToRead - Start point of the queue message id to start readingmaxMsgCount - Maximum messages from start indexMessageBrokerManagerAdminExceptionpublic void updatePermission(String queueName, QueueRolePermission[] queueRolePermissionsDTO) throws BrokerManagerAdminException
queueName - Name of the queuequeueRolePermissionsDTO - A QueueRolePermissionBrokerManagerAdminExceptionpublic void addQueueAndAssignPermission(String queueName, QueueRolePermission[] queueRolePermissionsDTO) throws BrokerManagerAdminException
queueName - Name of the queuequeueRolePermissionsDTO - A QueueRolePermissionBrokerManagerAdminExceptionpublic String[] getUserRoles() throws BrokerManagerAdminException
BrokerManagerAdminExceptionpublic QueueRolePermission[] getQueueRolePermission(String queueName) throws BrokerManagerAdminException
queueName - Name of the queueQueueRolePermissionBrokerManagerAdminExceptionpublic Message[] browseQueue(String queueName, long nextMessageIdToRead, int maxMsgCount) throws BrokerManagerAdminException
queueName - Name of the queuenextMessageIdToRead - Start point of the queue message id to start readingmaxMsgCount - Maximum messages from start indexMessageBrokerManagerAdminExceptionpublic long getTotalMessagesInQueue(String queueName) throws BrokerManagerAdminException
queueName - Name of the queueBrokerManagerAdminExceptionpublic boolean sendMessage(String queueName, String jmsType, String jmsCorrelationID, int numberOfMessages, String message, int deliveryMode, int priority, long expireTime) throws BrokerManagerAdminException
queueName - Name of the queuejmsType - JMS TypejmsCorrelationID - JMS Correlation IdnumberOfMessages - Number of timesmessage - Message contentdeliveryMode - Delivery modepriority - Message priorityexpireTime - Message expire timeBrokerManagerAdminExceptionpublic int getMessageCountForSubscriber(String subscriptionID, boolean durable, String protocolType, String destinationType) throws BrokerManagerAdminException
subscriptionID - The subscription ID.durable - Whether the subscription is durable or not.protocolType - The protocol type which the subscription belongs todestinationType - The destination type which the subscription belongs toBrokerManagerAdminExceptionpublic long getPendingMessageCount(String queueName) throws BrokerManagerAdminException
queueName - queue name for which the pending message cound need to be calculatedBrokerManagerAdminExceptionpublic void dumpMessageStatus()
throws BrokerManagerAdminException
BrokerManagerAdminException - on an issue creating/writing to filepublic boolean checkCurrentUserHasPublishPermission(String queueName) throws BrokerManagerAdminException
queueName - The name of the queueBrokerManagerAdminExceptionpublic boolean checkUserHasPublishPermission(String queueName, String userName) throws BrokerManagerAdminException
queueName - The name of the queueuserName - The username of the userBrokerManagerAdminExceptionpublic boolean checkCurrentUserHasAddQueuePermission()
throws BrokerManagerAdminException
BrokerManagerAdminExceptionpublic boolean checkUserHasAddQueuePermission(String username) throws BrokerManagerAdminException
username - usernameBrokerManagerAdminExceptionpublic boolean checkCurrentUserHasBrowseQueuePermission()
throws BrokerManagerAdminException
BrokerManagerAdminExceptionpublic boolean checkUserHasBrowseQueuePermission(String username) throws BrokerManagerAdminException
username - usernameBrokerManagerAdminExceptionpublic boolean checkCurrentUserHasDeleteQueuePermission()
throws BrokerManagerAdminException
BrokerManagerAdminExceptionpublic boolean checkUserHasDeleteQueuePermission(String username) throws BrokerManagerAdminException
username - usernameBrokerManagerAdminExceptionpublic boolean checkCurrentUserHasPurgeQueuePermission()
throws BrokerManagerAdminException
BrokerManagerAdminExceptionpublic boolean checkUserHasPurgeQueuePermission(String username) throws BrokerManagerAdminException
username - usernameBrokerManagerAdminExceptionpublic boolean checkCurrentUserHasBrowseMessagesInDLCPermission()
throws BrokerManagerAdminException
BrokerManagerAdminExceptionpublic boolean checkUserHasBrowseMessagesInDLCPermission(String username) throws BrokerManagerAdminException
username - usernameBrokerManagerAdminExceptionpublic boolean checkCurrentUserHasDeleteMessagesInDLCPermission()
throws BrokerManagerAdminException
BrokerManagerAdminExceptionpublic boolean checkUserHasDeleteMessagesInDLCPermission(String username) throws BrokerManagerAdminException
username - usernameBrokerManagerAdminExceptionpublic boolean checkCurrentUserHasRestoreMessagesInDLCPermission()
throws BrokerManagerAdminException
BrokerManagerAdminExceptionpublic boolean checkUserHasRestoreMessagesInDLCPermission(String username) throws BrokerManagerAdminException
username - usernameBrokerManagerAdminExceptionpublic boolean checkCurrentUserHasRerouteMessagesInDLCPermission()
throws BrokerManagerAdminException
BrokerManagerAdminExceptionpublic boolean checkUserHasRerouteMessagesInDLCPermission(String username) throws BrokerManagerAdminException
username - usernameBrokerManagerAdminExceptionpublic boolean checkCurrentUserHasQueueSubscriptionClosePermission()
throws BrokerManagerAdminException
BrokerManagerAdminExceptionpublic boolean checkCurrentUserHasTopicSubscriptionClosePermission()
throws BrokerManagerAdminException
BrokerManagerAdminException - on an issue checking permissionpublic Message[] getMessageMetadataInDeadLetterChannel(String targetQueue, long startMessageId, int pageLimit) throws BrokerManagerAdminException
targetQueue - Name of the destination queuestartMessageId - Start point of the queue message id to start readingpageLimit - Maximum messages required in a single responseMessageBrokerManagerAdminException - if an error occurs while invoking the MBean to fetch messages.public String rerouteAllMessagesFromDeadLetterChannelForQueue(String sourceQueue, String targetQueue, int internalBatchSize) throws BrokerManagerAdminException
sourceQueue - Name of the source queuetargetQueue - Name of the target queue.internalBatchSize - even with this method, the MB server will internally read messages in DLC in batches,
and simulate each batch as a new message list to the targetQueue. internalBatchSize
controls the number of messages processed in a single batch internally.BrokerManagerAdminExceptionCopyright © 2018 WSO2. All rights reserved.