Class SaslFilter
- java.lang.Object
-
- org.apache.mina.core.filterchain.IoFilterAdapter
-
- org.apache.directory.api.ldap.codec.api.SaslFilter
-
- All Implemented Interfaces:
IoFilter
public class SaslFilter extends IoFilterAdapter
AnIoFilterAdapterthat handles integrity and confidentiality protection for a SASL bound session. The SaslFilter must be constructed with a SASL context that has completed SASL negotiation. Some SASL mechanisms, such as CRAM-MD5, only support authentication and thus do not need this filter. DIGEST-MD5 and GSSAPI do support message integrity and confidentiality and, therefore, do need this filter.- Author:
- Apache Directory Project
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.mina.core.filterchain.IoFilter
IoFilter.NextFilter
-
-
Field Summary
Fields Modifier and Type Field Description static StringBYTESA session attribute key that holds the received bytes of partially received SASL message.static StringDISABLE_SECURITY_LAYER_ONCEA session attribute key that makes next one write request bypass this filter (not adding a security layer).static StringOFFSETA session attribute key that holds the offset of partially received SASL message.
-
Constructor Summary
Constructors Constructor Description SaslFilter(SaslClient saslClient)Creates a new instance of SaslFilter.SaslFilter(SaslServer saslServer)Creates a new instance of SaslFilter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfilterWrite(IoFilter.NextFilter nextFilter, IoSession session, WriteRequest writeRequest)FiltersIoSession.write(Object)method invocation.voidmessageReceived(IoFilter.NextFilter nextFilter, IoSession session, Object message)FiltersIoHandler.messageReceived(IoSession,Object)event.-
Methods inherited from class org.apache.mina.core.filterchain.IoFilterAdapter
destroy, event, exceptionCaught, filterClose, init, inputClosed, messageSent, onPostAdd, onPostRemove, onPreAdd, onPreRemove, sessionClosed, sessionCreated, sessionIdle, sessionOpened, toString
-
-
-
-
Field Detail
-
DISABLE_SECURITY_LAYER_ONCE
public static final String DISABLE_SECURITY_LAYER_ONCE
A session attribute key that makes next one write request bypass this filter (not adding a security layer). This is a marker attribute, which means that you can put whatever as its value. (Boolean.TRUEis preferred.) The attribute is automatically removed from the session attribute map as soon asIoSession.write(Object)is invoked, and therefore should be put again if you want to make more messages bypass this filter.
-
BYTES
public static final String BYTES
A session attribute key that holds the received bytes of partially received SASL message.
-
OFFSET
public static final String OFFSET
A session attribute key that holds the offset of partially received SASL message.
-
-
Constructor Detail
-
SaslFilter
public SaslFilter(SaslClient saslClient)
Creates a new instance of SaslFilter. The SaslFilter must be constructed with a SASL client that has completed SASL negotiation. The SASL client will be used to provide message integrity and, optionally, message confidentiality.- Parameters:
saslClient- The initialized SASL client.
-
SaslFilter
public SaslFilter(SaslServer saslServer)
Creates a new instance of SaslFilter. The SaslFilter must be constructed with a SASL server that has completed SASL negotiation. The SASL server will be used to provide message integrity and, optionally, message confidentiality.- Parameters:
saslClient- The initialized SASL server.
-
-
Method Detail
-
messageReceived
public void messageReceived(IoFilter.NextFilter nextFilter, IoSession session, Object message) throws SaslException
Description copied from class:IoFilterAdapterFiltersIoHandler.messageReceived(IoSession,Object)event.- Specified by:
messageReceivedin interfaceIoFilter- Overrides:
messageReceivedin classIoFilterAdapter- Parameters:
nextFilter- theIoFilter.NextFilterfor this filter. You can reuse this object until this filter is removed from the chain.session- TheIoSessionwhich has received this eventmessage- The received message- Throws:
SaslException
-
filterWrite
public void filterWrite(IoFilter.NextFilter nextFilter, IoSession session, WriteRequest writeRequest) throws SaslException
Description copied from class:IoFilterAdapterFiltersIoSession.write(Object)method invocation.- Specified by:
filterWritein interfaceIoFilter- Overrides:
filterWritein classIoFilterAdapter- Parameters:
nextFilter- theIoFilter.NextFilterfor this filter. You can reuse this object until this filter is removed from the chain.session- TheIoSessionwhich has to process this invocationwriteRequest- TheWriteRequestto process- Throws:
SaslException
-
-