|
Oracle® Fusion Middleware Java API Reference for Oracle Unified Directory 11g Release 2 (11.1.2.2.0) E38583-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.oud.plugin.AbstractPlugin
public abstract class AbstractPlugin
This class is a default implementation of a plugin that forwards all requests to the next plugin relative to this one.
Implementations of plugins should derive from this class to guarantee backward compatibility.
In case of plugins that are not leaf plugins, only the requests that need to be handled must be overridden .
In case of leaf plugins all request handlers must be overridden. Indeed this implementation would throw NullPointerException
when attempting to retrieve the next plugin relative to this one from the configuration.
Constructor Summary | |
---|---|
protected |
AbstractPlugin() Instantiates a new instance of this class. |
Method Summary | ||
---|---|---|
void |
finalizePlugin() This method is called when this plugin is stopped. |
|
PluginConfiguration |
getConfiguration() Returns the raw configuration of this plugin. |
|
|
getConfiguration(java.lang.Class<T> configurationInterface) Returns an instance of the provided configuration interface that attempts to provide a parsed view of the raw configuration. |
|
java.lang.String |
getName() Returns the name of this plugin. |
|
PluginContext |
getPluginContext() Returns the context of this plugin once initialized. |
|
java.lang.String |
getVersion() Returns the version of the plugin Api expected by this plugin. |
|
void |
handleAdd(RequestContext requestContext, AddRequest request, ResultHandler resultHandler) Invoked when an add request is received from a client. |
|
void |
handleBind(RequestContext requestContext, int version, BindRequest request, ResultHandler resultHandler) Invoked when a bind request is received from a client. |
|
void |
handleCompare(RequestContext requestContext, CompareRequest request, ResultHandler resultHandler) Invoked when a compare request is received from a client. |
|
void |
handleConfigurationChange(PluginConfiguration configuration) This method is called each time the configuration of this plugin is changed. |
|
void |
handleDelete(RequestContext requestContext, DeleteRequest request, ResultHandler resultHandler) Invoked when a delete request is received from a client. |
|
|
handleExtended(RequestContext requestContext, ExtendedRequest<R> request, ResultHandler resultHandler) Invoked when an extended request is received from a client. |
|
void |
handleModify(RequestContext requestContext, ModifyRequest request, ResultHandler resultHandler) Invoked when a modify request is received from a client. |
|
void |
handleModifyDN(RequestContext requestContext, ModifyDNRequest request, ResultHandler resultHandler) Invoked when a modify DN request is received from a client. |
|
void |
handleSearch(RequestContext requestContext, SearchRequest request, SearchResultHandler resultHandler) Invoked when a search request is received from a client. |
|
void |
initializePlugin(PluginConfiguration configuration, PluginContext context) This method is called when this plugin is initialized. |
|
void |
setConfiguration(PluginConfiguration configuration) Sets the configuration of this plugin. |
|
void |
setContext(PluginContext context) Sets the context of this plugin. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AbstractPlugin()
Method Detail |
---|
public void initializePlugin(PluginConfiguration configuration, PluginContext context) throws PluginException
This method returns immediately by default and should be overridden if checks must be performed at startup.
The provided configuration is available through the getConfiguration()
after this call has returned.
initializePlugin
in interface ManagedPlugin
configuration
- the configuration of this plugin.context
- the context of this pluginPluginException
- when the plugin failed to initialize successfully.public void finalizePlugin()
This method returns immediately by default and should be overridden if cleanup is required at shutdown.
finalizePlugin
in interface ManagedPlugin
public void handleConfigurationChange(PluginConfiguration configuration) throws PluginException
The configuration available through the getConfiguration()
is updated after this call has returned.
handleConfigurationChange
in interface ManagedPlugin
configuration
- the configuration of this plugin.PluginException
- if the new configuration can not be applied.public final PluginContext getPluginContext()
null
is returned if this plugin is not yet initialized.null
.public final void setContext(PluginContext context)
context
- the new context of this plugin.public final PluginConfiguration getConfiguration()
null
is returned if this plugin was not yet initialized.null
.public final void setConfiguration(PluginConfiguration configuration)
configuration
- the new configuration of this plugin.public <T extends PluginConfiguration> T getConfiguration(java.lang.Class<T> configurationInterface)
The relations to the raw configuration properties are determined by reflection on the provided Java interface.
The rules are the following - the provided interface must extend the PluginConfiguration and define getters in the forms '<type> getX()' or 'boolean isY()' - the returned values are constructed from type defined in the provided configuration interface by calling thevalueOf(String)
method (eg. String.valueOf(String)) - String getX() attempts to parse the value of the raw configuration property defined by x=value using the String.valueOf(String) method - if a property is multivalued then the returned type of the method defined in the provided configuration interface must be of type java.util.Collection
and the type contained type contained in that collection must be defined using the annotation ConfigurationProperty
(String is the default type).
Beware that parsing the raw configuration can throw undeclared exceptions.
T
- the type of the configuration interface that attempts to provide the parsed configuration.configurationInterface
- the interface that defines the types and the names of the parsed configuration properties.public java.lang.String getName()
Plugin
getName
in interface Plugin
public java.lang.String getVersion()
ManagedPlugin
This method attempts to read the file named "plugin.properties" embedded in the jar file that contained this plugin class and located at the root. If that file exists, the value associated to the key plugin.<plugin-name>.version
is returned if that key exists.
Otherwise, the value associated to the key plugin.version
is returned.
If the properties file could not be read or if none of the keys described above is found then null
is returned.
If null
is returned, this means that this plugin does not expect a particular behavior of the plugin Api.
In case this plugin expects a particular behavior of the plugin Api, the version of the server at time this plugin was built must be returned.
The version of the server is returned by the command 'start-ds -V'
.
The plugin Api was released in version "11.1.2.1.0".
getVersion
in interface ManagedPlugin
public void handleAdd(RequestContext requestContext, AddRequest request, ResultHandler resultHandler) throws java.lang.UnsupportedOperationException
RequestManager
handleAdd
in interface RequestManager
requestContext
- The request context.request
- The add request.resultHandler
- The handler which should be used to send back the result to the client.java.lang.UnsupportedOperationException
- If this request handler does not handle add requests.public void handleBind(RequestContext requestContext, int version, BindRequest request, ResultHandler resultHandler) throws java.lang.UnsupportedOperationException
RequestManager
handleBind
in interface RequestManager
requestContext
- The request context.version
- The protocol version included with the bind request.request
- The bind request.resultHandler
- The handler which should be used to send back the result to the client.java.lang.UnsupportedOperationException
- If this request handler does not handle bind requests.public void handleCompare(RequestContext requestContext, CompareRequest request, ResultHandler resultHandler) throws java.lang.UnsupportedOperationException
RequestManager
handleCompare
in interface RequestManager
requestContext
- The request context.request
- The compare request.resultHandler
- The handler which should be used to send back the result to the client.java.lang.UnsupportedOperationException
- If this request handler does not handle compare requests.public void handleDelete(RequestContext requestContext, DeleteRequest request, ResultHandler resultHandler) throws java.lang.UnsupportedOperationException
RequestManager
handleDelete
in interface RequestManager
requestContext
- The request context.request
- The delete request.resultHandler
- The handler which should be used to send back the result to the client.java.lang.UnsupportedOperationException
- If this request handler does not handle delete requests.public <R extends ExtendedResult> void handleExtended(RequestContext requestContext, ExtendedRequest<R> request, ResultHandler resultHandler) throws java.lang.UnsupportedOperationException
RequestManager
handleExtended
in interface RequestManager
R
- The type of result returned by the extended request.requestContext
- The request context.request
- The extended request.resultHandler
- The handler which should be used to send back the result to the client.java.lang.UnsupportedOperationException
- If this request handler does not handle extended requests.public void handleModify(RequestContext requestContext, ModifyRequest request, ResultHandler resultHandler) throws java.lang.UnsupportedOperationException
RequestManager
handleModify
in interface RequestManager
requestContext
- The request context.request
- The modify request.resultHandler
- The handler which should be used to send back the result to the client.java.lang.UnsupportedOperationException
- If this request handler does not handle modify requests.public void handleModifyDN(RequestContext requestContext, ModifyDNRequest request, ResultHandler resultHandler) throws java.lang.UnsupportedOperationException
RequestManager
handleModifyDN
in interface RequestManager
requestContext
- The request context.request
- The modify DN request.resultHandler
- The handler which should be used to send back the result to the client.java.lang.UnsupportedOperationException
- If this request handler does not handle modify DN requests.public void handleSearch(RequestContext requestContext, SearchRequest request, SearchResultHandler resultHandler) throws java.lang.UnsupportedOperationException
RequestManager
handleSearch
in interface RequestManager
requestContext
- The request context.request
- The search request.resultHandler
- The handler which should be used to send back the search results to the client.java.lang.UnsupportedOperationException
- If this request handler does not handle search requests.
|
Oracle® Fusion Middleware Java API Reference for Oracle Unified Directory 11g Release 2 (11.1.2.2.0) E38583-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |