Examples of MultitenancyPackage


Examples of org.wso2.carbon.billing.mgt.dataobjects.MultitenancyPackage

            log.error(msg, e);
            throw new ThrottlingException(msg, e);
        }
        // getting the package
        try {
            MultitenancyPackage mtPackage = Util.getCurrentBillingPackage(tenantId);
            dataContext.addDataObject(ThrottlingDataEntryConstants.PACKAGE, mtPackage);
        } catch (RegistryException e) {
            String msg = "Error in getting the multi-tenancy package. tenant id: " + tenantId + ".";
            log.error(msg, e);
            throw new ThrottlingException(msg, e);
View Full Code Here

Examples of org.wso2.carbon.billing.mgt.dataobjects.MultitenancyPackage

public class CustomDataProvider extends DataProvider {
    public void invoke(ThrottlingDataContext dataContext) throws ThrottlingException {
        long dataSize = dataContext.getDataLong(ThrottlingDataEntryConstants.TENANT_CAPACITY);

        if (dataSize % 2 == 0) {
            MultitenancyPackage multiPackage = new MultitenancyPackage();
            multiPackage.setName("test1");
            multiPackage.setBandwidthLimit(50);

            dataContext.addDataObject(ThrottlingDataEntryConstants.PACKAGE, multiPackage);
        } else {
            MultitenancyPackage multiPackage = new MultitenancyPackage();
            multiPackage.setName("test2");

            dataContext.addDataObject(ThrottlingDataEntryConstants.PACKAGE, multiPackage);
            multiPackage.setBandwidthLimit(50);
        }

    }
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.