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

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


    @Override
    public SVGDimension getDimensions() {
        if (dimensions == null) {
            int width = 0;
            int height = 0;
            dimensions = new SVGDimension(width, height);

            SVGDimension subActivityDim = null;
            ActivityInterface activity = null;
            Iterator<ActivityInterface> itr = getSubActivities().iterator();
            while (itr.hasNext()) {
                activity = itr.next();
                subActivityDim = activity.getDimensions();
                if (subActivityDim.getWidth() > width) {
                    width += subActivityDim.getWidth();
                }
                height += subActivityDim.getHeight();
            }

            height += getYSpacing() + getStartIconHeight();
            width += getXSpacing();
View Full Code Here


            outputStream.write(("<h4>Service " + serviceName +
                                " is inactive. Cannot retrieve certificate.</h4>").getBytes());
            outputStream.flush();
        } else {

            RegistryService registryService = dataHolder.getRegistryService();
            Registry registry = registryService.getConfigSystemRegistry();

            String servicePath = RegistryResources.SERVICE_GROUPS
            + axisService.getAxisServiceGroup().getServiceGroupName()
            + RegistryResources.SERVICES + axisService.getName();
View Full Code Here

    }

    public boolean authenticateUser(String userName, String password) throws CarbonException,
            UserStoreException {
        RealmService realmService = IdentitySTSServiceComponent.getRealmService();
        RegistryService registryService = IdentitySTSServiceComponent.getRegistryService();
        boolean isAuthenticated = false;
        UserRealm realm = AnonymousSessionUtil.getRealmByUserName(registryService, realmService,
                userName);
        userName = UserCoreUtil.getTenantLessUsername(userName);
        isAuthenticated = realm.getUserStoreManager().authenticate(userName, password);
View Full Code Here

    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

    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

    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

     * 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

        }
        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

    }

    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

        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

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.