Package org.wso2.carbon.user.api

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


    }

    public byte[] getProcessImage(String processId) {

        QName qName = decode(processId);
        SVGInterface svg = createSVG(qName);
        return svg.toPNGBytes();
    }
View Full Code Here


    private SVGInterface createSVG(QName qName) {

        // generate new
        InputStream in = getBpelDescriptor(qName);

        SVGInterface svg = null;

        try {
            svg = BPEL2SVGUtil.generate(in);

            if (svg == null)
View Full Code Here

   
    protected static SVGImpl generateSVGImpl(java.io.InputStream is) throws java.io.IOException {
      byte[] b=new byte[is.available()];
      is.read(b);
   
      BPELInterface bpel = new BPELImpl();
        OMElement bpelStr = bpel.load(new String(b));
       
        bpel.processBpelString(bpelStr);

        LayoutManager layoutManager = BPEL2SVGFactory.getInstance().getLayoutManager();
        layoutManager.setVerticalLayout(true);
        layoutManager.setYSpacing(20);
        layoutManager.setYSpacing(50);
        layoutManager.layoutSVG(bpel.getRootActivity());

        SVGImpl svg = new SVGImpl();
        svg.setRootActivity(bpel.getRootActivity());
       
        return(svg);
    }
View Full Code Here

   * @param transformer The optional image transformer
   * @throws java.io.IOException Failed to generate the representation
   */
    public static void generate(java.io.InputStream is, java.io.OutputStream os,
                SVGImageTransformer transformer) throws java.io.IOException {
        SVGImpl svg = generateSVGImpl(is);
       
        if (transformer == null) {
          String str=svg.getHeaders()+svg.generateSVGString();
          os.write(str.getBytes());
        } else {
          transformer.transform(svg, os);
        }
    }
View Full Code Here

        layoutManager.setVerticalLayout(true);
        layoutManager.setYSpacing(20);
        layoutManager.setYSpacing(50);
        layoutManager.layoutSVG(bpel.getRootActivity());

        SVGImpl svg = new SVGImpl();
        svg.setRootActivity(bpel.getRootActivity());
       
        return(svg);
    }
View Full Code Here

    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

        }

        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

    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

    // 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

    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

TOP

Related Classes of org.wso2.carbon.user.api.Tenant

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.