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.
-
Field Summary
Fields inherited from class org.wso2.carbon.core.AbstractAdmin
axisConfig, configurationContext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a new topicbooleanEvaluate current logged in user has add topic permission.booleanEvaluate current logged in user has delete topic permission.booleanEvaluate current logged in user has view topic details permission.booleancheckCurrentUserHasPublishTopicPermission(String topicName) Evaluate current logged in user has publish permission for given topic.booleancheckUserHasAddTopicPermission(String username) Evaluate given username has add topic permission.booleancheckUserHasDeleteTopicPermission(String username) Evaluate given username has delete topic permission.booleancheckUserHasDetailsTopicPermission(String username) Evaluate given username has view topic details permission.booleancheckUserHasPublishTopicPermission(String topicName, String username) Evaluate given username has publish permission for given topic.org.wso2.carbon.andes.event.core.TopicNodeGets all the topicsintGets the total number of subscriptions for a topic Suppressing warning as this is used as a web servicegetAllWSSubscriptionsForTopic(String topic, int startingIndex, int maxSubscriptionCount) Gets all subscriptions for a topic with limited results to return Suppressing warning as this is used as a web serviceGets the JMS subscriptions for a topic Suppressing warning as this is used as a web serviceorg.wso2.carbon.andes.event.core.TopicNodegetPaginatedTopicTree(String topicPath, int startIndex, int numberOfTopicsPerRound) Gets a subset of the topicsorg.wso2.carbon.andes.event.core.TopicRolePermission[]getTopicRolePermissions(String topic) Gets the permission roles for a topic Suppressing warning as this is used as a web serviceString[]Gets user roles through topic managergetWsSubscriptionsForTopic(String topic) Gets all the subscriptions Suppressing warning as this is used as a web servicevoidpublishToTopic(String content, String topicName) Publish a message to given topicbooleanremoveTopic(String topic) Removes a topic Suppressing warning as this is used as a web servicevoidupdatePermission(String topic, org.wso2.carbon.andes.event.core.TopicRolePermission[] topicRolePermissions) Updates the permissions for roles of a topic Suppressing warning as this is used as a web serviceMethods 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
-
AndesEventAdminService
public AndesEventAdminService()
-
-
Method Details
-
getAllTopics
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 treenumberOfTopicsPerRound- 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
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 nametopicRolePermissions- 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 namestartingIndex- Starting index of which the results should be returnedmaxSubscriptionCount- The amount of results to be returned- Returns:
- An array of Subscriptions
- Throws:
EventAdminException- Thrown when accessing topic manager.
-
getWsSubscriptionsForTopic
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
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
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
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
Publish a message to given topic- Parameters:
content- message to publishtopicName- topic- Throws:
EventAdminException
-
checkCurrentUserHasAddTopicPermission
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
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
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
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
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
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
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
-