Package org.wso2.carbon.andes.admin.mqtt
Class AndesMQTTAdminService
java.lang.Object
org.wso2.carbon.core.AbstractAdmin
org.wso2.carbon.andes.admin.mqtt.AndesMQTTAdminService
public class AndesMQTTAdminService
extends org.wso2.carbon.core.AbstractAdmin
Provides all the andes MQTT admin services.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassA comparator class to order subscriptions. -
Field Summary
Fields inherited from class org.wso2.carbon.core.AbstractAdmin
axisConfig, configurationContext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanEvaluate current logged in user has close subscription permission for topic subscriptions.voidcloseSubscription(String subscriptionID, String destination, String protocolType, String destinationType) Close subscription defined by subscription ID forciblyvoiddeleteTopicFromRegistry(String topicName, String subscriptionId) Delete topic related resources from registryorg.wso2.carbon.andes.core.types.Subscription[]getFilteredSubscriptions(org.wso2.carbon.andes.core.types.MQTTSubscription subscription, String tenantDomain) Retrieve subscriptions matching to the given search criteria.longgetMessageCount(String destinationName, String msgPattern) Gets the message count for a queueorg.wso2.carbon.andes.core.types.Subscription[]getSubscriptions(String isDurable, String isActive, String protocolType, String destinationType) Retrieve subscriptions matching the given criteria.intgetTotalSubscriptionCountForSearchResult(org.wso2.carbon.andes.core.types.MQTTSubscription subscription) Returns the total subscription count relevant to a particular search criteria.Methods inherited from class org.wso2.carbon.core.AbstractAdmin
getAxisConfig, getConfigContext, getConfigSystemRegistry, getConfigUserRegistry, getGovernanceRegistry, getGovernanceSystemRegistry, getGovernanceUserRegistry, getHttpSession, getLocalRepo, getRegistry, getTenantDomain, getUsername, getUserRealm, setConfigurationContext, setPermissionUpdateTimestamp
-
Constructor Details
-
AndesMQTTAdminService
public AndesMQTTAdminService()
-
-
Method Details
-
getMessageCount
public long getMessageCount(String destinationName, String msgPattern) throws BrokerManagerAdminException Gets the message count for a queue- Parameters:
destinationName- the destination name. the name of the queue or topic.msgPattern- The exchange type used to transfer messages with the given destinationName. e.g. "queue" or "topic"- Returns:
- the number of messages for a queue
- Throws:
BrokerManagerAdminException
-
deleteTopicFromRegistry
public void deleteTopicFromRegistry(String topicName, String subscriptionId) throws BrokerManagerAdminException Delete topic related resources from registry- Parameters:
topicName- Topic NamesubscriptionId- Subscription ID- Throws:
BrokerManagerAdminException
-
closeSubscription
public void closeSubscription(String subscriptionID, String destination, String protocolType, String destinationType) throws BrokerManagerAdminException Close subscription defined by subscription ID forcibly- Parameters:
subscriptionID- ID of the subscriptiondestination- queue / topic name of the subscribed destinationprotocolType- The protocol type of the subscriptions to closedestinationType- The destination type of the subscriptions to close- Throws:
BrokerManagerAdminException
-
getSubscriptions
public org.wso2.carbon.andes.core.types.Subscription[] getSubscriptions(String isDurable, String isActive, String protocolType, String destinationType) throws BrokerManagerAdminException Retrieve subscriptions matching the given criteria.- Parameters:
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 retrieved- Returns:
- The list of subscriptions matching the given criteria
- Throws:
BrokerManagerAdminException
-
getFilteredSubscriptions
public org.wso2.carbon.andes.core.types.Subscription[] getFilteredSubscriptions(org.wso2.carbon.andes.core.types.MQTTSubscription subscription, String tenantDomain) throws BrokerManagerAdminException Retrieve subscriptions matching to the given search criteria.- Parameters:
subscription- is the the details of subscription objecttenantDomain- is the Domain of a particular tenant- Returns:
- retruns if a list of subscriptions which match to the search criteria, else returns null
- Throws:
BrokerManagerAdminException- throws when an error occurs
-
getTotalSubscriptionCountForSearchResult
public int getTotalSubscriptionCountForSearchResult(org.wso2.carbon.andes.core.types.MQTTSubscription subscription) throws BrokerManagerAdminException Returns the total subscription count relevant to a particular search criteria.- Parameters:
subscription- is the the details of subscription object- Returns:
- total subscription count matching to the given criteria
- Throws:
BrokerManagerAdminException- hrows when an error occurs
-
checkCurrentUserHasTopicSubscriptionClosePermission
public boolean checkCurrentUserHasTopicSubscriptionClosePermission() throws BrokerManagerAdminExceptionEvaluate current logged in user has close subscription permission for topic subscriptions. This service mainly used to restrict UI control for un-authorize users- Returns:
- true/false based on permission
- Throws:
BrokerManagerAdminException
-