2 Building and Deploying an OUD Plug-In
The following topics explain the building and deploying an OUD Plug-In:
2.1 Before You Begin Deploying OUD Plug-in
You need to prepare your development environment such as installing OUD and JDK, before you deploy an OUD plug-in.
Complete the following tasks:
-
Install Oracle Unified Directory and create a new instance with fifty generated entries.
-
Install the Java Development Kit with the exact same version of the Java Runtime Environment running in the Oracle Unified Directory instance.
-
Create a new project for the development of your plug-in using your favorite integrated development environment (IDE), and reference the JAR file
oud-sdk.jar
that is located in install-dir/oud/lib/oud-sdk.jar
2.2 Deploying a Plug-In to an OUD Instance
The Oracle Unified Directory (OUD) plug-in API provides the means to extend existing Directory Server functionality.
Perform the following steps to deploy a plug-in to an OUD instance:
-
Create a new class that extends the class
oracle.oud.plugin.AbstractPlugin
. This class will not perform any action but will be part of the processing. For example:package oracle.oud.example; import oracle.oud.plugin.AbstractPlugin; /** * A plug-in that does not perform any action. */ public class ExamplePlugin extends AbstractPlugin { }
-
Build your plug-in project.
The content of the generated plug-in JAR file should contain the following files:
-
META-INF/MANIFEST.MF
-
oracle/oud/example/ExamplePlugin.class
-
-
To ensure that your plug-in will continue to work with subsequent releases of the OUD plug-in API, you can embed a specific versioning file in the produced JAR file. The name of the file to embed is
plugin.properties.
Make the following modifications to the
plugin.properties
file:-
To define a target version for all plug-ins contained in the JAR file, add the following:
plugin.version=14.1.2.1.0
-
To define a target version only for the
ExamplePlugin
plug-in, specify the following:plugin.ExamplePlugin.version=14.1.2.1.0
If the
plugin.properties
file is missing, then the behavior of the current implementation of the plug-in API applies. -
-
Restart the Oracle Unified Directory instance for the JAR file changes to take effect.
-
Stop the OUD instance.
-
Copy the plug-in JAR file into the
lib
directory. -
Restart OUD instance.
-
-
Modify the server configuration so that your plug-in is part of the server processing.
Use the
dsconfig
command to declare a plug-in as a workflow element in an OUD server. You must specify the following information:-
A plug-in name (
ExamplePlugin
in the example) that uniquely identifies this plug-in instance -
The name of the Java class that implements the
oracle.oud.plugin.ManagedPlugin
Java interface -
Whether the plug-in is enabled or disabled
-
The name of the workflow element that is behind the plug-in to be inserted.
A plug-in may have 0, 1, or more next workflow elements depending on the use case it implements. For example:
# dsconfig create-workflow-element \ --set enabled:true \ --set plugin-class:oracle.oud.example.ExamplePlugin \ --set next-workflow-elements:userRoot \ --type plugin \ --element-name ExamplePlugin
-
After creating the plug-in, insert a plug-in workflow element in a workflow. The plug-in workflow element should appear either as the next element of a workflow, or plug-in class as the next element of an existing workflow element. The following command changes the configuration of the workflow userRoot0
to forward LDAP requests to the previously added example plug-in:
# dsconfig set-workflow-prop \ --workflow-name userRoot0 \ --set workflow-element:ExamplePlugin
It is possible to create several instances of the same plug-in implementation as long each instance has a unique name.