class DBService implements RolesProvider {

    boolean updateUserAuthorityExpiry(RoleMember roleMember, final String userAuthorityExpiry) {

        // if we have a service then there is no processing taking place
        // as the service is not managed by the user authority

        if (!ZMSUtils.isUserDomainPrincipal(roleMember.getMemberName(), zmsConfig.getUserDomainPrefix(),
                zmsConfig.getAddlUserCheckDomainPrefixList())) {
            return false;
        }

        Date authorityExpiry = zmsConfig.getUserAuthority().getDateAttribute(roleMember.getMemberName(), userAuthorityExpiry);

        // if we don't have a date then we'll expiry the user right away
        // otherwise we'll set the date as imposed by the user authority

        boolean expiryDateUpdated = false;
        Timestamp memberExpiry = roleMember.getExpiration();

        if (authorityExpiry == null) {

            // we'll update the expiration date to be the current time
            // if the user doesn't have one or it's expires sometime
            // in the future

            if (memberExpiry == null || memberExpiry.millis() > System.currentTimeMillis()) {
                roleMember.setExpiration(Timestamp.fromCurrentTime());
                expiryDateUpdated = true;
            }
        } else {

            // update the expiration date if it does not match to the
            // value specified by the user authority value

            if (memberExpiry == null || memberExpiry.millis() != authorityExpiry.getTime()) {
                roleMember.setExpiration(Timestamp.fromDate(authorityExpiry));
                expiryDateUpdated = true;
            }
        }
        return expiryDateUpdated;
    }

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

}