Hi Emmanuel!
Thanks for your quick response!
Would like us to try to implement the missing parts and create a PR? Sounds like we can just
implement it according to the other use cases.
Cheers,
Christopher
Am 13.05.20, 23:43 schrieb "Emmanuel Lécharny" <elecharny@gmail.com>:
On 13/05/2020 18:06, Christopher Cudennec wrote:
>
> Hi everyone!
>
> We would like to implement our own handling of AbandonRequests (still
> trying to proxy another LDAP server 😉).
>
> Can someone explain why AbandonRequests are not passed to handler
> classes? The code snippet below comes from LdapRequestHandler:
>
> ```
>
> if ( message instanceof AbandonRequest )
> {
> return;
> }
>
> handle( ldapSession, message );
>
> ```
>
> This makes it difficult for us to handle the request, i.e. sending it
> to the proxied master server. As this case is handled explicitly there
> must be a reason I guess.
>
Hi Christopher.
I see what you are trying to do, and this is a missing piece in our design.
Bottom line, yes, we should have added a abandon() method to the
interceptor chain, for an implementor to be able to deal with that.
There is no real difficulties here, it's all about :
- creating an AbandonOperationContext class to store the request. This
context will be passed through all the abandon() methods in interceptors
- add a abandon() method in the CoreSession interface and same thing in
the OperationManager interface (and of course in their implementations)
- update the OperationEnum enum to add the Abandon operation in it
- deal with the session closure at some point in the chain (probably
leaving it where it currently is, ie in the AbandonRequestHandler
class). Something like :
public class AbandonRequestHandler extends
LdapRequestHandler<AbandonRequest>
{
/** The logger for this class */
private static final Logger LOG = LoggerFactory.getLogger(
AbandonRequestHandler.class );
/**
* {@inheritDoc}
*/
public void handle( LdapSession session, AbandonRequest
abandonRequest ) throws Exception
{
LOG.debug( "Handling request: {}", abandonRequest );
int abandonedId = abandonRequest.getAbandoned();
if ( abandonedId < 0 )
{
return;
}
// Call the underlying layer to inject the new entry
CoreSession coreSession = session.getCoreSession();
coreSession.abandon( abandonRequest );
session.abandonOutstandingRequest( abandonedId );
}
}
> Cheers,
>
> Christopher
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@directory.apache.org
For additional commands, e-mail: dev-help@directory.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@directory.apache.org
For additional commands, e-mail: dev-help@directory.apache.org
|