Examples of TenantPersistor


Examples of org.apache.stratos.tenant.mgt.core.TenantPersistor

                // not throwing the exception in finally more up.
            }
        }
        // persists the tenant.
        Tenant tenant = TenantMgtUtil.initializeTenant(tenantInfoBean);
        TenantPersistor persistor = new TenantPersistor();
        int tenantId = persistor.persistTenant(tenant, true, tenantInfoBean.getSuccessKey(),
                tenantInfoBean.getOriginatedService(),false);
        tenantInfoBean.setTenantId(tenantId);
        TenantMgtUtil.addClaimsToUserStoreManager(tenant);
       
        //Notify tenant addition
View Full Code Here

Examples of org.apache.stratos.tenant.mgt.core.TenantPersistor

        }
        String tenantDomain = tenantInfoBean.getTenantDomain();
        TenantMgtUtil.validateDomain(tenantDomain);
        checkIsSuperTenantInvoking();
        Tenant tenant = TenantMgtUtil.initializeTenant(tenantInfoBean);
        TenantPersistor persistor = new TenantPersistor();
        // not validating the domain ownership, since created by super tenant
        int tenantId = persistor.persistTenant(tenant, false, tenantInfoBean.getSuccessKey(),
                                tenantInfoBean.getOriginatedService(),false);
        tenantInfoBean.setTenantId(tenantId);
       
        TenantMgtUtil.addClaimsToUserStoreManager(tenant);
       
View Full Code Here

Examples of org.apache.stratos.tenant.mgt.core.TenantPersistor

            log.error(msg);
            throw new Exception(msg);
        }
        Tenant tenant = TenantMgtUtil.initializeTenant(tenantInfoBean);
        tenant.setId(tenantId);
        TenantPersistor persistor = new TenantPersistor();
        // not validating the domain ownership, since created by super tenant
        persistor.persistTenant(tenant, false, tenantInfoBean.getSuccessKey(),
                tenantInfoBean.getOriginatedService(), true);
        tenantInfoBean.setTenantId(tenantId);
        notifyTenantAddition(tenantInfoBean);
        return TenantMgtUtil.prepareStringToShowThemeMgtPage(tenantId);
    }
View Full Code Here

Examples of org.apache.stratos.tenant.mgt.core.TenantPersistor

    public boolean registerGoogleAppsTenant(
                                TenantInfoBean tenantInfoBean)throws TenantManagementException {
        try {
            int tenantId = -1;
            Tenant tenant = TenantMgtUtil.initializeTenant(tenantInfoBean);
            TenantPersistor tenantPersistor = new TenantPersistor();

            MultiTenantRealmConfigBuilder builder =
                    TenantMgtServiceComponent.getRealmService().getMultiTenantRealmConfigBuilder();
            TenantMgtConfiguration tenantMgtConfiguration =
                    TenantMgtServiceComponent.getRealmService().getTenantMgtConfiguration();
            RealmConfiguration bootStrapRealmConfig =
                    TenantMgtServiceComponent.getRealmService().getBootstrapRealmConfiguration();
            RealmConfiguration realmConfigToPersist =
                    builder.getRealmConfigForTenantToPersist(bootStrapRealmConfig,
                            tenantMgtConfiguration, tenant, -1);
            realmConfigToPersist.getUserStoreProperties().put(
                    UserCoreConstants.RealmConfig.PROPERTY_EXTERNAL_IDP, GOOGLE_APPS_IDP_NAME);
            tenant.setRealmConfig(realmConfigToPersist);
            tenant.setAdminPassword(UUIDGenerator.getUUID());

            tenantId = tenantPersistor.persistTenant(tenant);
            tenantInfoBean.setTenantId(tenantId);

            TenantMgtUtil.addClaimsToUserStoreManager(tenant);

            // Notify tenant addition
View Full Code Here

Examples of org.apache.stratos.tenant.mgt.core.TenantPersistor

        if (userRegistry.getTenantId() != MultitenantConstants.SUPER_TENANT_ID) {
            log.error("Security Alert! Non super tenant trying to create a tenant.");
            throw new RestAPIException("Invalid data."); // obscure error message.
        }
        Tenant tenant = TenantMgtUtil.initializeTenant(tenantInfoBean);
        TenantPersistor persistor = ServiceHolder.getTenantPersistor();
        // not validating the domain ownership, since created by super tenant
        int tenantId = 0; //TODO verify whether this is the correct approach (isSkeleton)
        try {
            tenantId = persistor.persistTenant(tenant, false, tenantInfoBean.getSuccessKey(),
                    tenantInfoBean.getOriginatedService(),false);
        } catch (Exception e) {
            String msg = "Error in persisting tenant " + tenantDomain;
            log.error(msg, e);
            throw new RestAPIException(msg);
View Full Code Here

Examples of org.apache.stratos.tenant.mgt.core.TenantPersistor

        RegistryService registryService = (RegistryService) carbonContext.getOSGiService(RegistryService.class);
        return registryService;
    }

    public static TenantPersistor getTenantPersistor() {
        TenantPersistor tenantPersistor = new TenantPersistor();
        return tenantPersistor;
    }
View Full Code Here

Examples of org.wso2.carbon.core.multitenancy.persistence.TenantPersistor

        tenant.setAdminPassword(UUIDGenerator.getUUID());
        tenant.setEmail(adminEmail);
        tenant.setAdminFirstName(adminFirstName);
        tenant.setAdminLastName(adminLastName);
        tenant.setDomain(domainName);
        TenantPersistor tenantPersistor = IdentityRPServiceComponent.getTenantPersistor();

       
        MultiTenantRealmConfigBuilder builder =
                                                IdentityRPServiceComponent.getRealmService()
                                                                          .
                                                                          getMultiTenantRealmConfigBuilder();
        TenantMgtConfiguration tenantMgtConfiguration =
                IdentityRPServiceComponent.getRealmService().getTenantMgtConfiguration();
        RealmConfiguration bootStrapRealmConfig =
                                         IdentityRPServiceComponent.getRealmService()
                                                                   .getBootstrapRealmConfiguration();
        RealmConfiguration realmConfigToPersist =
                                                  builder.getRealmConfigForTenantToPersist(bootStrapRealmConfig,
                                                                                           tenantMgtConfiguration,
                                                                                           tenant,
                                                                                           -1);
        realmConfigToPersist.
                            getUserStoreProperties().
                            put(UserCoreConstants.RealmConfig.PROPERTY_EXTERNAL_IDP, GOOGLE_APPS_IDP_NAME);
        tenant.setRealmConfig(realmConfigToPersist);
        tenantId = tenantPersistor.persistTenant(tenant);
        IdentityRPServiceComponent.getRealmService().getTenantManager().activateTenant(tenantId);
        return tenantId;
    }
View Full Code Here

Examples of org.wso2.carbon.core.multitenancy.persistence.TenantPersistor

                // not throwing the exception in finally more up.
            }
        }
        // persists the tenant.
        Tenant tenant = TenantMgtUtil.initializeTenant(tenantInfoBean);
        TenantPersistor persistor = TenantMgtServiceComponent.getTenantPersistor();
        persistor.persistTenant(tenant, true, tenantInfoBean.getSuccessKey(), tenantInfoBean.getOriginatedService());
        TenantMgtUtil.addClaimsToUserStoreManager(tenant);

        // For the registration validation - mail for the tenant email address
        TenantMgtUtil.sendEmail(tenant, tenantInfoBean.getOriginatedService());
View Full Code Here

Examples of org.wso2.carbon.core.multitenancy.persistence.TenantPersistor

        if (userRegistry.getTenantId() != 0) {
            log.error("Security Alert! Non super tenant trying to create a tenant.");
            throw new Exception("Invalid data."); // obscure error message.
        }
        Tenant tenant = TenantMgtUtil.initializeTenant(tenantInfoBean);
        TenantPersistor persistor = TenantMgtServiceComponent.getTenantPersistor();
        // not validating the domain ownership, since created by super tenant
        persistor.persistTenant(tenant, false, tenantInfoBean.getSuccessKey(),
                                tenantInfoBean.getOriginatedService());
        TenantMgtUtil.addClaimsToUserStoreManager(tenant);
        // For the registration validation - mail for the tenant email address
        TenantMgtUtil.sendEmail(tenant, tenantInfoBean.getOriginatedService());
View Full Code Here

Examples of org.wso2.carbon.core.multitenancy.persistence.TenantPersistor

                // not throwing the exception in finally more up.
            }
        }
        // persists the tenant.
        Tenant tenant = TenantMgtUtil.initializeTenant(tenantInfoBean);
        TenantPersistor persistor = TenantMgtServiceComponent.getTenantPersistor();
        int tenantId = persistor.persistTenant(tenant, true, tenantInfoBean.getSuccessKey(),
                tenantInfoBean.getOriginatedService());
        tenantInfoBean.setTenantId(tenantId);
        TenantMgtUtil.addClaimsToUserStoreManager(tenant);
       
        //Notify tenant addition
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.