UpdatePreOpPlugin.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 2014-2015 ForgeRock AS
*/
/**
* This class defines a pre-operation plugin that can be used in add and modify
* operations to make changes to the target operation during pre-op plugin
* processing. For add operations, it can add objectclasses, remove
* objectclasses, replace attributes, or remove attributes. For modify
* operations, it can add modifications.
*/
public class UpdatePreOpPlugin
extends DirectoryServerPlugin<PluginCfg>
{
/**
* The singleton instance of this test password validator.
*/
// The set of attributes to set in the next add operation.
// The set of attribute types for attributes to remove from the next add
// operation.
// The set of objectclasses to add to the next add operation.
// The set of objectclasses to remove from the next add operation.
// The set of modifications to add to the next modify operation.
/**
* 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 UpdatePreOpPlugin()
{
super();
}
/**
* {@inheritDoc}
*/
throws ConfigException
{
// This plugin may only be used as a pre-operation plugin.
for (PluginType t : pluginTypes)
{
switch (t)
{
case PRE_OPERATION_ADD:
case PRE_OPERATION_MODIFY:
// This is fine.
break;
default:
" for update pre-op plugin."));
}
}
// We assume that there is only one of these active at a time.
instance = this;
}
/**
* {@inheritDoc}
*/
public PluginResult.PreOperation
{
for (AttributeType t : removeAttributes)
{
}
for (Attribute a : setAttributes)
{
}
{
}
{
}
}
/**
* {@inheritDoc}
*/
public PluginResult.PreOperation
{
for (Modification m : modifications)
{
try
{
}
catch (DirectoryException de)
{
}
}
}
/**
* Clears all of the updates currently in place.
*/
public static void reset()
{
}
/**
* Adds the provided attribute to the set of attributes that will be set in
* the next add operation.
*
* @param attribute The attribute to be set in the next add operation.
*/
{
}
/**
* Adds the provided attribute type to the set of attributes that will be
* removed from the next add operation.
*
* @param attributeType The attribute type to be removed in the next add
* operation.
*/
{
}
/**
* Adds the provided objectclass to the set of objectclasses that will be
* added to the next add operation.
*
* @param objectClass The objectclass to be added.
*/
{
}
/**
* Adds the provided objectclass to the set of objectclasses that will be
* removed from the next add operation.
*
* @param objectClass The objectclass to be added.
*/
{
}
/**
* Adds the provided modification so that it will be included in the next
* modify operation.
*
* @param modification The modification to be added.
*/
{
}
}