Package org.wso2.carbon.registry.core.service

Examples of org.wso2.carbon.registry.core.service.RegistryService


    public static String getRelativeUrl() {
        BundleContext context = CarbonUIUtil.getBundleContext();
        ServiceReference reference = context.getServiceReference(RegistryService.class
                .getName());
        RegistryService registryService = (RegistryService) context.getService(reference);
        String url = null;
        try {
            Registry systemRegistry = registryService.getConfigSystemRegistry();
            Resource resource = systemRegistry.get("/carbon/connection/props");
            String servicePath = resource.getProperty("service-path");
            String contextRoot = resource.getProperty("context-root");
            contextRoot = contextRoot.equals("/") ? "" : contextRoot;
            url = contextRoot + servicePath + "/Java2WSDLService";
View Full Code Here


        * @throws RegistryClientException
        */
    public static void createQueue(String queueName, String owner)
            throws RegistryClientException {
        try {
            RegistryService registryService = CommonsDataHolder.getInstance().getRegistryService();
            UserRegistry registry = registryService.getGovernanceSystemRegistry();

            // Set queue properties
            Collection queue = null;
            String queueID = CommonsUtil.getQueueID(queueName);

View Full Code Here

        * @throws RegistryClientException
        */
    public static void deleteQueue(String queueName)
            throws RegistryClientException {
        try {
            RegistryService registryService = CommonsDataHolder.getInstance().getRegistryService();
            UserRegistry registry = registryService.getGovernanceSystemRegistry();

            // Delete queue
            String queueID = CommonsUtil.getQueueID(queueName);

            if (registry.resourceExists(queueID)) {
View Full Code Here

    public static QueueDetails[] getQueues()
            throws RegistryClientException {
        try {
            QueueDetails[] queueDetailsArray = new QueueDetails[0];

            RegistryService registryService = CommonsDataHolder.getInstance().getRegistryService();
            UserRegistry registry = registryService.getGovernanceSystemRegistry();

            // Get queues
            String queuesID = CommonsUtil.getQueuesID();
            if (registry.resourceExists(queuesID)) {
                Collection queueCollection = (Collection)registry.get(queuesID);
View Full Code Here

        */
    public static void createSubscription(
            String topic, String subscriptionName, String owner)
            throws RegistryClientException {
        try {
            RegistryService registryService = CommonsDataHolder.getInstance().getRegistryService();
            UserRegistry registry = registryService.getGovernanceSystemRegistry();

            // Add new subscription and set properties
            Collection subscription = null;
            String subscriptionID = CommonsUtil.getSubscriptionID(topic, subscriptionName);

View Full Code Here

        */
    public static void deleteSubscription(
            String topic, String subscriptionName)
            throws RegistryClientException {
        try {
            RegistryService registryService = CommonsDataHolder.getInstance().getRegistryService();
            UserRegistry registry = registryService.getGovernanceSystemRegistry();

            // Delete subscription
            String subscriptionID = CommonsUtil.getSubscriptionID(topic, subscriptionName);
            if (registry.resourceExists(subscriptionID)) {
                registry.delete(subscriptionID);
View Full Code Here

    public static SubscriptionDetails[] getSubscriptions(String topic)
            throws RegistryClientException {
        try {
            SubscriptionDetails[] subscriptionDetailsArray = new SubscriptionDetails[0];

            RegistryService registryService = CommonsDataHolder.getInstance().getRegistryService();
            UserRegistry registry = registryService.getGovernanceSystemRegistry();

            // Get subscriptions
            String subscriptionsID = CommonsUtil.getSubscriptonsID(topic);
            if (registry.resourceExists(subscriptionsID)) {
                Collection subscriptionCollection = (Collection)registry.get(subscriptionsID);
View Full Code Here

import org.wso2.carbon.announcement.utils.Util;

public class AnnouncementService {
    private static final String instIdPath = "/repository/components/org.wso2.carbon.instance-id/uuid";
    public String retrieveRegId() throws Exception {
        RegistryService registryService = Util.getRegistryService();
        Registry systemRegistry = registryService.getGovernanceSystemRegistry();
        String uuid = null;
        systemRegistry.beginTransaction();
        boolean isSuccess = false;
        try {
            if (systemRegistry.resourceExists(instIdPath)) {
View Full Code Here

public class KeepAliveJob implements Job {
    private static final Log log = LogFactory.getLog(KeepAliveJob.class);

    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        log.debug("-------------Running the db keep alive job------------------");
        RegistryService registryService = Util.getRegistryService();
        try {
            new AccessingRegistryAction(registryService.getLocalRepository()).execute();
            new AccessingRegistryAction(registryService.getConfigSystemRegistry()).execute();
            new AccessingRegistryAction(registryService.getGovernanceSystemRegistry()).execute();
        } catch (Exception e) {
            String msg = "Error in running registry actions.";
            log.error(msg, e);
            throw new JobExecutionException(msg, e);
        }
View Full Code Here

        Utils.getRegistryEventBrokerService().registerEventDispatcher(
                RegistryEventingConstants.TOPIC_PREFIX, dispatcher);
    }

    private void setupHandlers() {
        RegistryService registryService = Utils.getRegistryService();
        if (registryService instanceof RemoteRegistryService && !initialized) {
            initialized = true;
            log.warn("Eventing is not available on Remote Registry");
            return;
        }
        if (!initialized && listenerManager != null && registryService != null) {
            initialized = true;
            try {
                // We can't get Registry from Utils, as the MessageContext is not available at
                // activation time.
                Registry systemRegistry = registryService.getConfigSystemRegistry();
                if (registry != null && registry == systemRegistry) {
                    return;
                }
                registry = systemRegistry;
                if (registry == null ||
View Full Code Here

TOP

Related Classes of org.wso2.carbon.registry.core.service.RegistryService

Copyright © 2018 www.massapicom. 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.