Class AndesEventAdminService

java.lang.Object
org.wso2.carbon.core.AbstractAdmin
org.wso2.carbon.andes.event.admin.AndesEventAdminService

public class AndesEventAdminService extends org.wso2.carbon.core.AbstractAdmin
Provides topic related functions as a web service.
  • Constructor Details

    • AndesEventAdminService

      public AndesEventAdminService()
  • Method Details

    • getAllTopics

      public org.wso2.carbon.andes.event.core.TopicNode getAllTopics() throws EventAdminException
      Gets all the topics
      Returns:
      A topic node
      Throws:
      EventAdminException
    • getPaginatedTopicTree

      public org.wso2.carbon.andes.event.core.TopicNode getPaginatedTopicTree(String topicPath, int startIndex, int numberOfTopicsPerRound) throws EventAdminException
      Gets a subset of the topics
      Parameters:
      startIndex - start index of the paginated tree
      numberOfTopicsPerRound - number of topics should be shown per round
      Returns:
      a topic node which includes a subset of topic tree
      Throws:
      EventAdminException
    • getTopicRolePermissions

      public org.wso2.carbon.andes.event.core.TopicRolePermission[] getTopicRolePermissions(String topic) throws EventAdminException
      Gets the permission roles for a topic Suppressing warning as this is used as a web service
      Parameters:
      topic - Topic name
      Returns:
      An array of TopicRolePermission
      Throws:
      EventAdminException - Thrown when topic manager cannot be accessed.
    • addTopic

      public void addTopic(String topic) throws EventAdminException
      Adds a new topic
      Parameters:
      topic - New topic name
      Throws:
      EventAdminException - Thrown when accessing registry or when providing permissions.
    • updatePermission

      public void updatePermission(String topic, org.wso2.carbon.andes.event.core.TopicRolePermission[] topicRolePermissions) throws EventAdminException
      Updates the permissions for roles of a topic Suppressing warning as this is used as a web service
      Parameters:
      topic - Topic name
      topicRolePermissions - New roles with permissions
      Throws:
      EventAdminException - Thrown when updating topic permissions.
    • getAllWSSubscriptionsForTopic

      public Subscription[] getAllWSSubscriptionsForTopic(String topic, int startingIndex, int maxSubscriptionCount) throws EventAdminException
      Gets all subscriptions for a topic with limited results to return Suppressing warning as this is used as a web service
      Parameters:
      topic - Topic name
      startingIndex - Starting index of which the results should be returned
      maxSubscriptionCount - The amount of results to be returned
      Returns:
      An array of Subscriptions
      Throws:
      EventAdminException - Thrown when accessing topic manager.
    • getWsSubscriptionsForTopic

      public Subscription[] getWsSubscriptionsForTopic(String topic) throws EventAdminException
      Gets all the subscriptions Suppressing warning as this is used as a web service
      Parameters:
      topic - Topic name
      Returns:
      An array of subscriptions
      Throws:
      EventAdminException - Thrown when accessing topic manager.
    • getAllWSSubscriptionCountForTopic

      public int getAllWSSubscriptionCountForTopic(String topic) throws EventAdminException
      Gets the total number of subscriptions for a topic Suppressing warning as this is used as a web service
      Parameters:
      topic - Topic name
      Returns:
      Number of subscriptions
      Throws:
      EventAdminException - Thrown when accessing topic manager.
    • getJMSSubscriptionsForTopic

      public Subscription[] getJMSSubscriptionsForTopic(String topic) throws EventAdminException
      Gets the JMS subscriptions for a topic Suppressing warning as this is used as a web service
      Parameters:
      topic - Topic name
      Returns:
      An array of subscriptions
      Throws:
      EventAdminException - Thrown when getting JMS subscriptions details from registry.
    • getUserRoles

      public String[] getUserRoles() throws EventAdminException
      Gets user roles through topic manager
      Returns:
      A string array of roles
      Throws:
      EventAdminException - Thrown when topic manager is unable to get user roles.
    • publishToTopic

      public void publishToTopic(String content, String topicName) throws EventAdminException
      Publish a message to given topic
      Parameters:
      content - message to publish
      topicName - topic
      Throws:
      EventAdminException
    • checkCurrentUserHasAddTopicPermission

      public boolean checkCurrentUserHasAddTopicPermission() throws EventAdminException
      Evaluate current logged in user has add topic permission. This service mainly used to restrict UI control for un-authorize users
      Returns:
      true/false based on permission
      Throws:
      EventAdminException
    • checkUserHasAddTopicPermission

      public boolean checkUserHasAddTopicPermission(String username) throws EventAdminException
      Evaluate given username has add topic permission. This service mainly used to restrict UI control for un-authorize users
      Returns:
      true/false based on permission
      Throws:
      EventAdminException
    • checkCurrentUserHasDeleteTopicPermission

      public boolean checkCurrentUserHasDeleteTopicPermission() throws EventAdminException
      Evaluate current logged in user has delete topic permission. This service mainly used to restrict UI control for un-authorize users
      Returns:
      true/false based on permission
      Throws:
      EventAdminException
    • checkUserHasDeleteTopicPermission

      public boolean checkUserHasDeleteTopicPermission(String username) throws EventAdminException
      Evaluate given username has delete topic permission. This service mainly used to restrict UI control for un-authorize users
      Returns:
      true/false based on permission
      Throws:
      EventAdminException
    • checkCurrentUserHasDetailsTopicPermission

      public boolean checkCurrentUserHasDetailsTopicPermission() throws EventAdminException
      Evaluate current logged in user has view topic details permission. This service mainly used to restrict UI control for un-authorize users
      Returns:
      true/false based on permission
      Throws:
      EventAdminException
    • checkUserHasDetailsTopicPermission

      public boolean checkUserHasDetailsTopicPermission(String username) throws EventAdminException
      Evaluate given username has view topic details permission. This service mainly used to restrict UI control for un-authorize users
      Returns:
      true/false based on permission
      Throws:
      EventAdminException
    • checkCurrentUserHasPublishTopicPermission

      public boolean checkCurrentUserHasPublishTopicPermission(String topicName) throws EventAdminException
      Evaluate current logged in user has publish permission for given topic. This service mainly used to restrict UI control for un-authorize users
      Returns:
      true/false based on permission
      Throws:
      EventAdminException
    • checkUserHasPublishTopicPermission

      public boolean checkUserHasPublishTopicPermission(String topicName, String username) throws EventAdminException
      Evaluate given username has publish permission for given topic. This service mainly used to restrict UI control for un-authorize users
      Returns:
      true/false based on permission
      Throws:
      EventAdminException
    • removeTopic

      public boolean removeTopic(String topic) throws EventAdminException
      Removes a topic Suppressing warning as this is used as a web service
      Parameters:
      topic - Topic name
      Returns:
      true if topic existed to delete and deleted, false otherwise.
      Throws:
      EventAdminException