com.unboundid.scim.ldap.DerivedAttribute Maven / Gradle / Ivy
/*
* 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.ldap.sdk.Attribute;
import com.unboundid.ldap.sdk.Control;
import com.unboundid.ldap.sdk.Entry;
import com.unboundid.ldap.sdk.Filter;
import com.unboundid.ldap.sdk.SearchResultEntry;
import com.unboundid.scim.schema.AttributeDescriptor;
import com.unboundid.scim.sdk.AttributePath;
import com.unboundid.scim.sdk.Debug;
import com.unboundid.scim.sdk.InvalidResourceException;
import com.unboundid.scim.sdk.SCIMAttribute;
import com.unboundid.scim.sdk.SCIMException;
import com.unboundid.scim.sdk.SCIMFilter;
import com.unboundid.scim.sdk.SCIMObject;
import org.w3c.dom.Element;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* Attribute derivations may be used to derive the value of a read-only
* SCIM attribute from any attribute of the LDAP entry representing the SCIM
* resource and/or information from other entries anywhere in the DIT.
* Implementations may perform any number of LDAP operations through the
* {@link com.unboundid.ldap.sdk.LDAPInterface} API.
*
* This is used to implement the groups SCIM attribute in User resources when
* the directory server does not provide the isMemberOf LDAP attribute. It can
* also be used to implement the members SCIM attribute in Group resources for
* UnboundID dynamic groups.
*
* To use a custom derivation class, include a derivation element with
* the javaClass attribute inside a attribute element. For
* example:
*
*
* <attribute name="exampleAttribute">
* <description>Example Attribute</description>
* <derivation javaClass="com.example.ExampleDerivedAttr"/>
* <simpleMultiValued childName="attr"
* dataType="string"/>
* </attribute>
*
*
* This API is volatile and could change in future releases.
*/
public abstract class DerivedAttribute
{
/**
* The name of the special element that may be present inside derived
* attributes which provides a handle to a top-level LDAPSearch element.
*/
public static final String LDAP_SEARCH_REF = "LDAPSearchRef";
/**
* The map of arguments provided to this derived attribute. This maps the
* element name to its value. See getArguments() for an example.
*/
private final Map arguments = new HashMap();
/**
* Create a derived attribute from the name of a class that extends the
* {@code DerivedAttribute} abstract class.
*
* @param className The name of a class that extends
* {@code DerivedAttribute}.
* @param args The set of arguments that are configured for this
* {@code DerivedAttribute}.
*
* @return A new instance of the derived attribute class.
*/
public static DerivedAttribute create(final String className,
final List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy