directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Trustin Lee <>
Subject Re: [mina] SASL support
Date Thu, 05 May 2005 17:32:42 GMT

I'm sorry for late reply.  It was Korean national holiday, so I spent
today with my family.

2005/5/5, Vinod Panicker <>:
> Hi,
> Basically got to thinking on this and realized that it wouldn't be
> proper if SASL support is integrated into MINA.  SASL is supposed to
> be utilized by existing protocols as a means of providing
> authentication.  Its not an independent protocol in itself.  In the
> case of ApacheDS, the LDAP protocol would be carrying SASL data as
> well.  So actually SASL should be implemented by the ProtocolHandler
> rather than as a MINA filter.

ProtocolHandler or IoHandler can interact in three ways:

1. ProtocolHandler and IoHandler can get an instance of filter by
calling getFilterChain().get('filterName').  So you can call
filter-specific methods directly to control its behavior.

2. Filters can get some predefined session attributes that can be
initialized in sessionCreated(...) method.

3. Filters can define an interface with filter-specific event handler
methods.  Any ProtocolHandler implementations that also implement that
interface will get notified by the filter.  For example:

public class MyHandler implements IoHandler, SASLHandler {
   public void saslEvent(SASLSession session, SASLEvent e) {
        // ....

public class SASLFilter implement IoFilter {
    public void dataRead(...) {
        IoHandler handler = session.getHandler();
        if( handler instanceof SASLHandler ) {
            (SASLHandler) handler).saslEvent(...);

But this way is not perfect because IoFilters cannot get
ProtocolHandler which is backed by internal IoHandler implementation.

I don't know SASL, so I can say only general stuffs for now.

what we call human nature is actually human habit

View raw message