class QuotaChecker {

    void checkPolicyAssertionQuota(ObjectStoreConnection con, String domainName,
            String policyName, 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 assertion
        // to this policy without exceeding the quota
        
        int objectCount = con.countAssertions(domainName, policyName) + 1;
        if (quota.getAssertion() < objectCount) {
            throw ZMSUtils.quotaLimitError("policy assertion quota exceeded - limit: "
                    + quota.getAssertion() + " actual: " + objectCount, caller);
        }
    }

    public  QuotaChecker();

}