class FileConnection implements ObjectStoreConnection {

    @Override
    public boolean updateRole(String domainName, Role role) {

        final String caller = "updateRole";
        DomainStruct domainStruct = getDomainStruct(domainName);
        if (domainStruct == null) {
            throw ZMSUtils.error(ResourceException.NOT_FOUND, "domain not found", caller);
        }
        if (domainStruct.getRoles() == null) {
            domainStruct.setRoles(new HashMap<>());
        }
        HashMap<String, Role> roles = domainStruct.getRoles();

        String roleName = ZMSUtils.extractRoleName(domainName, role.getName());
        if (roleName == null) {
            throw ZMSUtils.error(ResourceException.BAD_REQUEST, "invalid role name", caller);
        }
        
        // here we only need to update the main attrs and not
        // the members

        Role originalRole = getRoleObject(domainStruct, roleName);
        List<RoleMember> members = role.getRoleMembers();
        if (originalRole != null) {
            role.setRoleMembers(originalRole.getRoleMembers());
            role.setAuditEnabled(role.getAuditEnabled());
        } else {
            role.setRoleMembers(null);
        }
        role.setModified(Timestamp.fromCurrentTime());
        roles.put(roleName, role);
        putDomainStruct(domainName, domainStruct);
        role.setRoleMembers(members);
        return true;
    }

    public  FileConnection(File rootDir, File quotaDir);

}