Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright 2011-2019 Ping Identity Corporation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License (GPLv2 only)
* or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see .
*/
package com.unboundid.scim.ldap;
import com.unboundid.asn1.ASN1OctetString;
import com.unboundid.ldap.sdk.Attribute;
import com.unboundid.ldap.sdk.DN;
import com.unboundid.ldap.sdk.Entry;
import com.unboundid.ldap.sdk.Filter;
import com.unboundid.ldap.sdk.LDAPException;
import com.unboundid.ldap.sdk.LDAPURL;
import com.unboundid.ldap.sdk.SearchRequest;
import com.unboundid.ldap.sdk.SearchResult;
import com.unboundid.ldap.sdk.SearchResultEntry;
import com.unboundid.ldap.sdk.SearchScope;
import com.unboundid.scim.schema.AttributeDescriptor;
import com.unboundid.scim.sdk.AttributePath;
import com.unboundid.scim.sdk.Debug;
import com.unboundid.scim.sdk.DebugType;
import com.unboundid.scim.sdk.InvalidResourceException;
import com.unboundid.scim.sdk.ResourceNotFoundException;
import com.unboundid.scim.sdk.SCIMAttribute;
import com.unboundid.scim.sdk.SCIMAttributeValue;
import com.unboundid.scim.sdk.SCIMException;
import com.unboundid.scim.sdk.SCIMFilter;
import com.unboundid.scim.sdk.SCIMFilterType;
import com.unboundid.scim.sdk.SCIMObject;
import com.unboundid.util.StaticUtils;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.logging.Level;
/**
* This class provides a derived attribute implementation for the groups
* attribute in User resources, which may be used when the directory server
* does not provide the isMemberOf LDAP attribute. The groups are derived by
* searching the DIT for static group entries whose members include the DN
* of the User entry.
*
* The <derivation> element for this derived attribute accepts a special
* child element, <LDAPSearchRef idref="exampleSearchParams"/>, which
* specifies the LDAP search parameters to use when searching for Group entries.
*/
public class GroupsDerivedAttribute extends DerivedAttribute
{
/**
* The name of the argument that indicates whether the backend DS provides
* the isMemberOf attribute.
*/
private static final String HAVE_ISMEMBEROF = "haveIsMemberOf";
/**
* The name of the argument that indicates whether the backend DS provides
* the isDirectMemberOf attribute.
*/
private static final String HAVE_ISDIRECTMEMBEROF = "haveIsDirectMemberOf";
/**
* The name of the argument that indicates whether to cache group data
* during an HTTP request, and how much data to cache. Values less than one
* will prevent group caching.
*/
private static final String MAX_GROUPS_CACHED = "maxGroupsCached";
/**
* The name of the LDAP cn attribute.
*/
private static final String ATTR_CN = "cn";
/**
* The name of the LDAP objectClass attribute.
*/
private static final String ATTR_OBJECT_CLASS = "objectClass";
/**
* The name of the LDAP isMemberOf attribute.
*/
private static final String ATTR_IS_MEMBER_OF = "isMemberOf";
/**
* The name of the LDAP isDirectMemberOf attribute.
*/
private static final String ATTR_IS_DIRECT_MEMBER_OF = "isDirectMemberOf";
/**
* The name of the LDAP member attribute.
*/
private static final String ATTR_MEMBER = "member";
/**
* The name of the LDAP memberURL attribute.
*/
private static final String ATTR_MEMBER_URL = "memberURL";
/**
* The name of the LDAP uniqueMember attribute.
*/
private static final String ATTR_UNIQUE_MEMBER = "uniqueMember";
/**
* The name of the groupOfURLs object class.
*/
private static final String OC_GROUP_OF_URLS = "groupOfURLs";
/**
* The name of the ds-virtual-static-group object class.
*/
private static final String OC_VIRTUAL_STATIC_GROUP =
"ds-virtual-static-group";
/**
* The "direct" canonical value for the type sub-attribute.
*/
private static final String DIRECT_GROUP = "direct";
/**
* The "indirect" canonical value for the type sub-attribute.
*/
private static final String INDIRECT_GROUP = "indirect";
/**
* The set of LDAP attribute types needed in the entry representing the
* resource.
*/
private static final Set LDAP_ATTR_TYPES;
static
{
HashSet attrTypes = new HashSet();
attrTypes.add(ATTR_IS_MEMBER_OF);
attrTypes.add(ATTR_IS_DIRECT_MEMBER_OF);
LDAP_ATTR_TYPES = Collections.unmodifiableSet(attrTypes);
}
/**
* The per-request group caches.
*/
private static final ThreadLocal