Examples of TopicDetails


Examples of org.wso2.event.TopicDetails

//            if(!systemRegistry.resourceExists(topicPath)){
//                throw new AxisFault("Permission denied " +getLoggedInUserName() + " cannot access "+ topicName);
//            }
//            Resource resource = systemRegistry.get(topicPath);
            EventBrokerService broker = CarbonEventBroker.getInstance();
            TopicDetails topicDetails = broker.getSubscriptionManager().getTopicDetails(topicName);
            String owner = topicDetails.getOwner();
            if(!owner.equals(getLoggedInUserName())){
                throw new AxisFault("Permission denied " +getLoggedInUserName() + " cannot access "+ topicName);
            }

           
View Full Code Here

Examples of org.wso2.event.TopicDetails

    }

    public String revokeATopic(String topicName, String[] accessibleUsers, String[] acessibleRoles) throws AxisFault {
        try {
            EventBrokerService broker = CarbonEventBroker.getInstance();
            TopicDetails topicDetails = broker.getSubscriptionManager().getTopicDetails(topicName);
            String owner = topicDetails.getOwner();

            if(!owner.equals(getLoggedInUserName())){
                throw new AxisFault("Permission denied " +getLoggedInUserName() + " cannot access "+ topicName);
            }
           
View Full Code Here

Examples of org.wso2.event.TopicDetails

               } else {
                   subStorePath = topicName;
               }
               String topicInfo = subStorePath+ "/topicInfo";
               if(registry.resourceExists(topicInfo)){
                   TopicDetails topicDetails = new TopicDetails();
                   Resource resource = registry.get(topicInfo);
                   topicDetails.setTopicName(resource.getProperty("topicName"));
                   topicDetails.setDescription(resource.getProperty("description"));
                   topicDetails.setSchemaDescription(resource.getProperty("schemaDescription"));
                   topicDetails.setOwner(resource.getProperty(OWNER));
                   String isSecureTopicStr = resource.getProperty("isSecureTopic");
                   if(isSecureTopicStr != null){
                       topicDetails.setSecureTopic(Boolean.parseBoolean(isSecureTopicStr));      
                   }
                   return topicDetails;
               }else{
                   return null;   
               }
View Full Code Here

Examples of org.wso2.event.TopicDetails

    public void updateTopic(TopicDetails topicDetails) throws EventException {
        try {
            String topicInfo = getTopicInfoPath(topicDetails.getTopicName());
            if(registry.resourceExists(topicInfo)){
                TopicDetails currentTopicDetails = getTopicDetails(topicDetails.getTopicName());
                Resource resource = registry.get(topicInfo);
                if(currentTopicDetails.isSecureTopic() && !currentTopicDetails.getOwner().equals(EventBrokerUtils.getLoggedInUserName())){
                    throw new EventException("Current user do not have permission to change this topic");
                }
                resource.setProperty("topicName", topicDetails.getTopicName());
                if(topicDetails.getDescription() != null){
                    resource.setProperty("description", topicDetails.getDescription());   
View Full Code Here

Examples of org.wso2.event.TopicDetails

        }
    }
   
   
    public void defineSecureTopic(String topicName) throws EventException {
        TopicDetails topicDetails = new TopicDetails();
        topicDetails.setTopicName(topicName);
        topicDetails.setSecureTopic(true);
        updateTopic(topicDetails);
    }
View Full Code Here

Examples of org.wso2.event.TopicDetails

        topicDetails.setSecureTopic(true);
        updateTopic(topicDetails);
    }

    public void deleteSecureTopic(String topicName) throws EventException{
        TopicDetails topicDetails = new TopicDetails();
        topicDetails.setTopicName(topicName);
        topicDetails.setSecureTopic(false);
        updateTopic(topicDetails);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.