class DBService implements RolesProvider {

    void executePutDomainMeta(ResourceContext ctx, String domainName, DomainMeta meta,
            final String systemAttribute, boolean deleteAllowed, String auditRef, String caller) {

        // our exception handling code does the check for retry count
        // and throws the exception it had received when the retry
        // count reaches 0

        for (int retryCount = defaultRetryCount; ; retryCount--) {

            try (ObjectStoreConnection con = store.getConnection(false, true)) {

                Domain domain = con.getDomain(domainName);
                if (domain == null) {
                    con.rollbackChanges();
                    throw ZMSUtils.notFoundError(caller + ": Unknown domain: " + domainName, caller);
                }

                // first verify that auditing requirements are met

                checkDomainAuditEnabled(con, domain, auditRef, caller, getPrincipalName(ctx), AUDIT_TYPE_DOMAIN);

                // now process the request. first we're going to make a
                // copy of our domain

                Domain updatedDomain = new Domain()
                        .setName(domain.getName())
                        .setEnabled(domain.getEnabled())
                        .setId(domain.getId())
                        .setAuditEnabled(domain.getAuditEnabled())
                        .setDescription(domain.getDescription())
                        .setOrg(domain.getOrg())
                        .setApplicationId(domain.getApplicationId())
                        .setAccount(domain.getAccount())
                        .setYpmId(domain.getYpmId())
                        .setCertDnsDomain(domain.getCertDnsDomain())
                        .setMemberExpiryDays(domain.getMemberExpiryDays())
                        .setServiceExpiryDays(domain.getServiceExpiryDays())
                        .setGroupExpiryDays(domain.getGroupExpiryDays())
                        .setTokenExpiryMins(domain.getTokenExpiryMins())
                        .setRoleCertExpiryMins(domain.getRoleCertExpiryMins())
                        .setServiceCertExpiryMins(domain.getServiceCertExpiryMins())
                        .setSignAlgorithm(domain.getSignAlgorithm())
                        .setUserAuthorityFilter(domain.getUserAuthorityFilter());

                // then we're going to apply the updated fields
                // from the given object

                if (systemAttribute != null) {
                    updateSystemMetaFields(updatedDomain, systemAttribute, deleteAllowed, meta);
                } else {
                    updateDomainMetaFields(updatedDomain, meta);
                }

                con.updateDomain(updatedDomain);
                con.commitChanges();
                cacheStore.invalidate(domainName);

                // audit log the request

                StringBuilder auditDetails = new StringBuilder(ZMSConsts.STRING_BLDR_SIZE_DEFAULT);
                auditLogDomain(auditDetails, updatedDomain);

                auditLogRequest(ctx, domainName, auditRef, caller, ZMSConsts.HTTP_PUT,
                        domainName, auditDetails.toString());

                // if the domain member expiry date has changed then we're going
                // process all the members in the domain and update the expiration
                // date accordingly

                updateDomainMembersExpiration(ctx, con, domain, updatedDomain, auditRef, caller);

                // if the domain user attribute expiry has changed we need to
                // process all the members in the domain accordingly

                updateDomainMembersUserAuthorityFilter(ctx, con, domain, updatedDomain, auditRef, caller);

                return;

            } catch (ResourceException ex) {
                if (!shouldRetryOperation(ex, retryCount)) {
                    throw ex;
                }
            }
        }
    }

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

}