class DBService implements RolesProvider {

    public void processExpiredPendingMembers(int pendingRoleMemberLifespan, final String monitorIdentity) {

        final String auditRef = "Expired - auto reject";
        final String caller = "processExpiredPendingMembers";

        Map<String, List<DomainRoleMember>> memberList;
        try (ObjectStoreConnection con = store.getConnection(true, false)) {
            memberList = con.getExpiredPendingDomainRoleMembers(pendingRoleMemberLifespan);
        }

        // delete each member and record each expired member in audit log in a transaction

        for (String domainName : memberList.keySet()) {
            for (DomainRoleMember domainRoleMember : memberList.get(domainName)) {
                final String principalName = domainRoleMember.getMemberName();
                for (MemberRole memberRole : domainRoleMember.getMemberRoles()) {
                    try (ObjectStoreConnection con = store.getConnection(true, true)) {
                        if (con.deletePendingRoleMember(domainName, memberRole.getRoleName(),
                                principalName, monitorIdentity, auditRef)) {
                            auditLogRequest(monitorIdentity, domainName, auditRef, caller,
                                    "REJECT", memberRole.getRoleName(),
                                    "{\"member\": \"" + principalName + "\"}");
                        }
                    }
                }
            }
        }
    }

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

}