class DBService implements RolesProvider {

    public void executePutRoleSystemMeta(ResourceContext ctx, final String domainName, final String roleName,
           RoleSystemMeta meta, final String attribute, final String auditRef, final 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_ROLE);

                if (domain.getAuditEnabled() != Boolean.TRUE) {
                    throw ZMSUtils.requestError(caller + ": auditEnabled flag not set for domain: " + domainName + " to add it on the role: " + roleName, caller);
                }

                Role originalRole = getRole(con, domainName, roleName, false, false, false);

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

                Role updatedRole = new Role()
                        .setName(originalRole.getName())
                        .setAuditEnabled(originalRole.getAuditEnabled())
                        .setTrust(originalRole.getTrust())
                        .setSelfServe(originalRole.getSelfServe())
                        .setMemberExpiryDays(originalRole.getMemberExpiryDays())
                        .setServiceExpiryDays(originalRole.getServiceExpiryDays())
                        .setGroupExpiryDays(originalRole.getGroupExpiryDays())
                        .setTokenExpiryMins(originalRole.getTokenExpiryMins())
                        .setCertExpiryMins(originalRole.getCertExpiryMins())
                        .setMemberReviewDays(originalRole.getMemberReviewDays())
                        .setServiceReviewDays(originalRole.getServiceReviewDays())
                        .setSignAlgorithm(originalRole.getSignAlgorithm())
                        .setReviewEnabled(originalRole.getReviewEnabled())
                        .setNotifyRoles(originalRole.getNotifyRoles());

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

                updateRoleSystemMetaFields(con, updatedRole, originalRole, attribute, meta, ctx.getApiName());

                con.updateRole(domainName, updatedRole);
                saveChanges(con, domainName);

                // audit log the request

                StringBuilder auditDetails = new StringBuilder(ZMSConsts.STRING_BLDR_SIZE_DEFAULT);
                auditLogRoleSystemMeta(auditDetails, updatedRole, roleName);

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

                return;

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

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

}