class DBService implements RolesProvider {

    boolean processGroup(ObjectStoreConnection con, Group originalGroup, final String domainName,
                        final String groupName, Group group, final String admin, final String auditRef,
                        StringBuilder auditDetails) {

        // check to see if we need to insert the group or update it

        boolean requestSuccess;
        if (originalGroup == null) {
            // auditEnabled can only be set with system admin privileges
            group.setAuditEnabled(false);
            requestSuccess = con.insertGroup(domainName, group);
        } else {
            // carrying over auditEnabled from original group
            group.setAuditEnabled(originalGroup.getAuditEnabled());
            requestSuccess = con.updateGroup(domainName, group);
        }

        // if we didn't update any groups then we need to return failure

        if (!requestSuccess) {
            return false;
        }

        // open our audit record and log our trust field if one is available

        auditDetails.append("{\"name\": \"").append(groupName).append('\"');

        // now we need process our groups members depending this is
        // a new insert operation or an update

        List<GroupMember> groupMembers = group.getGroupMembers();

        if (originalGroup == null) {

            // we are just going to process all members as new inserts

            for (GroupMember member : groupMembers) {
                if (!con.insertGroupMember(domainName, groupName, member, admin, auditRef)) {
                    return false;
                }
            }
            auditLogGroupMembers(auditDetails, "added-members", groupMembers);

        } else {

            if (!processUpdateGroupMembers(con, originalGroup, groupMembers, domainName, groupName,
                    admin, auditRef, auditDetails)) {
                return false;
            }
        }

        auditDetails.append('}');
        return true;
    }

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

}