Examples of TenantManager


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

        }
        return item;
    }

    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());
View Full Code Here

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

        mailParameters.put("end-date", dateFormat.format(invoice.getEndDate()));

        Customer customer = invoice.getCustomer();

        try{
            TenantManager tenantManager = Util.getRealmService().getTenantManager();
            Tenant tenant = (Tenant) tenantManager.getTenant(customer.getId());
            String customerName =
                    ClaimsMgtUtil.getFirstName(Util.getRealmService(), tenant, customer.getId());
            if(customerName!=null){
                mailParameters.put("customer-name", customerName);
            }else{
View Full Code Here

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

        }
        return subscriptionId;
    }

    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());
View Full Code Here

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

    }

    // 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
View Full Code Here

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

            throw new BillingException(msg, e);
        }
    }

    public List<Customer> getAllCustomers() throws BillingException {
        TenantManager tenantManager = Util.getRealmService().getTenantManager();
        List<Customer> customers = new ArrayList<Customer>();
        try{
            Tenant[] tenants = tenantManager.getAllTenants();
            if(tenants!=null && tenants.length>0){
                for(Tenant tenant : tenants){
                    Customer customer = new Customer();
                    customer.setId(tenant.getId());
                    customer.setName(tenant.getDomain());
View Full Code Here

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

        return returnVal;
    }


    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());
View Full Code Here

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

        return customers;
    }

    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());
View Full Code Here

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

public class CustomerUtils {
    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
View Full Code Here

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

            throw new BillingException(msg, e);
        }
    }

    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());
View Full Code Here

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

                        String msg = "Error in getting the tenant manager. " +
                                "The realm service is not available.";
                        log.error(msg);
                        return new ResponseTarget(context, new EmptyResponseContext(400, msg));
                    }
                    TenantManager tenantManager =
                            RegistryContext.getBaseInstance().getRealmService().
                                    getTenantManager();
                    try {
                        calledTenantId = tenantManager.getTenantId(tenantDomain);
                    } catch (org.wso2.carbon.user.api.UserStoreException e) {
                        String msg =
                                "Error in converting tenant domain to the id for tenant domain: " +
                                        tenantDomain + ".";
                        log.error(msg, e);
                        return new ResponseTarget(context, new EmptyResponseContext(400, msg));
                    }
                    try {
                        if (!tenantManager.isTenantActive(calledTenantId)) {
                            // the tenant is not active.
                            String msg =
                                    "The tenant is not active. tenant domain: " + tenantDomain +
                                            ".";
                            log.error(msg);
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.