class FileConnection implements ObjectStoreConnection {

    @Override
    public boolean insertRoleMember(String domainName, String roleName, RoleMember member,
            String admin, String auditRef) {

        final String caller = "insertRoleMember";
        DomainStruct domainStruct = getDomainStruct(domainName);
        if (domainStruct == null) {
            throw ZMSUtils.error(ResourceException.NOT_FOUND, "domain not found", caller);
        }
        Role role = getRoleObject(domainStruct, roleName);
        if (role == null) {
            throw ZMSUtils.error(ResourceException.NOT_FOUND, "role not found", caller);
        }
        if (!validatePrincipalDomain(member.getMemberName())) {
            throw ZMSUtils.error(ResourceException.NOT_FOUND, "principal domain not found", caller);
        }
        // make sure our existing role as the member array
        // and if it doesn't exist then create one
        if (role.getRoleMembers() == null) {
            role.setRoleMembers(new ArrayList<>());
        }
        // need to check if the member already exists
        boolean entryUpdated = false;
        for (RoleMember roleMember : role.getRoleMembers()) {
            if (roleMember.getMemberName().equals(member.getMemberName()) && roleMember.getApproved() == member.getApproved()) {
                roleMember.setExpiration(member.getExpiration());
                roleMember.setRequestPrincipal(admin);
                entryUpdated = true;
            }
        }
        if (!entryUpdated) {
            member.setRequestPrincipal(admin);
            role.getRoleMembers().add(member);
        }
        putDomainStruct(domainName, domainStruct);
        return true;
    }

    public  FileConnection(File rootDir, File quotaDir);

}