LDAPADListPlugin.java revision ea1068c292e9b341af6d6b563cd8988a96be20a9
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2006-2008 Sun Microsystems, Inc.
* Portions Copyright 2013-2015 ForgeRock AS.
*/
/**
* This pre-parse plugin modifies the operation to allow an object class
* identifier to be specified in attributes lists, such as in Search requests,
* to request the return all attributes belonging to an object class as per the
* specification in RFC 4529. The "@" character is used to distinguish an
* object class identifier from an attribute descriptions.
*/
public final class LDAPADListPlugin
implements ConfigurationChangeListener<
{
/**
* Filters the set of attributes provided in a search request or pre- / post-
* read controls according to RFC 4529. More specifically, this method
* iterates through the requested attributes to see if any of them reference
* an object class, as indicated by a "@" prefix, and substitutes the object
* class reference with the attribute types contained in the object class, as
* well as any of the attribute types contained in any superior object
* classes.
*
* @param attributes
* The attribute list to be normalized.
* @return The normalized attribute list.
*/
{
boolean foundOC = false;
{
{
foundOC = true;
break;
}
}
if (foundOC)
{
{
{
{
if (logger.isTraceEnabled())
{
}
}
else
{
if (logger.isTraceEnabled())
{
}
{
}
{
}
}
}
else
{
}
}
}
return attributes;
}
// The current configuration for this plugin.
/**
* Creates a new instance of this Directory Server plugin. Every plugin must
* implement a default constructor (it is the only one that will be used to
* create plugins defined in the configuration), and every plugin constructor
* must call <CODE>super()</CODE> as its first element.
*/
public LDAPADListPlugin()
{
super();
}
/**
* {@inheritDoc}
*/
throws ConfigException
{
// The set of plugin types must contain only the pre-parse search element.
if (pluginTypes.isEmpty())
{
}
else
{
for (PluginType t : pluginTypes)
{
if (t != PluginType.PRE_PARSE_SEARCH)
{
}
}
}
// Register the appropriate supported feature with the Directory Server.
}
/**
* {@inheritDoc}
*/
public final void finalizePlugin()
{
}
/**
* {@inheritDoc}
*/
{
.getAttributes()));
}
/**
* {@inheritDoc}
*/
{
}
/**
* {@inheritDoc}
*/
public boolean isConfigurationChangeAcceptable(
{
boolean configAcceptable = true;
// Ensure that the set of plugin types contains only pre-parse search.
{
switch (pluginType)
{
case PREPARSESEARCH:
// This is acceptable.
break;
default:
configAcceptable = false;
}
}
return configAcceptable;
}
/**
* {@inheritDoc}
*/
{
return new ConfigChangeResult();
}
}