Package org.apache.stratos.tenant.mgt.core

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


        }
        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

            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

    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

        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

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

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

TOP

Related Classes of org.apache.stratos.tenant.mgt.core.TenantPersistor

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.