From dd9cc1977feb5e7bd98146fccea050eab7eec32c Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Tue, 26 Jan 2010 00:38:25 +0000
Subject: [PATCH] Add support for developing experimental extensions.
---
opendj-sdk/opends/extensions/arisid-privacy-control/config/arisid-privacy-control.ldif | 43 +
opendj-sdk/opends/extensions/arisid-privacy-control/lib/arisId_1.1.jar | 0
opendj-sdk/opends/extensions/arisid-privacy-control/src/org/opends/arisid/Package.xml | 32 +
opendj-sdk/opends/extensions/build.xml | 361 +++++++++++++++
opendj-sdk/opends/extensions/arisid-privacy-control/README | 48 ++
opendj-sdk/opends/extensions/example-plugin.zip | 0
opendj-sdk/opends/extensions/arisid-privacy-control/src/org/opends/arisid/ArisidPrivacyControlPluginConfiguration.xml | 48 ++
opendj-sdk/opends/extensions/arisid-privacy-control/src/org/opends/arisid/ArisIDPrivacyControl.java | 513 ++++++++++++++++++++++
opendj-sdk/opends/extensions/arisid-privacy-control/build.xml | 41 +
opendj-sdk/opends/extensions/arisid-privacy-control/src/org/opends/arisid/package-info.java | 34 +
opendj-sdk/opends/extensions/arisid-privacy-control/schema/99-arisid-privacy-control.ldif | 34 +
opendj-sdk/opends/extensions/README | 12
opendj-sdk/opends/extensions/arisid-privacy-control/src/org/opends/arisid/ArisIDPrivacyControlPlugin.java | 198 ++++++++
13 files changed, 1,364 insertions(+), 0 deletions(-)
diff --git a/opendj-sdk/opends/extensions/README b/opendj-sdk/opends/extensions/README
new file mode 100644
index 0000000..f0a5762
--- /dev/null
+++ b/opendj-sdk/opends/extensions/README
@@ -0,0 +1,12 @@
+This folder contains source code for various experimental extensions,
+which are not fit for production use. Some are not actively maintained,
+and may not even compile.
+
+To create a new experimental extension use the provided example-plugin
+as a template. Unzip it, rename the extension's directory to something
+more appropriate and configure the Ant build.xml file contained within
+as directed.
+
+Note that any I18N properties should be contained in a file called
+${extension.name}.properties.
+
diff --git a/opendj-sdk/opends/extensions/arisid-privacy-control/README b/opendj-sdk/opends/extensions/arisid-privacy-control/README
new file mode 100644
index 0000000..b59401d
--- /dev/null
+++ b/opendj-sdk/opends/extensions/arisid-privacy-control/README
@@ -0,0 +1,48 @@
+This folder contains source code for the IGF ArisID Privacy Control.
+
+ http://www.openliberty.org/wiki/index.php/ProjectAris
+
+In order to build this extension you'll need the Aris ID core libraries
+which are available here:
+
+ http://sourceforge.net/projects/arisid/files/ArisId/Release%201.1/arisId_1.1.jar/download
+
+Put the JAR file into the lib directory and build. In order to run
+OpenDS using the plugin you're probably going to need some other
+libraries (neethi?) which are loaded at runtime.
+
+Once you have the required libraries, do the following steps:
+
+ 1. In the top-level source folder for OpenDS, first build and
+ package OpenDS:
+
+ ./build.sh
+
+ 2. Next cd into this extension folder:
+
+ cd extensions/arisid-privacy-control
+
+ 3. And build the control+plugin (this requires Ant version 7 or
+ higher in your path):
+
+ ant install
+
+ 4. This will copy the following files into the parent OpenDS
+ default installation (build/package/OpenDS-2.3.0):
+
+ INSTANCE_ROOT/lib/extensions/arisid-privacy-control.jar
+ INSTANCE_ROOT/config/arisid-privacy-control.ldif
+ INSTANCE_ROOT/config/schema/99-arisid-privacy-control.ldif
+
+ 5. Add the plugin's config to the server configuration. The
+ following instruction assumes usage of the Unix 'cat'
+ command, but obviously ldapadd can be used:
+
+ cd INSTANCE_ROOT/config
+ cat arisid-privacy-control.ldif >> config.ldif
+
+ 6. Start the server and look for the log message indicating that
+ the extension is loaded:
+
+ cd INSTANCE_ROOT
+ ./bin/start-ds
diff --git a/opendj-sdk/opends/extensions/arisid-privacy-control/build.xml b/opendj-sdk/opends/extensions/arisid-privacy-control/build.xml
new file mode 100644
index 0000000..ea05169
--- /dev/null
+++ b/opendj-sdk/opends/extensions/arisid-privacy-control/build.xml
@@ -0,0 +1,41 @@
+<!--
+ ! 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
+ ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
+ ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
+ ! 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
+ ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. 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 2010 Sun Microsystems, Inc.
+ ! -->
+
+<project name="ArisID Privacy Control" basedir="." default="package">
+ <description>
+ This is the build script for the ArisID Privacy Control.
+ </description>
+
+ <!-- CONFIGURE: The name of the extension as used in file names -->
+ <property name="extension.name" value="arisid-privacy-control" />
+
+ <!-- CONFIGURE: The description of this extension - used in the Javadoc title -->
+ <property name="extension.description" value="ArisID Privacy Control" />
+
+ <!-- Use common extension targets -->
+ <import file="../build.xml" />
+</project>
diff --git a/opendj-sdk/opends/extensions/arisid-privacy-control/config/arisid-privacy-control.ldif b/opendj-sdk/opends/extensions/arisid-privacy-control/config/arisid-privacy-control.ldif
new file mode 100644
index 0000000..d1b4ca2
--- /dev/null
+++ b/opendj-sdk/opends/extensions/arisid-privacy-control/config/arisid-privacy-control.ldif
@@ -0,0 +1,43 @@
+# 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
+# trunk/opends/resource/legal-notices/OpenDS.LICENSE
+# or https://OpenDS.dev.java.net/OpenDS.LICENSE.
+# 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
+# trunk/opends/resource/legal-notices/OpenDS.LICENSE. 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 2010 Sun Microsystems, Inc.
+#
+#
+# This file contains a default configuration for the
+# ArisID Privacy Control which can be appended to config.ldif.
+dn: cn=ArisID Privacy Control Plugin,cn=Plugins,cn=config
+objectClass: top
+objectClass: ds-cfg-plugin
+objectClass: ds-cfg-arisid-privacy-control-plugin
+cn: ArisID Privacy Control Plugin
+ds-cfg-java-class: org.opends.arisid.ArisIDPrivacyControlPlugin
+ds-cfg-enabled: true
+ds-cfg-plugin-type: preOperationAdd
+ds-cfg-plugin-type: preOperationCompare
+ds-cfg-plugin-type: preOperationDelete
+ds-cfg-plugin-type: preOperationExtended
+ds-cfg-plugin-type: preOperationModify
+ds-cfg-plugin-type: preOperationModifyDN
+ds-cfg-plugin-type: preOperationSearch
+ds-cfg-invoke-for-internal-operations: true
diff --git a/opendj-sdk/opends/extensions/arisid-privacy-control/lib/arisId_1.1.jar b/opendj-sdk/opends/extensions/arisid-privacy-control/lib/arisId_1.1.jar
new file mode 100644
index 0000000..7992877
--- /dev/null
+++ b/opendj-sdk/opends/extensions/arisid-privacy-control/lib/arisId_1.1.jar
Binary files differ
diff --git a/opendj-sdk/opends/extensions/arisid-privacy-control/schema/99-arisid-privacy-control.ldif b/opendj-sdk/opends/extensions/arisid-privacy-control/schema/99-arisid-privacy-control.ldif
new file mode 100644
index 0000000..5a7147e
--- /dev/null
+++ b/opendj-sdk/opends/extensions/arisid-privacy-control/schema/99-arisid-privacy-control.ldif
@@ -0,0 +1,34 @@
+# 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
+# trunk/opends/resource/legal-notices/OpenDS.LICENSE
+# or https://OpenDS.dev.java.net/OpenDS.LICENSE.
+# 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
+# trunk/opends/resource/legal-notices/OpenDS.LICENSE. 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 2010 Sun Microsystems, Inc.
+#
+#
+# This file contains the attribute type and objectclass definitions for use
+# with the Directory Server configuration.
+dn: cn=schema
+objectClass: top
+objectClass: ldapSubentry
+objectClass: subschema
+objectClasses: ( ds-cfg-arisid-privacy-control-oid NAME 'ds-cfg-arisid-privacy-control-plugin'
+ SUP ds-cfg-plugin STRUCTURAL X-ORIGIN 'OpenDS Directory Server' )
diff --git a/opendj-sdk/opends/extensions/arisid-privacy-control/src/org/opends/arisid/ArisIDPrivacyControl.java b/opendj-sdk/opends/extensions/arisid-privacy-control/src/org/opends/arisid/ArisIDPrivacyControl.java
new file mode 100644
index 0000000..616ba0b
--- /dev/null
+++ b/opendj-sdk/opends/extensions/arisid-privacy-control/src/org/opends/arisid/ArisIDPrivacyControl.java
@@ -0,0 +1,513 @@
+/*
+ * 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
+ * trunk/opends/resource/legal-notices/OpenDS.LICENSE
+ * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
+ * 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
+ * trunk/opends/resource/legal-notices/OpenDS.LICENSE. 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 2010 Sun Microsystems, Inc.
+ */
+package org.opends.arisid;
+
+
+
+import static org.opends.server.protocols.asn1.ASN1Constants.*;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.opends.messages.Message;
+import org.opends.server.controls.ControlDecoder;
+import org.opends.server.protocols.asn1.ASN1;
+import org.opends.server.protocols.asn1.ASN1Reader;
+import org.opends.server.protocols.asn1.ASN1Writer;
+import org.opends.server.types.*;
+import org.openliberty.arisid.*;
+import org.openliberty.arisid.log.ILogger;
+import org.openliberty.arisid.log.LogHandler;
+import org.openliberty.arisid.policy.IPolicy;
+import org.openliberty.arisid.policy.PolicyHandler;
+import org.openliberty.arisid.protocol.ldap.IPrivacyControl;
+import org.w3c.dom.Element;
+
+
+
+/**
+ * IGF ArisID Privacy Control implementation.
+ */
+public class ArisIDPrivacyControl extends Control implements
+ IPrivacyControl
+{
+
+ /**
+ * ControlDecoder implentation to decode this control from a
+ * ByteString.
+ */
+ private final static class Decoder implements
+ ControlDecoder<ArisIDPrivacyControl>
+ {
+ /**
+ * Decodes and constructs a Java object representing the
+ * encodedValue.
+ * <p>
+ * ASN.1 encoded value as per Privacy Control Specifiction:
+ * http://www.openliberty.org/wiki/index.php/Profile_LDAP#
+ * Extended_PolicySequence_Variation
+ */
+ public ArisIDPrivacyControl decode(boolean isCritical,
+ ByteString value) throws DirectoryException
+ {
+ if (value == null)
+ {
+ final Message message = Message
+ .raw("Control contains no value");
+ throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
+ }
+
+ String ixnName = "";
+ String appName = "";
+ String appUri = "";
+ final HashMap<String, IPolicy> polMap = new HashMap<String, IPolicy>();
+ final ASN1Reader reader = ASN1.getReader(value);
+
+ try
+ {
+ reader.readStartSequence();
+ {
+ appName = reader.readOctetStringAsString();
+ appUri = reader.readOctetStringAsString();
+ ixnName = reader.readOctetStringAsString();
+
+ reader.readStartSequence();
+ {
+ // Get the count of policies coming
+ final long policyCount = reader.readInteger();
+ if (policyCount > 1)
+ {
+ for (int i = 0; i < policyCount; i++)
+ {
+ reader.readStartSequence();
+ {
+ final String pname = reader.readOctetStringAsString();
+ final String pStr = reader.readOctetStringAsString();
+ final Element node = phandler
+ .parseStringToElement(pStr);
+ IPolicy pol = null;
+ try
+ {
+ pol = phandler.parseDomPolicy(node);
+ }
+ catch (final Exception e)
+ {
+ logger.error("Error parsing policy: "
+ + e.getMessage(), e);
+ }
+ polMap.put(pname, pol);
+ }
+ reader.readEndSequence();
+ }
+ }
+ }
+ reader.readEndSequence();
+ }
+ reader.readEndSequence();
+ }
+ catch (final Exception e1)
+ {
+ throw new DirectoryException(ResultCode.PROTOCOL_ERROR,
+ Message.raw("Unable to decode privacy control: "
+ + e1.getMessage()), e1);
+ }
+
+ return new ArisIDPrivacyControl(isCritical, ixnName, appName,
+ appUri, polMap);
+ }
+
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getOID()
+ {
+ return IPrivacyControl.OID_IGF_CONTROL;
+ }
+ }
+
+
+
+ private static final long serialVersionUID = -2668010326604049964L;
+
+ private static final ILogger logger = LogHandler
+ .getLogger(ArisIDPrivacyControl.class);
+
+ private static PolicyHandler phandler = PolicyHandler.getInstance();
+
+ private String _ixnName = "";
+
+ private String _appName = "";
+
+ private String _appUri = "";
+
+ private ArisIdService _asvc = null;
+
+ private CarmlDoc _doc = null;
+
+ private HashMap<String, IPolicy> _polMap = new HashMap<String, IPolicy>();
+
+ /**
+ * The Control Decoder that can be used to decode this control.
+ */
+ public static final ControlDecoder<ArisIDPrivacyControl> DECODER = new Decoder();
+
+
+
+ /**
+ * Creates a new non-critical IGF Privacy Control using the provided
+ * Interaction.
+ *
+ * @param ixn
+ * The interaction.
+ * @throws IGFException
+ * If an error occurred processing the Interaction.
+ */
+ public ArisIDPrivacyControl(IInteraction ixn) throws IGFException
+ {
+ super(IPrivacyControl.OID_IGF_CONTROL, false);
+ _processCarmlDoc(ixn);
+ }
+
+
+
+ /**
+ * Creates a new IGF Privacy Control using the provided Interaction
+ * and criticality.
+ *
+ * @param ixn
+ * The interaction.
+ * @param critical
+ * The criticality.
+ * @throws IGFException
+ * If an error occurred processing the Interaction.
+ */
+ public ArisIDPrivacyControl(IInteraction ixn, boolean critical)
+ throws IGFException
+ {
+ super(IPrivacyControl.OID_IGF_CONTROL, critical);
+ _processCarmlDoc(ixn);
+ }
+
+
+
+ private ArisIDPrivacyControl(boolean isCritical, String _ixnName,
+ String _appName, String _appUri, HashMap<String, IPolicy> _polMap)
+ {
+ super(IPrivacyControl.OID_IGF_CONTROL, isCritical);
+ this._ixnName = _ixnName;
+ this._appName = _appName;
+ this._appUri = _appUri;
+ this._polMap = _polMap;
+ }
+
+
+
+ public String getAppName()
+ {
+ return this._appName;
+ }
+
+
+
+ /**
+ * @deprecated Use {@link #getCarmlURI()} instead
+ */
+ @Deprecated
+ public URI getAppURI()
+ {
+ return getCarmlURI();
+ }
+
+
+
+ /**
+ * A convenience method to obtain the CarmlDoc object referenced by
+ * this control. For performance reasons, the CarmlDoc object is not
+ * instantiated unless {@link #loadCarmlDoc(URI)} is called first.
+ *
+ * @return A CarmlDoc object containing the Controls referenced
+ * CarmlDoc or null if the document hasn't been loaded.
+ */
+ public CarmlDoc getCarmlDoc()
+ {
+
+ return this._doc;
+ }
+
+
+
+ public URI getCarmlURI()
+ {
+ try
+ {
+ return new URI(this._appUri);
+ }
+ catch (final URISyntaxException e)
+ {
+ logger
+ .warn("Invalid CARML URI syntax exception occurred for value: "
+ + this._appUri);
+ return null;
+ }
+ }
+
+
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.openliberty.arisid.protocol.ldap.IPrivacyControl#getConstraintMap
+ * ()
+ */
+ public Map<String, IPolicy> getConstraintMap()
+ {
+ return this._polMap;
+ }
+
+
+
+ /*
+ * (non-Javadoc)
+ * @seeorg.openliberty.arisid.protocol.ldap.IPrivacyControl#
+ * getDynamicConstraints (java.lang.String)
+ */
+ public IPolicy getDynamicConstraints(String nameId)
+ {
+ return this._polMap.get(nameId);
+ }
+
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public byte[] getEncodedValue()
+ {
+ try
+ {
+ final ByteStringBuilder builder = new ByteStringBuilder();
+ final ASN1Writer writer = ASN1.getWriter(builder);
+ writeValue(writer);
+ writer.close();
+ return builder.toByteArray();
+ }
+ catch (final IOException e)
+ {
+ // Should never occur.
+ throw new RuntimeException(e);
+ }
+ }
+
+
+
+ /*
+ * (non-Javadoc)
+ * @see org.openliberty.arisid.protocol.ldap.IPrivacyControl#getID()
+ */
+ public String getID()
+ {
+ return OID_IGF_CONTROL;
+ }
+
+
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.openliberty.arisid.protocol.ldap.IPrivacyControl#getInteractionName
+ * ()
+ */
+ public String getInteractionName()
+ {
+ return this._ixnName;
+ }
+
+
+
+ /**
+ * Returns the named transaction constraint.
+ *
+ * @param nameId
+ * The transaction constraint name.
+ * @return The named transaction constraint.
+ */
+ public IPolicy getTransactionConstraints(String nameId)
+ {
+ return this._polMap.get(nameId);
+ }
+
+
+
+ /**
+ * This is a convenience method intended for servers/proxies that need
+ * to instantiate a CarmlDoc object. The localUri is the URI of a
+ * local copy of the controls referenced Carml Document.
+ *
+ * @param localUri
+ * A URI to a copy of the CARML document matching the
+ * {@link #getAppName()} of this control. If localUri is
+ * null, the method will use the stored URI to load the
+ * document.
+ * @throws URISyntaxException
+ * @throws IllegalAccessException
+ * @throws IGFException
+ * @throws InstantiationException
+ * @throws AttrSvcInitializedException
+ * @throws FileNotFoundException
+ */
+ public void loadCarmlDoc(URI localUri) throws URISyntaxException,
+ FileNotFoundException, AttrSvcInitializedException,
+ InstantiationException, IGFException, IllegalAccessException
+ {
+ URI loadUri = localUri;
+ if (loadUri == null)
+ {
+ loadUri = new URI(this._appUri);
+ }
+
+ // TODO I wonder if this should come from a static hash to avoid
+ // re-parsing?
+ this._asvc = ArisIdServiceFactory.parseCarmlOnly(loadUri);
+ if (this._asvc != null)
+ {
+ this._doc = this._asvc.getCarmlDoc();
+ }
+ }
+
+
+
+ /*
+ * (non-Javadoc)
+ * @seeorg.openliberty.arisid.protocol.ldap.IPrivacyControl#
+ * setDynamicConstraints (java.util.Map)
+ */
+ public void setDynamicConstraints(
+ Map<String, IPolicy> dynamicConstraints)
+ {
+ if (dynamicConstraints != null)
+ {
+ this._polMap.putAll(dynamicConstraints);
+ }
+ }
+
+
+
+ /*
+ * (non-Javadoc)
+ * @seeorg.openliberty.arisid.protocol.ldap.IPrivacyControl#
+ * setTranasactionConstraints(java.lang.String,
+ * org.openliberty.arisid.schema.IPolicy)
+ */
+ public void setDynamicConstraints(String nameId,
+ IPolicy txnConstraints)
+ {
+ this._polMap.put(nameId, txnConstraints);
+ }
+
+
+
+ private void _processCarmlDoc(IInteraction ixn) throws IGFException
+ {
+ // set defaults of empty string
+ this._appName = "";
+ this._ixnName = "";
+ this._appUri = "";
+
+ if (ixn == null)
+ {
+ return;
+ }
+
+ final ArisIdService asvc = ixn.getAttributeService();
+ if (asvc == null)
+ {
+ return;
+ }
+
+ final CarmlDoc doc = asvc.getCarmlDoc();
+ this._appName = doc.getApplicationNameId();
+ if (this._appName == null)
+ {
+ this._appName = "";
+ }
+ this._appUri = doc.getCarmlURI().toString();
+ if (this._appUri == null)
+ {
+ this._appUri = "";
+ }
+ this._ixnName = ixn.getNameId();
+ if (this._ixnName == null)
+ {
+ this._ixnName = "";
+ }
+
+ }
+
+
+
+ /**
+ * Encode ASN.1 value. Encoding is as per spec:
+ * http://www.openliberty.org/wiki
+ * /index.php/Profile_LDAP#Extended_PolicySequence_Variation
+ */
+ protected void writeValue(ASN1Writer writer) throws IOException
+ {
+ writer.writeStartSequence(UNIVERSAL_OCTET_STRING_TYPE);
+ {
+ writer.writeOctetString(_appName);
+ writer.writeOctetString(_appUri);
+ writer.writeOctetString(_ixnName);
+ writer.writeStartSequence();
+ {
+ writer.writeInteger(_polMap.size());
+ for (final Map.Entry<String, IPolicy> entry : _polMap
+ .entrySet())
+ {
+ writer.writeStartSequence();
+ {
+ final String nameId = entry.getKey();
+ final IPolicy pol = this.getTransactionConstraints(nameId);
+ final String strPol = phandler.policyToString(pol);
+
+ writer.writeOctetString(entry.getKey());
+ writer.writeOctetString(strPol);
+ }
+ writer.writeEndSequence();
+ }
+ }
+ writer.writeEndSequence();
+ }
+ writer.writeEndSequence();
+ }
+
+}
diff --git a/opendj-sdk/opends/extensions/arisid-privacy-control/src/org/opends/arisid/ArisIDPrivacyControlPlugin.java b/opendj-sdk/opends/extensions/arisid-privacy-control/src/org/opends/arisid/ArisIDPrivacyControlPlugin.java
new file mode 100644
index 0000000..fe30b53
--- /dev/null
+++ b/opendj-sdk/opends/extensions/arisid-privacy-control/src/org/opends/arisid/ArisIDPrivacyControlPlugin.java
@@ -0,0 +1,198 @@
+/*
+ * 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
+ * trunk/opends/resource/legal-notices/OpenDS.LICENSE
+ * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
+ * 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
+ * trunk/opends/resource/legal-notices/OpenDS.LICENSE. 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 2010 Sun Microsystems, Inc.
+ */
+package org.opends.arisid;
+
+
+
+import java.util.Set;
+
+import org.opends.arisid.server.ArisidPrivacyControlPluginCfg;
+import org.opends.messages.Message;
+import org.opends.server.api.plugin.DirectoryServerPlugin;
+import org.opends.server.api.plugin.PluginResult;
+import org.opends.server.api.plugin.PluginType;
+import org.opends.server.config.ConfigException;
+import org.opends.server.loggers.ErrorLogger;
+import org.opends.server.types.CanceledOperationException;
+import org.opends.server.types.operation.*;
+
+
+
+/**
+ * IGF ArisID Privacy Control Plugin implementation.
+ */
+public final class ArisIDPrivacyControlPlugin extends
+ DirectoryServerPlugin<ArisidPrivacyControlPluginCfg>
+{
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public PluginResult.PreOperation doPreOperation(
+ PreOperationAddOperation addOperation)
+ throws CanceledOperationException
+ {
+ handleOperation(addOperation);
+ return PluginResult.PreOperation.continueOperationProcessing();
+ }
+
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public PluginResult.PreOperation doPreOperation(
+ PreOperationCompareOperation compareOperation)
+ throws CanceledOperationException
+ {
+ handleOperation(compareOperation);
+ return PluginResult.PreOperation.continueOperationProcessing();
+ }
+
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public PluginResult.PreOperation doPreOperation(
+ PreOperationDeleteOperation deleteOperation)
+ throws CanceledOperationException
+ {
+ handleOperation(deleteOperation);
+ return PluginResult.PreOperation.continueOperationProcessing();
+ }
+
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public PluginResult.PreOperation doPreOperation(
+ PreOperationExtendedOperation extendedOperation)
+ throws CanceledOperationException
+ {
+ handleOperation(extendedOperation);
+ return PluginResult.PreOperation.continueOperationProcessing();
+ }
+
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public PluginResult.PreOperation doPreOperation(
+ PreOperationModifyDNOperation modifyDNOperation)
+ throws CanceledOperationException
+ {
+ handleOperation(modifyDNOperation);
+ return PluginResult.PreOperation.continueOperationProcessing();
+ }
+
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public PluginResult.PreOperation doPreOperation(
+ PreOperationModifyOperation modifyOperation)
+ throws CanceledOperationException
+ {
+ handleOperation(modifyOperation);
+ return PluginResult.PreOperation.continueOperationProcessing();
+ }
+
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public PluginResult.PreOperation doPreOperation(
+ PreOperationSearchOperation searchOperation)
+ throws CanceledOperationException
+ {
+ handleOperation(searchOperation);
+ return PluginResult.PreOperation.continueOperationProcessing();
+ }
+
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override()
+ public void initializePlugin(Set<PluginType> pluginTypes,
+ ArisidPrivacyControlPluginCfg configuration)
+ throws ConfigException
+ {
+ // This plugin may only be used as a pre-operation plugin.
+ for (final PluginType t : pluginTypes)
+ {
+ switch (t)
+ {
+ case PRE_OPERATION_ADD:
+ case PRE_OPERATION_COMPARE:
+ case PRE_OPERATION_DELETE:
+ case PRE_OPERATION_EXTENDED:
+ case PRE_OPERATION_MODIFY:
+ case PRE_OPERATION_MODIFY_DN:
+ case PRE_OPERATION_SEARCH:
+ // This is fine.
+ break;
+ default:
+ throw new ConfigException(Message.raw("Invalid plugin type "
+ + t + " for the IGF plugin."));
+ }
+ }
+
+ }
+
+
+
+ private void handleOperation(PreOperationOperation op)
+ {
+ try
+ {
+ final ArisIDPrivacyControl control = op
+ .getRequestControl(ArisIDPrivacyControl.DECODER);
+ if (control != null)
+ {
+ ErrorLogger.logError(Message.raw(control.toString()));
+ }
+ }
+ catch (final Exception e)
+ {
+ ErrorLogger.logError(Message
+ .raw("Unable to decode the IGF privacy" + " control: " + e));
+ }
+ }
+}
diff --git a/opendj-sdk/opends/extensions/arisid-privacy-control/src/org/opends/arisid/ArisidPrivacyControlPluginConfiguration.xml b/opendj-sdk/opends/extensions/arisid-privacy-control/src/org/opends/arisid/ArisidPrivacyControlPluginConfiguration.xml
new file mode 100644
index 0000000..e6d5c92
--- /dev/null
+++ b/opendj-sdk/opends/extensions/arisid-privacy-control/src/org/opends/arisid/ArisidPrivacyControlPluginConfiguration.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ! 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
+ ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
+ ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
+ ! 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
+ ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. 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 2010 Sun Microsystems, Inc.
+ ! -->
+<adm:managed-object name="arisid-privacy-control-plugin"
+ plural-name="arisid-privacy-control-plugin"
+ package="org.opends.arisid" extends="plugin"
+ parent-package="org.opends.server.admin.std"
+ xmlns:adm="http://www.opends.org/admin"
+ xmlns:ldap="http://www.opends.org/admin-ldap">
+ <adm:synopsis>ArisID Privacy Control Plugin.</adm:synopsis>
+ <adm:profile name="ldap">
+ <ldap:object-class>
+ <ldap:name>ds-cfg-arisid-privacy-control-plugin</ldap:name>
+ <ldap:superior>ds-cfg-plugin</ldap:superior>
+ </ldap:object-class>
+ </adm:profile>
+ <adm:property-override name="java-class">
+ <adm:default-behavior>
+ <adm:defined>
+ <adm:value>org.opends.arisid.ArisIDPrivacyControlPlugin</adm:value>
+ </adm:defined>
+ </adm:default-behavior>
+ </adm:property-override>
+</adm:managed-object>
diff --git a/opendj-sdk/opends/extensions/arisid-privacy-control/src/org/opends/arisid/Package.xml b/opendj-sdk/opends/extensions/arisid-privacy-control/src/org/opends/arisid/Package.xml
new file mode 100644
index 0000000..f013bc6
--- /dev/null
+++ b/opendj-sdk/opends/extensions/arisid-privacy-control/src/org/opends/arisid/Package.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ! 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
+ ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
+ ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
+ ! 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
+ ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. 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 2010 Sun Microsystems, Inc.
+ ! -->
+<adm:package name="org.opends.arisid"
+ xmlns:adm="http://www.opends.org/admin"
+ xmlns:ldap="http://www.opends.org/admin-ldap">
+ <adm:synopsis>ArisID Privacy Control.</adm:synopsis>
+</adm:package>
diff --git a/opendj-sdk/opends/extensions/arisid-privacy-control/src/org/opends/arisid/package-info.java b/opendj-sdk/opends/extensions/arisid-privacy-control/src/org/opends/arisid/package-info.java
new file mode 100644
index 0000000..d0474ab
--- /dev/null
+++ b/opendj-sdk/opends/extensions/arisid-privacy-control/src/org/opends/arisid/package-info.java
@@ -0,0 +1,34 @@
+/*
+ * 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
+ * trunk/opends/resource/legal-notices/OpenDS.LICENSE
+ * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
+ * 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
+ * trunk/opends/resource/legal-notices/OpenDS.LICENSE. 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 2010 Sun Microsystems, Inc.
+ */
+
+/**
+ * ArisID Privacy Control implementation clases.
+ * <p>
+ * This package contains the classes which implement the
+ * ArisID Privacy Control.
+ */
+package org.opends.arisid;
diff --git a/opendj-sdk/opends/extensions/build.xml b/opendj-sdk/opends/extensions/build.xml
new file mode 100644
index 0000000..5d7e36f
--- /dev/null
+++ b/opendj-sdk/opends/extensions/build.xml
@@ -0,0 +1,361 @@
+<!--
+ ! 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
+ ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
+ ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
+ ! 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
+ ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. 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 2010 Sun Microsystems, Inc.
+ ! -->
+
+<project name="extension" basedir="." default="package">
+ <description>
+ This Ant build file contains common targets for extensions. It
+ should not be invoked directly.
+ </description>
+
+ <!-- OpenDS base directory -->
+ <dirname property="extension.basedir" file="${ant.file.extension}" />
+ <property name="base.dir" location="${extension.basedir}/.." />
+ <property name="opends.install.dir"
+ location="${base.dir}/build/package/OpenDS-2.3.0" />
+
+ <!-- Source paths relative to extension -->
+ <property name="src.dir" location="src" />
+ <property name="src.gen.dir" location="src-generated" />
+ <property name="lib.dir" location="lib" />
+ <property name="config.dir" location="config" />
+ <property name="schema.dir" location="schema" />
+
+ <!-- Build paths relative to extension -->
+ <property name="build.dir" location="build" />
+ <property name="classes.dir" location="${build.dir}/classes" />
+ <property name="javadoc.dir" location="${build.dir}/javadoc" />
+ <property name="package.dir" location="${build.dir}/package" />
+ <property name="message.dir" location="${build.dir}/message" />
+
+ <!-- Files based on extension name -->
+ <property name="jar.file" value="${extension.name}.jar" />
+ <property name="properties.file" value="${extension.name}.properties" />
+
+ <!-- Paths relative to OpenDS source tree -->
+ <property name="resource.dir" location="${base.dir}/resource" />
+ <property name="admin.dir" location="${resource.dir}/admin" />
+
+ <!-- Build class path -->
+ <path id="build.classpath">
+ <fileset dir="${lib.dir}">
+ <include name="*.jar" />
+ </fileset>
+ <pathelement path="${base.dir}/build/classes" />
+ </path>
+
+ <!-- Condition variable used for deciding if messages need generating -->
+ <available property="hasmessages" file="${properties.file}" type="file">
+ <filepath>
+ <dirset dir="${src.dir}" />
+ </filepath>
+ </available>
+
+ <!-- Clean up any files generated during the build process. -->
+ <target name="clean"
+ description="Clean up any files generated during the build process.">
+ <delete includeemptydirs="true">
+ <fileset dir="${src.gen.dir}" includes="**/*" />
+ </delete>
+ <delete includeemptydirs="true">
+ <fileset dir="${build.dir}" includes="**/*" />
+ </delete>
+ </target>
+
+ <!-- Compile the Directory Server extension source files. -->
+ <target name="compile"
+ depends="init,compileadmin,generate-messages"
+ description="Compile the Directory Server extension source files.">
+ <mkdir dir="${classes.dir}" />
+ <javac srcdir="${src.dir}:${src.gen.dir}"
+ destdir="${classes.dir}"
+ optimize="true"
+ excludes="**/package-info.java"
+ debug="on"
+ debuglevel="lines,source"
+ source="1.5"
+ target="1.5"
+ deprecation="true"
+ fork="true"
+ memoryInitialSize="${MEM}"
+ memoryMaximumSize="${MEM}">
+ <compilerarg value="-Xlint:all" />
+ <classpath refid="build.classpath" />
+ </javac>
+ </target>
+
+ <!-- Generate JavaDoc documentation from the source files. -->
+ <target name="javadoc"
+ depends="init,compile"
+ description="Generate JavaDoc documentation.">
+ <mkdir dir="${javadoc.dir}" />
+ <javadoc destdir="${javadoc.dir}"
+ source="1.5"
+ additionalparam="-quiet"
+ linksource="yes"
+ windowtitle="${extension.description} API Documentation"
+ maxmemory="${MEM}">
+ <classpath refid="build.classpath" />
+ <packageset dir="${src.dir}" />
+ <packageset dir="${src.gen.dir}" />
+ </javadoc>
+ </target>
+
+ <!-- Package the Directory Server extension for distribution. -->
+ <target name="package"
+ depends="clean,compile"
+ description="Package the Directory Server extension for distribution.">
+ <mkdir dir="${package.dir}" />
+ <jar jarfile="${package.dir}/${jar.file}"
+ basedir="${classes.dir}"
+ compress="true"
+ index="true" />
+ </target>
+
+ <!-- Install the Directory Server extension in an existing OpenDS installation. -->
+ <target name="install"
+ depends="package"
+ description="Install the Directory Server extension in an existing OpenDS installation.">
+
+ <echo message="Use the following Ant option to change the install location:" />
+ <echo message="" />
+ <echo message=" -Dopends.install.dir=path" />
+ <echo message=" The path of an OpenDS installation where the extension will be installed." />
+ <echo message=" Used by the install target [default: ${opends.install.dir}]." />
+ <echo message="" />
+
+ <mkdir dir="${opends.install.dir}/lib" />
+ <copy todir="${opends.install.dir}/lib">
+ <fileset file="${lib.dir}/*.jar" />
+ </copy>
+ <mkdir dir="${opends.install.dir}/lib/extensions" />
+ <copy todir="${opends.install.dir}/lib/extensions">
+ <fileset file="${package.dir}/*.jar" />
+ </copy>
+ <copy todir="${opends.install.dir}/config">
+ <fileset file="${config.dir}/*.ldif" />
+ </copy>
+ <copy todir="${opends.install.dir}/config/schema">
+ <fileset file="${schema.dir}/*.ldif" />
+ </copy>
+ </target>
+
+ <!-- Perform common initialization common to several targets. -->
+ <target name="init">
+ <tstamp>
+ <format property="timestamp" pattern="yyyyMMddHHmmss" />
+ </tstamp>
+ <condition property="DEBUG_BUILD" value="false">
+ <not>
+ <isset property="DEBUG_BUILD" />
+ </not>
+ </condition>
+ <condition property="MEM" value="128M">
+ <not>
+ <isset property="MEM" />
+ </not>
+ </condition>
+ </target>
+
+ <!-- Compile the Directory Server extension configuration definition files. -->
+ <target name="compileadmin" depends="validateadmin">
+ <!-- Copy XML definitions for this extension and core server into the same location -->
+ <tempfile property="admin.temp.dir" destDir="${classes.dir}" />
+ <mkdir dir="${admin.temp.dir}" />
+
+ <copy todir="${admin.temp.dir}">
+ <fileset dir="${src.dir}" includes="**/*.xml" />
+ <fileset dir="${base.dir}/src/admin/defn" includes="**/*.xml" />
+ </copy>
+
+ <!-- Compile the Directory Server extension configuration meta classes. -->
+ <xslt basedir="${admin.temp.dir}"
+ destdir="${src.gen.dir}"
+ style="${admin.dir}/metaMO.xsl">
+ <include name="**/*Configuration.xml" />
+ <exclude name="org/opends/server/admin/std/*.xml" />
+ <regexpmapper handledirsep="true"
+ from="^(.*)/([^/]+)Configuration\.xml$$"
+ to="\1/meta/\2CfgDefn.java" />
+ <param name="base-dir" expression="${admin.temp.dir}" />
+ </xslt>
+
+ <xslt basedir="${admin.temp.dir}"
+ destdir="${src.gen.dir}"
+ style="${admin.dir}/package-info.xsl">
+ <include name="**/Package.xml" />
+ <exclude name="org/opends/server/admin/std/*.xml" />
+ <regexpmapper handledirsep="true"
+ from="^(.*)/([^/]+)\.xml$$"
+ to="\1/meta/package-info.java" />
+ <param name="type" expression="meta" />
+ </xslt>
+
+ <!-- Compile the Directory Server extension configuration client classes. -->
+ <xslt basedir="${admin.temp.dir}"
+ destdir="${src.gen.dir}"
+ style="${admin.dir}/clientMO.xsl">
+ <include name="**/*Configuration.xml" />
+ <exclude name="org/opends/server/admin/std/*.xml" />
+ <regexpmapper handledirsep="true"
+ from="^(.*)/([^/]+)Configuration\.xml$$"
+ to="\1/client/\2CfgClient.java" />
+ <param name="base-dir" expression="${admin.temp.dir}" />
+ </xslt>
+
+ <xslt basedir="${admin.temp.dir}"
+ destdir="${src.gen.dir}"
+ style="${admin.dir}/package-info.xsl">
+ <include name="**/Package.xml" />
+ <exclude name="org/opends/server/admin/std/*.xml" />
+ <regexpmapper handledirsep="true"
+ from="^(.*)/([^/]+)\.xml$$"
+ to="\1/client/package-info.java" />
+ <param name="type" expression="client" />
+ </xslt>
+
+ <!-- Compile the Directory Server extension configuration server classes. -->
+ <xslt basedir="${admin.temp.dir}"
+ destdir="${src.gen.dir}"
+ style="${admin.dir}/serverMO.xsl">
+ <include name="**/*Configuration.xml" />
+ <exclude name="org/opends/server/admin/std/*.xml" />
+ <regexpmapper handledirsep="true"
+ from="^(.*)/([^/]+)Configuration\.xml$$"
+ to="\1/server/\2Cfg.java" />
+ <param name="base-dir" expression="${admin.temp.dir}" />
+ </xslt>
+
+ <xslt basedir="${admin.temp.dir}"
+ destdir="${src.gen.dir}"
+ style="${admin.dir}/package-info.xsl">
+ <include name="**/Package.xml" />
+ <exclude name="org/opends/server/admin/std/*.xml" />
+ <regexpmapper handledirsep="true"
+ from="^(.*)/([^/]+)\.xml$$"
+ to="\1/server/package-info.java" />
+ <param name="type" expression="server" />
+ </xslt>
+
+ <!-- Compile the Directory Server extension configuration ldap profile property files. -->
+ <xslt basedir="${admin.temp.dir}"
+ destdir="${classes.dir}/admin/profiles/ldap"
+ style="${admin.dir}/ldapMOProfile.xsl">
+ <include name="**/*Configuration.xml" />
+ <exclude name="org/opends/server/admin/std/*.xml" />
+ <regexpmapper handledirsep="true"
+ from="^(.*)/([^/]+)Configuration\.xml$$"
+ to="\1/meta/\2CfgDefn.properties" />
+ <param name="base-dir" expression="${admin.temp.dir}" />
+ </xslt>
+
+ <!-- Compile the Directory Server extension configuration cli profile property files. -->
+ <xslt basedir="${admin.temp.dir}"
+ destdir="${classes.dir}/admin/profiles/cli"
+ style="${admin.dir}/cliMOProfile.xsl">
+ <include name="**/*Configuration.xml" />
+ <exclude name="org/opends/server/admin/std/*.xml" />
+ <regexpmapper handledirsep="true"
+ from="^(.*)/([^/]+)Configuration\.xml$$"
+ to="\1/meta/\2CfgDefn.properties" />
+ <param name="base-dir" expression="${admin.temp.dir}" />
+ </xslt>
+
+ <!-- Compile the Directory Server extension configuration I18N message files. -->
+ <xslt basedir="${admin.temp.dir}"
+ destdir="${classes.dir}/admin/messages"
+ style="${admin.dir}/messagesMO.xsl">
+ <include name="**/*Configuration.xml" />
+ <exclude name="org/opends/server/admin/std/*.xml" />
+ <regexpmapper handledirsep="true"
+ from="^(.*)/([^/]+)Configuration\.xml$$"
+ to="\1/meta/\2CfgDefn.properties" />
+ <param name="base-dir" expression="${admin.temp.dir}" />
+ </xslt>
+
+ <!-- Compile the Directory Server extension configuration manifest file. -->
+ <xslt basedir="${admin.temp.dir}"
+ destdir="${admin.temp.dir}"
+ extension=".manifest"
+ style="${admin.dir}/manifestMO.xsl">
+ <include name="**/*Configuration.xml" />
+ <exclude name="org/opends/server/admin/std/*.xml" />
+ </xslt>
+ <concat destfile="${classes.dir}/admin/extension.manifest">
+ <fileset dir="${admin.temp.dir}" includes="**/*.manifest" />
+ </concat>
+
+ <!-- Clean up -->
+ <delete dir="${admin.temp.dir}" />
+ </target>
+
+ <!-- Validate the Directory Server extension configuration definitions. -->
+ <target name="validateadmin">
+ <schemavalidate>
+ <fileset dir="${src.dir}" includes="**/*.xml" />
+ <schema namespace="http://www.opends.org/admin"
+ file="${admin.dir}/admin.xsd" />
+ <schema namespace="http://www.opends.org/admin-ldap"
+ file="${admin.dir}/admin-ldap.xsd" />
+ <schema namespace="http://www.opends.org/admin-cli"
+ file="${admin.dir}/admin-cli.xsd" />
+ </schemavalidate>
+ </target>
+
+ <!-- Generate messages from messages.properties file
+ located in the message directory and declared in a package
+ -->
+ <target name="generate-messages" if="hasmessages">
+ <typedef name="genmsg"
+ classname="org.opends.build.tools.GenerateMessageFile">
+ <classpath>
+ <fileset dir="${base.dir}/build/build-tools">
+ <include name="*.jar" />
+ </fileset>
+ </classpath>
+ </typedef>
+
+ <path id="messages.src.path">
+ <fileset dir="${src.dir}">
+ <include name="**/${properties.file}" />
+ </fileset>
+ </path>
+ <property name="messages.src.file" refid="messages.src.path" />
+
+ <pathconvert property="messages.dst.file" refid="messages.src.path">
+ <map from="${src.dir}" to="${src.gen.dir}" />
+ </pathconvert>
+ <dirname property="messages.dst.dir" file="${messages.dst.file}" />
+
+
+ <!-- Needed by genmsg task -->
+ <property name="msg.dir" location="${src.dir}" />
+ <property name="msg.javagen.dir" location="${src.gen.dir}" />
+
+ <genmsg sourceProps="${messages.src.file}" />
+ <copy file="${messages.src.file}" todir="${classes.dir}/messages" />
+ </target>
+</project>
diff --git a/opendj-sdk/opends/extensions/example-plugin.zip b/opendj-sdk/opends/extensions/example-plugin.zip
new file mode 100644
index 0000000..4e63ed7
--- /dev/null
+++ b/opendj-sdk/opends/extensions/example-plugin.zip
Binary files differ
--
Gitblit v1.10.0