public class StandaloneLdapApiService extends Object implements LdapApiService
LdapApiService
implementation.Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_CONTROLS_LIST
The list of default controls to load at startup
|
static String |
DEFAULT_EXTENDED_OPERATION_REQUESTS_LIST
The list of default extended operation requests to load at startup
|
static String |
DEFAULT_EXTENDED_OPERATION_RESPONSES_LIST
The list of default extended operation responses to load at startup
|
static String |
EXTRA_CONTROLS_LIST
The list of extra controls to load at startup
|
static String |
EXTRA_EXTENDED_OPERATION_LIST
The list of extra controls to load at startup
|
DEFAULT_PROTOCOL_CODEC_FACTORY
Constructor and Description |
---|
StandaloneLdapApiService()
Creates a new instance of StandaloneLdapCodecService.
|
Modifier and Type | Method and Description |
---|---|
ExtendedRequestDecorator<?,?> |
decorate(ExtendedRequest<?> decoratedMessage) |
ExtendedResponseDecorator<?> |
decorate(ExtendedResponse decoratedMessage) |
ExtendedRequest<?> |
fromJndi(ExtendedRequest jndiRequest)
Creates a model ExtendedResponse from the JNDI ExtendedResponse.
|
ExtendedResponse |
fromJndi(ExtendedResponse jndiResponse)
Creates a model ExtendedResponse from the JNDI ExtendedResponse.
|
Control |
fromJndiControl(Control control)
Creates a model control from the JNDI control.
|
org.apache.mina.filter.codec.ProtocolCodecFactory |
getProtocolCodecFactory()
Creates a new LDAP
ProtocolCodecFactory . |
boolean |
isControlRegistered(String oid)
Checks if a control has been registered.
|
boolean |
isExtendedOperationRegistered(String oid)
Checks to see if an extended operation, either a standard request
response, pair or just an unsolicited response is registered.
|
CodecControl<? extends Control> |
newControl(Control control)
Creates a new codec control decorator for the provided control.
|
CodecControl<? extends Control> |
newControl(String oid)
Creates a new codec control decorator of the specified type.
|
ExtendedRequest<?> |
newExtendedRequest(String oid,
byte[] value)
Creates a new ExtendedRequest instance.
|
<E extends ExtendedResponse> |
newExtendedResponse(ExtendedRequest<E> req,
byte[] serializedResponse) |
Asn1Container |
newMessageContainer()
Creates a new MessageContainer.
|
ControlFactory<?,?> |
registerControl(ControlFactory<?,?> factory)
Registers an
ControlFactory with this service. |
Iterator<String> |
registeredControls()
Returns an Iterator over the OID Strings of registered controls.
|
Iterator<String> |
registeredExtendedRequests()
Returns an Iterator over the OID Strings of registered extended
requests.
|
Iterator<String> |
registeredUnsolicitedResponses()
Returns an Iterator over the OID Strings of registered unsolicited
extended responses.
|
ExtendedRequestFactory<?,?> |
registerExtendedRequest(ExtendedRequestFactory<?,?> factory)
Registers an
ExtendedRequestFactory for generating extended request
response pairs. |
org.apache.mina.filter.codec.ProtocolCodecFactory |
registerProtocolCodecFactory(org.apache.mina.filter.codec.ProtocolCodecFactory protocolCodecFactory)
Registers a ProtocolCodecFactory with this LdapCodecService.
|
UnsolicitedResponseFactory<?> |
registerUnsolicitedResponse(UnsolicitedResponseFactory<?> factory)
Registers an
UnsolicitedResponseFactory for generating extended
responses sent by servers without an extended request. |
ExtendedRequest |
toJndi(ExtendedRequest<?> modelRequest)
Creates a JNDI
ExtendedResponse from the model
ExtendedResponse . |
ExtendedResponse |
toJndi(ExtendedResponse modelResponse)
Creates a JNDI
ExtendedResponse from the model
ExtendedResponse . |
Control |
toJndiControl(Control control)
Creates a JNDI control from the ldap model's control.
|
ControlFactory<?,?> |
unregisterControl(String oid)
Unregisters an
ControlFactory with this service. |
ExtendedRequestFactory<?,?> |
unregisterExtendedRequest(String oid)
Unregisters an
ExtendedRequestFactory for generating extended
request response pairs. |
UnsolicitedResponseFactory<?> |
unregisterUnsolicitedResponse(String oid)
Unregisters an
UnsolicitedResponseFactory for generating
extended responses sent by servers without an extended request. |
public static String DEFAULT_CONTROLS_LIST
public static String EXTRA_CONTROLS_LIST
public static String DEFAULT_EXTENDED_OPERATION_REQUESTS_LIST
public static String DEFAULT_EXTENDED_OPERATION_RESPONSES_LIST
public static String EXTRA_EXTENDED_OPERATION_LIST
public StandaloneLdapApiService() throws Exception
#PLUGIN_DIRECTORY_PROPERTY
. Intended for use by
unit test running tools like Maven's surefire:
<properties> <codec.plugin.directory>${project.build.directory}/pluginDirectory</codec.plugin.directory> </properties> <build> <plugins> <plugin> <artifactId>maven-surefire-plugin</artifactId> <groupId>org.apache.maven.plugins</groupId> <configuration> <systemPropertyVariables> <workingDirectory>${basedir}/target</workingDirectory> <felix.cache.rootdir> ${project.build.directory} </felix.cache.rootdir> <felix.cache.locking> true </felix.cache.locking> <org.osgi.framework.storage.clean> onFirstInit </org.osgi.framework.storage.clean> <org.osgi.framework.storage> osgi-cache </org.osgi.framework.storage> <codec.plugin.directory> ${codec.plugin.directory} </codec.plugin.directory> </systemPropertyVariables> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <id>copy</id> <phase>compile</phase> <goals> <goal>copy</goal> </goals> <configuration> <artifactItems> <artifactItem> <groupId>${project.groupId}</groupId> <artifactId>shared-ldap-extras-codec</artifactId> <version>${project.version}</version> <outputDirectory>${codec.plugin.directory}</outputDirectory> </artifactItem> </artifactItems> </configuration> </execution> </executions> </plugin> </plugins> </build>
Exception
public ControlFactory<?,?> registerControl(ControlFactory<?,?> factory)
ControlFactory
with this service.registerControl
in interface LdapApiService
factory
- The control factorypublic ControlFactory<?,?> unregisterControl(String oid)
ControlFactory
with this service.unregisterControl
in interface LdapApiService
oid
- The oid of the control the factory is associated with.public Iterator<String> registeredControls()
registeredControls
in interface LdapApiService
public boolean isControlRegistered(String oid)
isControlRegistered
in interface LdapApiService
public Iterator<String> registeredExtendedRequests()
registeredExtendedRequests
in interface LdapApiService
public ExtendedRequestFactory<?,?> registerExtendedRequest(ExtendedRequestFactory<?,?> factory)
ExtendedRequestFactory
for generating extended request
response pairs.registerExtendedRequest
in interface LdapApiService
factory
- The extended request factorypublic org.apache.mina.filter.codec.ProtocolCodecFactory getProtocolCodecFactory()
ProtocolCodecFactory
.getProtocolCodecFactory
in interface LdapApiService
ProtocolCodecFactory
public org.apache.mina.filter.codec.ProtocolCodecFactory registerProtocolCodecFactory(org.apache.mina.filter.codec.ProtocolCodecFactory protocolCodecFactory)
registerProtocolCodecFactory
in interface LdapApiService
protocolCodecFactory
- The factory being registered.ProtocolCodecFactory
, or null if
none had been set earlier.public CodecControl<? extends Control> newControl(String oid)
newControl
in interface LdapApiService
oid
- The OID of the new control to create.public CodecControl<? extends Control> newControl(Control control)
newControl
in interface LdapApiService
control
- The control the codec control is generated for.public Control toJndiControl(Control control) throws EncoderException
toJndiControl
in interface LdapApiService
control
- The model's control.EncoderException
- if there are problems encoding the modelControl.public Control fromJndiControl(Control control) throws DecoderException
fromJndiControl
in interface LdapApiService
control
- The JNDI control.DecoderException
- if there are problems decoding the value of the JNDI control.public Asn1Container newMessageContainer()
newMessageContainer
in interface LdapApiService
public Iterator<String> registeredUnsolicitedResponses()
registeredUnsolicitedResponses
in interface LdapApiService
public UnsolicitedResponseFactory<?> registerUnsolicitedResponse(UnsolicitedResponseFactory<?> factory)
UnsolicitedResponseFactory
for generating extended
responses sent by servers without an extended request.registerUnsolicitedResponse
in interface LdapApiService
factory
- The unsolicited response creating factorypublic ExtendedResponse toJndi(ExtendedResponse modelResponse) throws EncoderException
ExtendedResponse
from the model
ExtendedResponse
.toJndi
in interface LdapApiService
EncoderException
public ExtendedResponse fromJndi(ExtendedResponse jndiResponse) throws DecoderException
fromJndi
in interface LdapApiService
jndiResponse
- The JNDI ExtendedResponseDecoderException
- if the response value cannot be decoded.public ExtendedRequestFactory<?,?> unregisterExtendedRequest(String oid)
ExtendedRequestFactory
for generating extended
request response pairs.unregisterExtendedRequest
in interface LdapApiService
oid
- The extended request oidpublic UnsolicitedResponseFactory<?> unregisterUnsolicitedResponse(String oid)
UnsolicitedResponseFactory
for generating
extended responses sent by servers without an extended request.unregisterUnsolicitedResponse
in interface LdapApiService
oid
- The unsolicited response oidpublic ExtendedRequest<?> fromJndi(ExtendedRequest jndiRequest) throws DecoderException
fromJndi
in interface LdapApiService
DecoderException
- if the response value cannot be decoded.public ExtendedRequest toJndi(ExtendedRequest<?> modelRequest) throws EncoderException
ExtendedResponse
from the model
ExtendedResponse
.toJndi
in interface LdapApiService
EncoderException
public <E extends ExtendedResponse> E newExtendedResponse(ExtendedRequest<E> req, byte[] serializedResponse) throws DecoderException
newExtendedResponse
in interface LdapApiService
DecoderException
public ExtendedRequest<?> newExtendedRequest(String oid, byte[] value)
newExtendedRequest
in interface LdapApiService
oid
- the extended request's object identifiervalue
- the encoded value of the extended requestpublic ExtendedRequestDecorator<?,?> decorate(ExtendedRequest<?> decoratedMessage)
decorate
in interface LdapApiService
public ExtendedResponseDecorator<?> decorate(ExtendedResponse decoratedMessage)
decorate
in interface LdapApiService
public boolean isExtendedOperationRegistered(String oid)
isExtendedOperationRegistered
in interface LdapApiService
oid
- The object identifier for the extended operationCopyright © 2003-2014 The Apache Software Foundation. All Rights Reserved.