org.lastbamboo.common.turn.client
Class TurnStunDemuxableProtocolCodecFactory

java.lang.Object
  extended by org.lastbamboo.common.turn.client.TurnStunDemuxableProtocolCodecFactory
All Implemented Interfaces:
org.littleshoot.util.mina.DemuxableProtocolCodecFactory<org.littleshoot.stun.stack.message.StunMessage>

public class TurnStunDemuxableProtocolCodecFactory
extends Object
implements org.littleshoot.util.mina.DemuxableProtocolCodecFactory<org.littleshoot.stun.stack.message.StunMessage>

DemuxableProtocolCodecFactory for STUN. This is slightly specialized for TURN because we need to wrap messages in Send Indications. Send Indications require a REMOTE-ADDRESS attribute, but we lose the remote address from the Data Indication unless we record it, which we do here. For STUN, we do this by mapping message transaction IDs to remote addresses the transactions are intended for.


Constructor Summary
TurnStunDemuxableProtocolCodecFactory()
           
 
Method Summary
 boolean canDecode(org.littleshoot.mina.common.ByteBuffer in)
           
 boolean enoughData(org.littleshoot.mina.common.ByteBuffer in)
           
 Class<org.littleshoot.stun.stack.message.StunMessage> getClassToEncode()
           
 org.littleshoot.util.mina.DemuxableProtocolDecoder newDecoder()
           
 org.littleshoot.mina.filter.codec.ProtocolEncoder newEncoder()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TurnStunDemuxableProtocolCodecFactory

public TurnStunDemuxableProtocolCodecFactory()
Method Detail

canDecode

public boolean canDecode(org.littleshoot.mina.common.ByteBuffer in)
Specified by:
canDecode in interface org.littleshoot.util.mina.DemuxableProtocolCodecFactory<org.littleshoot.stun.stack.message.StunMessage>

enoughData

public boolean enoughData(org.littleshoot.mina.common.ByteBuffer in)
Specified by:
enoughData in interface org.littleshoot.util.mina.DemuxableProtocolCodecFactory<org.littleshoot.stun.stack.message.StunMessage>

getClassToEncode

public Class<org.littleshoot.stun.stack.message.StunMessage> getClassToEncode()
Specified by:
getClassToEncode in interface org.littleshoot.util.mina.DemuxableProtocolCodecFactory<org.littleshoot.stun.stack.message.StunMessage>

newDecoder

public org.littleshoot.util.mina.DemuxableProtocolDecoder newDecoder()
Specified by:
newDecoder in interface org.littleshoot.util.mina.DemuxableProtocolCodecFactory<org.littleshoot.stun.stack.message.StunMessage>

newEncoder

public org.littleshoot.mina.filter.codec.ProtocolEncoder newEncoder()
Specified by:
newEncoder in interface org.littleshoot.util.mina.DemuxableProtocolCodecFactory<org.littleshoot.stun.stack.message.StunMessage>


Copyright © 2013 LittleShoot. All Rights Reserved.