Le 6/15/12 7:09 PM, Daniel Fisher a écrit :
Looking over the extended operation classes I have a couple of questions.
How do I perform an extended operation that includes both request
controls and a requestValue?
The ExtendedRequest class doesn't include a requestValue property and
the LdapConnection class doesn't include a method signature that
supports both an ExtendedRequest and an requestValue.
I don't have a use case for this, but it seems like an oversight.
You are right. Atm, we just offer a few implemented extended requests,
and we don't expose any class that could be used to directly create an
unknown ExtendedRequest to the server, none do we provide simple ways to
process the ExtendedResponse.
This is not a choice, but the fact is that the payload is not easy to
compute and decode, so the underlying mechanism is suppposed to be
embedded into classes extending the AbstractExtendedRequest class.
That also means that an implemented Extended request does not expose the
internal paylod (ie, the encoded value), but instead the values that are
manipulated by the end user.
For instance, the CertGeneration extended request is implemented using a
class :
http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec-api/src/main/java/org/apache/directory/shared/ldap/extras/extended/CertGenerationRequestImpl.java?view=markup
and many others to handle the encoding and decoding :
http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/certGeneration/
How do I access the response bytes from the extended operation?
I don't see a corresponding property on ExtendedResponse.
We don't have such a property. The response bytes is decoded on the fly.
We may want to add the decoded bytes though, if it's needed...
In any case, the API does not support a lots of ExtendedRequest atm (the
very same for controls), but we designed this to be extensible : as the
API is OSGi compliant, anyone could write its own control or extended op
and load it into the API.
Ok, we don't have doco for that atm ...
--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com