class QuotaChecker {

    void checkGroupMembershipQuota(ObjectStoreConnection con, String domainName,
                                  String groupName, String caller) {

        // if quota check is disabled we have nothing to do

        if (!quotaCheckEnabled) {
            return;
        }

        // first retrieve the domain quota

        final Quota quota = getDomainQuota(con, domainName);

        // now check to make sure we can add 1 more member
        // to this group without exceeding the quota

        int objectCount = con.countGroupMembers(domainName, groupName) + 1;
        if (quota.getGroupMember() < objectCount) {
            throw ZMSUtils.quotaLimitError("group member quota exceeded - limit: "
                    + quota.getGroupMember() + " actual: " + objectCount, caller);
        }
    }

    public  QuotaChecker();

}