class DBService implements RolesProvider {

    void updateSystemMetaFields(Domain domain, final String attribute, boolean deleteAllowed,
            DomainMeta meta) {

        final String caller = "putdomainsystemmeta";

        // system attributes we'll only set if they're available
        // in the given object

        switch (attribute) {
            case ZMSConsts.SYSTEM_META_ACCOUNT:
                if (!isDeleteSystemMetaAllowed(deleteAllowed, domain.getAccount(), meta.getAccount())) {
                    throw ZMSUtils.forbiddenError("unauthorized to reset system meta attribute: " + attribute, caller);
                }
                domain.setAccount(meta.getAccount());
                break;
            case ZMSConsts.SYSTEM_META_PRODUCT_ID:
                if (!isDeleteSystemMetaAllowed(deleteAllowed, domain.getYpmId(), meta.getYpmId())) {
                    throw ZMSUtils.forbiddenError("unauthorized to reset system meta attribute: " + attribute, caller);
                }
                domain.setYpmId(meta.getYpmId());
                break;
            case ZMSConsts.SYSTEM_META_CERT_DNS_DOMAIN:
                if (!isDeleteSystemMetaAllowed(deleteAllowed, domain.getCertDnsDomain(), meta.getCertDnsDomain())) {
                    throw ZMSUtils.forbiddenError("unauthorized to reset system meta attribute: " + attribute, caller);
                }
                domain.setCertDnsDomain(meta.getCertDnsDomain());
                break;
            case ZMSConsts.SYSTEM_META_ORG:
                if (!isDeleteSystemMetaAllowed(deleteAllowed, domain.getOrg(), meta.getOrg())) {
                    throw ZMSUtils.forbiddenError("unauthorized to reset system meta attribute: " + attribute, caller);
                }
                domain.setOrg(meta.getOrg());
                break;
            case ZMSConsts.SYSTEM_META_AUDIT_ENABLED:
                domain.setAuditEnabled(meta.getAuditEnabled());
                break;
            case ZMSConsts.SYSTEM_META_USER_AUTH_FILTER:
                domain.setUserAuthorityFilter(meta.getUserAuthorityFilter());
                break;
            case ZMSConsts.SYSTEM_META_ENABLED:
                domain.setEnabled(meta.getEnabled());
                break;
            default:
                throw ZMSUtils.requestError("unknown system meta attribute: " + attribute, caller);
        }
    }

    public  DBService(ObjectStore store, AuditLogger auditLogger, ZMSConfig zmsConfig, AuditReferenceValidator auditReferenceValidator);

}