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 Classes
    Modifier and Type
    Class
    Description
    class 
    A comparator class to order subscriptions.
  • Field Summary

    Fields inherited from class org.wso2.carbon.core.AbstractAdmin

    axisConfig, configurationContext
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Evaluate current logged in user has close subscription permission for topic subscriptions.
    void
    closeSubscription(String subscriptionID, String destination, String protocolType, String destinationType)
    Close subscription defined by subscription ID forcibly
    void
    deleteTopicFromRegistry(String topicName, String subscriptionId)
    Delete topic related resources from registry
    org.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.
    long
    getMessageCount(String destinationName, String msgPattern)
    Gets the message count for a queue
    org.wso2.carbon.andes.core.types.Subscription[]
    getSubscriptions(String isDurable, String isActive, String protocolType, String destinationType)
    Retrieve subscriptions matching the given criteria.
    int
    getTotalSubscriptionCountForSearchResult(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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 Name
      subscriptionId - 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 subscription
      destination - queue / topic name of the subscribed destination
      protocolType - The protocol type of the subscriptions to close
      destinationType - 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 retrieved
      destinationType - 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 object
      tenantDomain - 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 BrokerManagerAdminException
      Evaluate 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