/** * Get the count of the number of used slots. * * @return Long count, null if unlimited */ public Long getCurrentEntitlements() { Long count = EntitlementManager.getUsedEntitlements(this.getEntitlement(), org); if (count == null) { return new Long(0); } return count; }
/** * @return upper range for which a org can get entitlements (org1 max - org1 consumed + org max) */ public Long getUpperRange() { Long defaultMax = EntitlementManager.getMaxEntitlements(this.getEntitlement(), OrgFactory.getSatelliteOrg()); Long defaultCur = EntitlementManager.getUsedEntitlements(this.getEntitlement(), OrgFactory.getSatelliteOrg()); Long upper = getMaxEntitlements() + (defaultMax - defaultCur); return upper; }