class FileConnection implements ObjectStoreConnection {

    @Override
    public Map<String, List<DomainRoleMember>> getExpiredPendingDomainRoleMembers(int pendingRoleMemberLifespan) {

        Map<String, List<DomainRoleMember>> domainRoleMembersMap = new HashMap<>();;

        String[] fnames = getDomainList();
        for (String name : fnames) {
            DomainStruct domain = getDomainStruct(name);
            if (domain == null) {
                continue;
            }
            DomainRoleMembers domainRoleMembers = new DomainRoleMembers();
            domainRoleMembers.setDomainName(domain.getName());
            List<DomainRoleMember> domainRoleMemberList = new ArrayList<>();
            domainRoleMembers.setMembers(domainRoleMemberList);
            long now = System.currentTimeMillis();
            for (Role role : domain.getRoles().values()) {
                for (RoleMember roleMember : role.getRoleMembers()) {
                    if (roleMember.getApproved() == Boolean.FALSE &&
                            now - roleMember.getRequestTime().millis() > TimeUnit.MILLISECONDS.convert(pendingRoleMemberLifespan, TimeUnit.DAYS)) {
                        DomainRoleMember domainRoleMember = new DomainRoleMember();
                        domainRoleMember.setMemberName(roleMember.getMemberName());
                        List<MemberRole> memberRoles = new ArrayList<>();
                        MemberRole memberRole = new MemberRole();
                        memberRole.setActive(false);
                        memberRole.setRoleName(AthenzUtils.extractRoleName(role.getName()));
                        memberRole.setExpiration(roleMember.getExpiration());
                        memberRole.setRequestTime(roleMember.getRequestTime());
                        memberRole.setRequestPrincipal(roleMember.getRequestPrincipal());
                        memberRoles.add(memberRole);
                        domainRoleMember.setMemberRoles(memberRoles);
                        domainRoleMemberList.add(domainRoleMember);
                    }
                }
            }
            if (!domainRoleMemberList.isEmpty()) {
                domainRoleMembersMap.put(domain.getName(), domainRoleMemberList);
            }
        }
        return domainRoleMembersMap;
    }

    public  FileConnection(File rootDir, File quotaDir);

}