Package org.wso2.carbon.registry.core.session

Examples of org.wso2.carbon.registry.core.session.UserRegistry.resourceExists()


        UserRegistry superTenantSystemRegistry =
                Util.getGovernanceSystemRegistry(MultitenantConstants.SUPER_TENANT_ID);
        String emailVerificationPath = StratosConstants.ADMIN_EMAIL_VERIFICATION_FLAG_PATH +
                RegistryConstants.PATH_SEPARATOR +
                userRegistry.getTenantId();
        if (!superTenantSystemRegistry.resourceExists(emailVerificationPath)) {
            // the confirmation key should exist,otherwise fail registration
            return false;
        }
        Resource resource = superTenantSystemRegistry.get(emailVerificationPath);
View Full Code Here


        UserRegistry superTenantSystemRegistry = Util.getGovernanceSystemRegistry(
                MultitenantConstants.SUPER_TENANT_ID);
        String emailVerificationPath =
                StratosConstants.ADMIN_EMAIL_VERIFICATION_FLAG_PATH +
                RegistryConstants.PATH_SEPARATOR + tenantId;
        if (!superTenantSystemRegistry.resourceExists(emailVerificationPath)) {
            // the confirmation key should exist,otherwise fail registraion
            String msg = "The confirmationKey doesn't exist in service.";
            log.error(msg);
            throw new RegistryException(msg);
        }
View Full Code Here

    public static void removeTheUUID(String tenantPass) throws RegistryException {
        if (tenantPass != null && !tenantPass.equals("")) {
            // tenant 0th system registry
            UserRegistry systemRegistry = registryService.getGovernanceSystemRegistry();
            if(systemRegistry.resourceExists(
                    StratosConstants.TENANT_CREATION_THEME_PAGE_TOKEN + "/" + tenantPass)) {
                systemRegistry.delete(
                        StratosConstants.TENANT_CREATION_THEME_PAGE_TOKEN + "/" + tenantPass);
            }
        }
View Full Code Here

        String targetPath = THEME_PATH;

        UserRegistry systemZeroRegistry = registryService.getGovernanceSystemRegistry();

        // if the themes doesn't exist we would exclude applying it
        if (!systemZeroRegistry.resourceExists(sourcePath)) {
            log.info("The theme source path: " + sourcePath + " doesn't exist.");
            return;
        }

        // first delete the old one, or we can backup it if required
View Full Code Here

     */
    public static DeploymentSynchronizerConfiguration getDeploymentSyncConfigurationFromRegistry(
            int tenantId) throws RegistryException {

        UserRegistry localRepository = getLocalRepository(tenantId);
        if (!localRepository.resourceExists(DeploymentSynchronizerConstants.CARBON_REPOSITORY)) {
            return null;
        }

        Resource resource = localRepository.get(DeploymentSynchronizerConstants.CARBON_REPOSITORY);
        DeploymentSynchronizerConfiguration config = new DeploymentSynchronizerConfiguration();
View Full Code Here

    public static void persistConfiguration(DeploymentSynchronizerConfiguration config,
                                            int tenantId) throws RegistryException {

        Resource resource;
        UserRegistry localRepository = getLocalRepository(tenantId);
        if (!localRepository.resourceExists(DeploymentSynchronizerConstants.CARBON_REPOSITORY)) {
            resource = localRepository.newResource();
        } else {
            resource = localRepository.get(DeploymentSynchronizerConstants.CARBON_REPOSITORY);
        }
View Full Code Here

    private UserRegistry initRegistry (int tenantId) throws RegistryException {

        UserRegistry tenantGovRegistry = registryService.getGovernanceSystemRegistry(tenantId);

        // check if the resource is available, else create it
        if (!tenantGovRegistry.resourceExists(STRATOS_MANAGER_REOSURCE)) {
            synchronized (RegistryManager.class) {
                try {
                    if (!tenantGovRegistry.resourceExists(STRATOS_MANAGER_REOSURCE)) {
                        tenantGovRegistry.put(STRATOS_MANAGER_REOSURCE, tenantGovRegistry.newCollection());
                    }
View Full Code Here

        // check if the resource is available, else create it
        if (!tenantGovRegistry.resourceExists(STRATOS_MANAGER_REOSURCE)) {
            synchronized (RegistryManager.class) {
                try {
                    if (!tenantGovRegistry.resourceExists(STRATOS_MANAGER_REOSURCE)) {
                        tenantGovRegistry.put(STRATOS_MANAGER_REOSURCE, tenantGovRegistry.newCollection());
                    }
                } catch (RegistryException e) {
                    String errorMsg = "Failed to create the registry resource " + STRATOS_MANAGER_REOSURCE;
                    log.error(errorMsg, e);
View Full Code Here

    private UserRegistry initRegistry () throws RegistryException {

        UserRegistry govRegistry = registryService.getGovernanceSystemRegistry();

        // check if the resource is available, else create it
        if (!govRegistry.resourceExists(STRATOS_MANAGER_REOSURCE)) {
            synchronized (RegistryManager.class) {
                try {
                    if (!govRegistry.resourceExists(STRATOS_MANAGER_REOSURCE)) {
                        govRegistry.put(STRATOS_MANAGER_REOSURCE, govRegistry.newCollection());
                    }
View Full Code Here

        // check if the resource is available, else create it
        if (!govRegistry.resourceExists(STRATOS_MANAGER_REOSURCE)) {
            synchronized (RegistryManager.class) {
                try {
                    if (!govRegistry.resourceExists(STRATOS_MANAGER_REOSURCE)) {
                        govRegistry.put(STRATOS_MANAGER_REOSURCE, govRegistry.newCollection());
                    }
                } catch (RegistryException e) {
                    String errorMsg = "Failed to create the registry resource " + STRATOS_MANAGER_REOSURCE;
                    log.error(errorMsg, e);
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.