@Extensible @DirectoryProxyServerExtension(appliesToLocalContent=false, appliesToRemoteContent=true) @ThreadSafety(level=INTERFACE_THREADSAFE) public abstract class ProxyTransformation extends java.lang.Object implements UnboundIDExtension, Reconfigurable<ProxyTransformationConfig>, ExampleUsageProvider
dsconfig create-proxy-transformation \ --transformation-name "{transformation-name}" \ --type third-party \ --set enabled:true \ --set "extension-class:{class-name}" \ --set "extension-argument:{name=value}"where "{transformation-name}" is the name to use for the proxy transformation instance, "{class-name}" is the fully-qualified name of the Java class that extends
com.unboundid.directory.sdk.proxy.api.ProxyTransformation
, and
"{name=value}" represents name-value pairs for any arguments to
provide to the proxy transformation. If multiple arguments should be
provided to the proxy transformation, then the
"--set extension-argument:{name=value}
" option should be
provided multiple times.ScriptedProxyTransformation
Constructor and Description |
---|
ProxyTransformation()
Creates a new instance of this proxy transformation.
|
Modifier and Type | Method and Description |
---|---|
ResultCode |
applyConfiguration(ProxyTransformationConfig config,
ArgumentParser parser,
java.util.List<java.lang.String> adminActionsRequired,
java.util.List<java.lang.String> messages)
Attempts to apply the configuration from the provided argument parser to
this extension.
|
void |
defineConfigArguments(ArgumentParser parser)
Updates the provided argument parser to define any configuration arguments
which may be used by this extension.
|
void |
finalizeProxyTransformation()
Performs any cleanup which may be necessary when this proxy transformation
is to be taken out of service.
|
java.util.Map<java.util.List<java.lang.String>,java.lang.String> |
getExamplesArgumentSets()
Retrieves a map containing examples of configurations that may be used for
this extension.
|
abstract java.lang.String[] |
getExtensionDescription()
Retrieves a human-readable description for this extension.
|
abstract java.lang.String |
getExtensionName()
Retrieves a human-readable name for this extension.
|
void |
initializeProxyTransformation(ProxyServerContext serverContext,
ProxyTransformationConfig config,
ArgumentParser parser)
Initializes this proxy transformation.
|
boolean |
isConfigurationAcceptable(ProxyTransformationConfig config,
ArgumentParser parser,
java.util.List<java.lang.String> unacceptableReasons)
Indicates whether the configuration represented by the provided argument
parser is acceptable for use by this extension.
|
java.lang.String |
toString()
Retrieves a string representation of this proxy transformation.
|
abstract void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of this proxy transformation to the
provided buffer.
|
AddRequest |
transformAddRequest(ProxyOperationContext operationContext,
AddRequest addRequest)
Applies any necessary transformation to the provided add request.
|
LDAPResult |
transformAddResult(ProxyOperationContext operationContext,
ReadOnlyAddRequest addRequest,
LDAPResult addResult)
Applies any necessary transformation to the provided add result.
|
BindRequest |
transformBindRequest(ProxyOperationContext operationContext,
BindRequest bindRequest)
Applies any necessary transformation to the provided bind request.
|
BindResult |
transformBindResult(ProxyOperationContext operationContext,
BindRequest bindRequest,
BindResult bindResult)
Applies any necessary transformation to the provided bind request.
|
CompareRequest |
transformCompareRequest(ProxyOperationContext operationContext,
CompareRequest compareRequest)
Applies any necessary transformation to the provided compare request.
|
LDAPResult |
transformCompareResult(ProxyOperationContext operationContext,
ReadOnlyCompareRequest compareRequest,
LDAPResult compareResult)
Applies any necessary transformation to the provided compare result.
|
DeleteRequest |
transformDeleteRequest(ProxyOperationContext operationContext,
DeleteRequest deleteRequest)
Applies any necessary transformation to the provided delete request.
|
LDAPResult |
transformDeleteResult(ProxyOperationContext operationContext,
ReadOnlyDeleteRequest deleteRequest,
LDAPResult deleteResult)
Applies any necessary transformation to the provided delete result.
|
ModifyDNRequest |
transformModifyDNRequest(ProxyOperationContext operationContext,
ModifyDNRequest modifyDNRequest)
Applies any necessary transformation to the provided modify DN request.
|
LDAPResult |
transformModifyDNResult(ProxyOperationContext operationContext,
ReadOnlyModifyDNRequest modifyDNRequest,
LDAPResult modifyDNResult)
Applies any necessary transformation to the provided modify DN result.
|
ModifyRequest |
transformModifyRequest(ProxyOperationContext operationContext,
ModifyRequest modifyRequest)
Applies any necessary transformation to the provided modify request.
|
LDAPResult |
transformModifyResult(ProxyOperationContext operationContext,
ReadOnlyModifyRequest modifyRequest,
LDAPResult modifyResult)
Applies any necessary transformation to the provided modify result.
|
SearchRequest |
transformSearchRequest(ProxyOperationContext operationContext,
SearchRequest searchRequest)
Applies any necessary transformation to the provided search request.
|
SearchResult |
transformSearchResult(ProxyOperationContext operationContext,
ReadOnlySearchRequest searchRequest,
SearchResult searchResult,
SearchResultProvider resultProvider)
Applies any necessary transformation to the provided search result.
|
SearchResultEntry |
transformSearchResultEntry(ProxyOperationContext operationContext,
ReadOnlySearchRequest searchRequest,
SearchResultEntry searchEntry)
Applies any necessary transformation to the provided search result entry.
|
SearchResultReference |
transformSearchResultReference(ProxyOperationContext operationContext,
ReadOnlySearchRequest searchRequest,
SearchResultReference searchReference)
Applies any necessary transformation to the provided search result
reference.
|
public ProxyTransformation()
initializeProxyTransformation
method.public abstract java.lang.String getExtensionName()
getExtensionName
in interface UnboundIDExtension
public abstract java.lang.String[] getExtensionDescription()
getExtensionDescription
in interface UnboundIDExtension
null
or an empty array if no description should be available.public void defineConfigArguments(ArgumentParser parser) throws ArgumentException
defineConfigArguments
in interface Configurable
parser
- The argument parser to be updated with the configuration
arguments which may be used by this extension.ArgumentException
- If a problem is encountered while updating the
provided argument parser.public void initializeProxyTransformation(ProxyServerContext serverContext, ProxyTransformationConfig config, ArgumentParser parser) throws LDAPException
serverContext
- A handle to the server context for the Directory
Proxy server in which this extension is running.config
- The general configuration for this proxy
transformation.parser
- The argument parser which has been initialized from
the configuration for this proxy transformation.LDAPException
- If a problem occurs while initializing this proxy
transformation.public boolean isConfigurationAcceptable(ProxyTransformationConfig config, ArgumentParser parser, java.util.List<java.lang.String> unacceptableReasons)
isConfigurationAcceptable
in interface Reconfigurable<ProxyTransformationConfig>
config
- The general configuration for this extension.parser
- The argument parser that has been used to
parse the proposed configuration for this
extension.unacceptableReasons
- A list to which messages may be added to
provide additional information about why the
provided configuration is not acceptable.true
if the configuration in the provided argument parser
appears to be acceptable, or false
if not.public ResultCode applyConfiguration(ProxyTransformationConfig config, ArgumentParser parser, java.util.List<java.lang.String> adminActionsRequired, java.util.List<java.lang.String> messages)
applyConfiguration
in interface Reconfigurable<ProxyTransformationConfig>
config
- The general configuration for this extension.parser
- The argument parser that has been used to
parse the new configuration for this
extension.adminActionsRequired
- A list to which messages may be added to
provide additional information about any
additional administrative actions that may
be required to apply some of the
configuration changes.messages
- A list to which messages may be added to
provide additional information about the
processing performed by this method.SUCCESS
should be
used to indicate that all processing completed successfully. Any
other result will indicate that a problem occurred during
processing.public void finalizeProxyTransformation()
public AddRequest transformAddRequest(ProxyOperationContext operationContext, AddRequest addRequest) throws LDAPException
operationContext
- Information about the operation being processed
in the Directory Proxy Server.addRequest
- The add request to be transformed.LDAPException
- If a problem is encountered while processing the
transformation, or if the provided request should
not be forwarded to a backend server.public LDAPResult transformAddResult(ProxyOperationContext operationContext, ReadOnlyAddRequest addRequest, LDAPResult addResult)
operationContext
- Information about the operation being processed
in the Directory Proxy Server.addRequest
- The add request that was processed.addResult
- The add result to be transformed.public BindRequest transformBindRequest(ProxyOperationContext operationContext, BindRequest bindRequest) throws LDAPException
operationContext
- Information about the operation being processed
in the Directory Proxy Server.bindRequest
- The bind request to be transformed.LDAPException
- If a problem is encountered while processing the
transformation, or if the provided request should
not be forwarded to a backend server.public BindResult transformBindResult(ProxyOperationContext operationContext, BindRequest bindRequest, BindResult bindResult)
operationContext
- Information about the operation being processed
in the Directory Proxy Server.bindRequest
- The bind request that was processed.bindResult
- The bind result to be transformed.public CompareRequest transformCompareRequest(ProxyOperationContext operationContext, CompareRequest compareRequest) throws LDAPException
operationContext
- Information about the operation being processed
in the Directory Proxy Server.compareRequest
- The compare request to be transformed.LDAPException
- If a problem is encountered while processing the
transformation, or if the provided request should
not be forwarded to a backend server.public LDAPResult transformCompareResult(ProxyOperationContext operationContext, ReadOnlyCompareRequest compareRequest, LDAPResult compareResult)
operationContext
- Information about the operation being processed
in the Directory Proxy Server.compareRequest
- The compare request that was processed.compareResult
- The compare result to be transformed.public DeleteRequest transformDeleteRequest(ProxyOperationContext operationContext, DeleteRequest deleteRequest) throws LDAPException
operationContext
- Information about the operation being processed
in the Directory Proxy Server.deleteRequest
- The delete request to be transformed.LDAPException
- If a problem is encountered while processing the
transformation, or if the provided request should
not be forwarded to a backend server.public LDAPResult transformDeleteResult(ProxyOperationContext operationContext, ReadOnlyDeleteRequest deleteRequest, LDAPResult deleteResult)
operationContext
- Information about the operation being processed
in the Directory Proxy Server.deleteRequest
- The delete request that was processed.deleteResult
- The delete result to be transformed.public ModifyRequest transformModifyRequest(ProxyOperationContext operationContext, ModifyRequest modifyRequest) throws LDAPException
operationContext
- Information about the operation being processed
in the Directory Proxy Server.modifyRequest
- The modify request to be transformed.LDAPException
- If a problem is encountered while processing the
transformation, or if the provided request should
not be forwarded to a backend server.public LDAPResult transformModifyResult(ProxyOperationContext operationContext, ReadOnlyModifyRequest modifyRequest, LDAPResult modifyResult)
operationContext
- Information about the operation being processed
in the Directory Proxy Server.modifyRequest
- The modify request that was processed.modifyResult
- The modify result to be transformed.public ModifyDNRequest transformModifyDNRequest(ProxyOperationContext operationContext, ModifyDNRequest modifyDNRequest) throws LDAPException
operationContext
- Information about the operation being processed
in the Directory Proxy Server.modifyDNRequest
- The modify DN request to be transformed.LDAPException
- If a problem is encountered while processing the
transformation, or if the provided request should
not be forwarded to a backend server.public LDAPResult transformModifyDNResult(ProxyOperationContext operationContext, ReadOnlyModifyDNRequest modifyDNRequest, LDAPResult modifyDNResult)
operationContext
- Information about the operation being processed
in the Directory Proxy Server.modifyDNRequest
- The modify DN request that was processed.modifyDNResult
- The modify DN result to be transformed.public SearchRequest transformSearchRequest(ProxyOperationContext operationContext, SearchRequest searchRequest) throws LDAPException
operationContext
- Information about the operation being processed
in the Directory Proxy Server.searchRequest
- The search request to be transformed.LDAPException
- If a problem is encountered while processing the
transformation, or if the provided request should
not be forwarded to a backend server.public SearchResult transformSearchResult(ProxyOperationContext operationContext, ReadOnlySearchRequest searchRequest, SearchResult searchResult, SearchResultProvider resultProvider)
operationContext
- Information about the operation being processed
in the Directory Proxy Server.searchRequest
- The search request that was processed.searchResult
- The search result to be transformed.resultProvider
- The search result provider which may be used to
send additional search result entries and/or
references to the client.public SearchResultEntry transformSearchResultEntry(ProxyOperationContext operationContext, ReadOnlySearchRequest searchRequest, SearchResultEntry searchEntry)
operationContext
- Information about the operation being processed
in the Directory Proxy Server.searchRequest
- The search request that is being processed.searchEntry
- The search result entry to be transformed.null
if the entry should not be returned to the client.public SearchResultReference transformSearchResultReference(ProxyOperationContext operationContext, ReadOnlySearchRequest searchRequest, SearchResultReference searchReference)
operationContext
- Information about the operation being processed
in the Directory Proxy Server.searchRequest
- The search request that is being processed.searchReference
- The search result reference to be transformed.null
if the reference
should not be returned to the client.public final java.lang.String toString()
toString
in class java.lang.Object
public abstract void toString(java.lang.StringBuilder buffer)
buffer
- The buffer to which the string representation should be
appended.public java.util.Map<java.util.List<java.lang.String>,java.lang.String> getExamplesArgumentSets()
getExamplesArgumentSets
in interface ExampleUsageProvider
null
or empty if there should
not be any example argument sets.