Examples of RegistryService


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

    protected void unsetListenerManager(ListenerManager listenerManager) {
        this.listenerManager = null;
    }

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

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

    public static String getUrl() throws Exception {

        if (url == null) {
            ServiceHolder serviceHodler = ServiceHolder.getInstance();
            RegistryService regService = serviceHodler.getRegistryService();
            Registry systemRegistry = regService.getConfigSystemRegistry();
            Resource resource = systemRegistry.get("/carbon/connection/props");
            String servicePath = resource.getProperty("service-path");
            String contextRoot = resource.getProperty("context-root");

            String host = resource.getProperty("host-name");
View Full Code Here

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

    protected void unsetListenerManager(ListenerManager listenerManager) {
        this.listenerManager = null;
    }

    private void initailize() {
        RegistryService registryService = Utils.getRegistryService();
        if (!initialized &&
                listenerManager != null && registryService != null &&
                Utils.getRegistryNotificationService() != null) {
            if (registryService instanceof RemoteRegistryService) {
                initialized = true;
                log.warn("Eventing is not available on Remote Registry");
                return;
            }
            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) {
                    // Handler has already been set.
                    return;
                }
                registry = systemRegistry;
View Full Code Here

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

     * Method to determine whether the back-end registry instance is read-only.
     *
     * @return true if the back-end registry instance is read-only or false if not.
     */
    public boolean isRegistryReadOnly() {
        RegistryService registryService = Utils.getRegistryService();
        if (registryService == null) {
            log.error("Registry Service has not been set.");
        } else {
            try {
                RegistryContext context =
                        registryService.getRegistry().getRegistryContext();
                if (context != null) {
                    return context.isReadOnly();
                }
            } catch (Exception e) {
                log.error("An error occurred while obtaining registry instance", e);
View Full Code Here

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

        }
        String webContext = ServerConfiguration.getInstance().getFirstProperty("WebContextRoot");
        if (webContext == null || webContext.equals("/")) {
            webContext = "";
        }
        RegistryService registryService = Utils.getRegistryService();
        String version = "";
        if (registryService == null) {
            log.error("Registry Service has not been set.");
        } else if (path != null) {
            try {
                String[] versions = registryService.getRegistry(
                        CarbonConstants.REGISTRY_SYSTEM_USERNAME,
                        CarbonContext.getCurrentContext().getTenantId()).getVersions(path);
                if (versions != null && versions.length > 0) {
                    version = versions[0].substring(versions[0].lastIndexOf(";version:"));
                }
View Full Code Here

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

    }

    public static void onSuccessAdminLogin(HttpSession httpSess, String username, int tenantId,
            String tenantDomain, String remoteAddress) throws Exception {

        RegistryService registryService = CarbonServicesServiceComponent.getRegistryService();
        UserRegistry userRegistry = registryService.getConfigUserRegistry(username, tenantId);
        UserRegistry governanceUserRegistry =
                registryService.getGovernanceUserRegistry(username, tenantId);
        UserRegistry systemRegistry = registryService.getConfigSystemRegistry(tenantId);
        UserRegistry governanceRegistry = registryService.getGovernanceSystemRegistry(tenantId);
        if (httpSess != null) {
            httpSess.setAttribute(ServerConstants.USER_LOGGED_IN, username);
            httpSess.setAttribute(RegistryConstants.ROOT_REGISTRY_INSTANCE, registryService
                    .getRegistry(username, tenantId));

            SuperTenantCarbonContext carbonContext = SuperTenantCarbonContext.getCurrentContext(httpSess);
            carbonContext.setUsername(username);
            carbonContext.setTenantDomain(tenantDomain);
View Full Code Here

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

        updateRegistryConfiguration(getRegistryConfiguration());

        ServerConfiguration serverConfig = getServerConfiguration();
        setSystemTrustStore(serverConfig);

        RegistryService registryService;
        String registryRoot;
        if (org.wso2.carbon.registry.core.config.RegistryConfiguration.REMOTE_REGISTRY
                .equals(RegistryCoreServiceComponent.registryConfig.getRegistryType())) {
            registryService = getRemoteRegistryService(RegistryCoreServiceComponent.registryConfig);
            registryRoot = RegistryCoreServiceComponent.registryConfig.getValue(
View Full Code Here

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

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

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

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

        * @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
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.