Examples of RegistryService


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

    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

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

        */
    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

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

        */
    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

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

    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

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

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

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

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

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

        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

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

        }
        return username;
    }

    public static UserRegistry getUserRegistry() throws RegistryException {
        RegistryService registryService =
                MessageBoxServiceValueHolder.getInstance().getRegistryService();

        return registryService.getGovernanceSystemRegistry(CarbonContext.getCurrentContext().getTenantId());

    }
View Full Code Here

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

    private String rootPath;

    private List<RegistryExtension> extensions = new ArrayList<RegistryExtension>();

    public WSO2Registry() {
        RegistryService registryService = RegistryServiceHolder.getInstance().getRegistryService();
        try {
            configRegistry = registryService.getConfigSystemRegistry(
                    CarbonContext.getCurrentContext().getTenantId());
            governanceRegistry = registryService.getGovernanceSystemRegistry(
                    CarbonContext.getCurrentContext().getTenantId());
            localRegistry = registryService.getLocalRepository();
        } catch (RegistryException e) {
            handleException("Error while initializing the mediation registry adapter", e);
        }
    }
View Full Code Here

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

        boolean isAuthenticated = isOAuthConsumerValid(oauthConsumer);

        if (isAuthenticated) {
            String tenantDomain = UserCoreUtil.getTenantDomain(OAuthServiceComponent
                    .getRealmService(), oauthConsumer.getOauthConsumerKey());
            RegistryService registryService = OAuthServiceComponent.getRegistryService();
            String username = UserCoreUtil.getTenantLessUsername(oauthConsumer
                    .getOauthConsumerKey());
            RealmService realmService = OAuthServiceComponent.getRealmService();
            int tenantId = realmService.getTenantManager().getTenantId(tenantDomain);
            UserRealm realm = registryService.getUserRealm(tenantId);
            int userId = realm.getUserStoreManager().getUserId(username);

            String baseString = "TenantId:=" + tenantId + "&UserId:=" + userId;
            Registry registry = registryService.getConfigSystemRegistry(tenantId);

            String path = RegistryConstants.PROFILES_PATH + username;
            Collection profile = null;
            if (!registry.resourceExists(path)) {
                return false;
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.