Examples of Tenant


Examples of org.pentaho.platform.core.mt.Tenant

      }
    } else {
      IPentahoSession session = PentahoSessionHolder.getSession();
      String tenantPath = (String) session.getAttribute( IPentahoSession.TENANT_ID_KEY );
      if ( tenantPath != null ) {
        tenant = new Tenant( tenantPath, true );
      }
    }
    return tenant;
  }
View Full Code Here

Examples of org.wso2.carbon.user.api.Tenant

    public List<Customer> getCustomersWithName(String customerName) throws BillingException {
        TenantManager tenantManager = Util.getRealmService().getTenantManager();
        List<Customer> customers = new ArrayList<Customer>();
        try{
            int tenantId = tenantManager.getTenantId(customerName);
            Tenant tenant = tenantManager.getTenant(tenantId);
            if(tenant!=null){
                Customer customer = new Customer();
                customer.setId(tenant.getId());
                customer.setName(tenant.getDomain());
                customer.setStartedDate(tenant.getCreatedDate());
                customer.setEmail(tenant.getEmail());
                //customer.setAddress();
                customers.add(customer);
            }
        }catch(Exception e){
            String msg = "Failed to get customers for customers: " + customerName + ".";
View Full Code Here

Examples of org.wso2.carbon.user.api.Tenant

        }

        resource.setProperty(email, "true");

        // now we will really update the tenant email
        Tenant tenant;
        try {
            tenant = tenantManager.getTenant(tenantId);
        } catch (UserStoreException e) {
            String msg =
                    "Error in retrieving the tenant information for the tenant id: " + tenantId +
                    ".";
            log.error(msg, e);
            throw new RegistryException(msg, e);
        }
        tenant.setEmail(email);
        try {
            tenantManager.updateTenant(tenant);
        } catch (UserStoreException e) {
            String msg =
                    "Error in updating the tenant information for the tenant id: " + tenantId + ".";
            log.error(msg, e);
            throw new RegistryException(msg, e);
        }

        // activate the tenant on successful validation of the email, if it is not already activated.
        if ("false".equals(resource.getProperty(StratosConstants.IS_EMAIL_VALIDATED))) {
            tenantManager.activateTenant(tenantId);
            // set the registry flag
            resource.editPropertyValue(StratosConstants.IS_EMAIL_VALIDATED, "false", "true");

            if (log.isDebugEnabled()) {
                log.debug("Tenant : " + tenantId + " is activated after validating the " +
                          "email of the tenant admin.");
            }

            // send the notification message to the tenant admin
            TenantMgtUtil.notifyTenantCreation(tenant.getDomain(),
                                               resource.getProperty(StratosConstants.TENANT_ADMIN),
                                               tenant.getEmail());

            // send the notification message to the super tenant
            TenantMgtUtil.notifyTenantActivationToSuperAdmin(tenant.getDomain(),
                                               resource.getProperty(StratosConstants.TENANT_ADMIN),
                                               tenant.getEmail());

        }

        // update the registry
        superTenantSystemRegistry.put(emailVerificationPath, resource);
View Full Code Here

Examples of org.wso2.carbon.user.api.Tenant

    public List<Customer> getCustomersWithName(String customerName) throws BillingException {
        TenantManager tenantManager = Util.getRealmService().getTenantManager();
        List<Customer> customers = new ArrayList<Customer>();
        try{
            int tenantId = tenantManager.getTenantId(customerName);
            Tenant tenant = tenantManager.getTenant(tenantId);
            if(tenant!=null){
                Customer customer = new Customer();
                customer.setId(tenant.getId());
                customer.setName(tenant.getDomain());
                customer.setStartedDate(tenant.getCreatedDate());
                customer.setEmail(tenant.getEmail());
                //customer.setAddress();
                customers.add(customer);
            }
        }catch(Exception e){
            String msg = "Failed to get customers for customers: " + customerName + ".";
View Full Code Here

Examples of org.wso2.carbon.user.api.Tenant

    // return the existence of the customer

    public void fillCustomerData(int customerId, Customer customer) throws BillingException {
        TenantManager tenantManager = Util.getRealmService().getTenantManager();
        try{
            Tenant tenant = tenantManager.getTenant(customerId);
            customer.setId(customerId);
            customer.setName(tenant.getDomain());
            customer.setStartedDate(tenant.getCreatedDate());
            customer.setEmail(tenant.getEmail());
            //customer.setAddress(); //we dont have the address
        }catch (Exception e){
            String msg = "Failed to fill the data for customer: " +
                    customer.getId() + ".";
            log.error(msg, e);
View Full Code Here

Examples of org.wso2.carbon.user.api.Tenant

    public List<Customer> getCustomersWithName(String customerName) throws BillingException {
        TenantManager tenantManager = Util.getRealmService().getTenantManager();
        List<Customer> customers = new ArrayList<Customer>();
        try{
            int tenantId = tenantManager.getTenantId(customerName);
            Tenant tenant = tenantManager.getTenant(tenantId);
            if(tenant!=null){
                Customer customer = new Customer();
                customer.setId(tenant.getId());
                customer.setName(tenant.getDomain());
                customer.setStartedDate(tenant.getCreatedDate());
                customer.setEmail(tenant.getEmail());
                //customer.setAddress();
                customers.add(customer);
            }
        }catch(Exception e){
            String msg = "Failed to get customers for customers: " + customerName + ".";
View Full Code Here

Examples of org.wso2.carbon.user.api.Tenant

    public Customer getCustomer(int customerId) throws BillingException {
        TenantManager tenantManager = Util.getRealmService().getTenantManager();
        Customer customer = null;

        try{
            Tenant tenant = tenantManager.getTenant(customerId);
            if(tenant!=null){
                customer = new Customer();
                customer.setId(customerId);
                customer.setName(tenant.getDomain());
                customer.setStartedDate(tenant.getCreatedDate());
                customer.setEmail(tenant.getEmail());
                //customer.setAddress();
            }
        } catch (Exception e){
            String msg = "Failed to get customer for customer id: " + customerId + ".";
            log.error(msg, e);
View Full Code Here

Examples of org.wso2.carbon.user.api.Tenant

    private static Log log = LogFactory.getLog(CustomerUtils.class);

    public static void fillCustomerData(int customerId, Customer customer) throws BillingException{
        TenantManager tenantManager = Util.getRealmService().getTenantManager();
        try{
            Tenant tenant = tenantManager.getTenant(customerId);
            customer.setId(customerId);
            customer.setName(tenant.getDomain());
            customer.setStartedDate(tenant.getCreatedDate());
            customer.setEmail(tenant.getEmail());
            //customer.setAddress(); //we dont have the address
        }catch (Exception e){
            String msg = "Failed to fill the data for customer: " +
                    customer.getId() + ".";
            log.error(msg, e);
View Full Code Here

Examples of org.wso2.carbon.user.api.Tenant

    public static Customer getCustomer(int customerId) throws BillingException{
        TenantManager tenantManager = Util.getRealmService().getTenantManager();
        Customer customer = null;

        try{
            Tenant tenant = tenantManager.getTenant(customerId);
            if(tenant!=null){
                customer = new Customer();
                customer.setId(customerId);
                customer.setName(tenant.getDomain());
                customer.setStartedDate(tenant.getCreatedDate());
                customer.setEmail(tenant.getEmail());
                //customer.setAddress();
            }
        } catch (Exception e){
            String msg = "Failed to get customer for customer id: " + customerId + ".";
            log.error(msg, e);
View Full Code Here

Examples of org.wso2.carbon.user.core.tenant.Tenant

    }

    private int createTenant(String domainName, String adminEmail, String adminUsername,
                             String adminFirstName, String adminLastName) throws Exception {
        int tenantId = -1;
        Tenant tenant = new Tenant();
        tenant.setAdminName(adminUsername);
        tenant.setActive(true);
        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
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.