public class NioTlsMessageChannel extends NioTcpMessageChannel implements NioTlsChannelInterface
Modifier and Type | Class and Description |
---|---|
static class |
NioTlsMessageChannel.SSLReconnectedException |
channelMap, lastActivityTimeStamp, socketChannel
isCached, isRunning, key, myAddress, myClientInputStream, myParser, myPort, mySock, mythread, peerAddress, peerAddressAdvertisedInHeaders, peerPort, peerPortAdvertisedInHeaders, peerProtocol, sipStack
messageProcessor, useCount
Modifier | Constructor and Description |
---|---|
|
NioTlsMessageChannel(InetAddress inetAddress,
int port,
SIPTransactionStack sipStack,
NioTcpMessageProcessor nioTcpMessageProcessor) |
protected |
NioTlsMessageChannel(NioTcpMessageProcessor nioTcpMessageProcessor,
SocketChannel socketChannel) |
Modifier and Type | Method and Description |
---|---|
protected void |
addBytes(byte[] bytes) |
void |
addPlaintextBytes(byte[] bytes)
Add plain text data in the queue.
|
static NioTcpMessageChannel |
create(NioTcpMessageProcessor nioTcpMessageProcessor,
SocketChannel socketChannel) |
protected void |
createBuffers() |
HandshakeCompletedListenerImpl |
getHandshakeCompletedListener() |
SipStackImpl |
getSIPStack()
Get my SIP Stack.
|
String |
getTransport()
get the transport string.
|
void |
init(boolean clientMode) |
boolean |
isHandshakeCompleted() |
boolean |
isSecure()
TCP Is not a secure protocol.
|
void |
onNewSocket(byte[] message) |
ByteBuffer |
prepareAppDataBuffer()
Initialize the buffer again.
|
ByteBuffer |
prepareAppDataBuffer(int capacity)
Initialize the buffer again.
|
ByteBuffer |
prepareEncryptedDataBuffer()
Initialize the buffer again.
|
void |
sendEncryptedData(byte[] msg)
Be able to send already encrypted data or metadata or some SSL frame padding to comply with some extension
|
protected void |
sendMessage(byte[] msg,
boolean isClient)
Send message to whoever is connected to us.
|
void |
sendMessage(byte[] message,
InetAddress receiverAddress,
int receiverPort,
boolean retry)
Send a message to a specified address.
|
void |
setHandshakeCompleted(boolean handshakeCompleted) |
void |
setHandshakeCompletedListener(HandshakeCompletedListener handshakeCompletedListenerImpl) |
close, equals, getLastActivityTimestamp, getMessageChannel, getSocketChannel, handleException, putMessageChannel, readChannel, removeMessageChannel, sendTCPMessage
cancelPingKeepAliveTimeoutTaskIfStarted, close, getKeepAliveTimeout, getKey, getPeerAddress, getPeerInetAddress, getPeerPacketSourceAddress, getPeerPacketSourcePort, getPeerPort, getPeerProtocol, getViaHost, getViaPort, isReliable, processMessage, processMessage, rescheduleKeepAliveTimeout, run, sendMessage, sendSingleCLRF, setKeepAliveTimeout, uncache
createBadReqRes, getEncapsulatedClientTransaction, getHost, getHostPort, getKey, getKey, getMessageProcessor, getPeerHostPort, getPort, getRawIpSourceAddress, getViaHeader, getViaHostPort, logMessage, logResponse, sendMessage, sendMessage, setEncapsulatedClientTransaction
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getEncapsulatedClientTransaction
protected NioTlsMessageChannel(NioTcpMessageProcessor nioTcpMessageProcessor, SocketChannel socketChannel) throws IOException
IOException
public NioTlsMessageChannel(InetAddress inetAddress, int port, SIPTransactionStack sipStack, NioTcpMessageProcessor nioTcpMessageProcessor) throws IOException
IOException
public static NioTcpMessageChannel create(NioTcpMessageProcessor nioTcpMessageProcessor, SocketChannel socketChannel) throws IOException
IOException
public void init(boolean clientMode) throws Exception, CertificateException, FileNotFoundException, IOException
public ByteBuffer prepareEncryptedDataBuffer()
NioTlsChannelInterface
prepareEncryptedDataBuffer
in interface NioTlsChannelInterface
public ByteBuffer prepareAppDataBuffer()
NioTlsChannelInterface
prepareAppDataBuffer
in interface NioTlsChannelInterface
public ByteBuffer prepareAppDataBuffer(int capacity)
NioTlsChannelInterface
prepareAppDataBuffer
in interface NioTlsChannelInterface
protected void sendMessage(byte[] msg, boolean isClient) throws IOException
NioTcpMessageChannel
sendMessage
in class NioTcpMessageChannel
msg
- is the message to send.IOException
public void sendEncryptedData(byte[] msg) throws IOException
NioTlsChannelInterface
sendEncryptedData
in interface NioTlsChannelInterface
IOException
public void sendMessage(byte[] message, InetAddress receiverAddress, int receiverPort, boolean retry) throws IOException
NioTcpMessageChannel
sendMessage
in class NioTcpMessageChannel
message
- Pre-formatted message to send.receiverAddress
- Address to send it to.receiverPort
- Receiver port.IOException
- If there is a problem connecting or sending.protected void createBuffers()
protected void addBytes(byte[] bytes) throws Exception
addBytes
in class NioTcpMessageChannel
Exception
public String getTransport()
NioTcpMessageChannel
getTransport
in class NioTcpMessageChannel
public void onNewSocket(byte[] message)
onNewSocket
in class NioTcpMessageChannel
public boolean isSecure()
NioTcpMessageChannel
isSecure
in class NioTcpMessageChannel
public void addPlaintextBytes(byte[] bytes) throws Exception
NioTlsChannelInterface
addPlaintextBytes
in interface NioTlsChannelInterface
Exception
public void setHandshakeCompletedListener(HandshakeCompletedListener handshakeCompletedListenerImpl)
public HandshakeCompletedListenerImpl getHandshakeCompletedListener()
public boolean isHandshakeCompleted()
public void setHandshakeCompleted(boolean handshakeCompleted)
handshakeCompleted
- the handshakeCompleted to setpublic SipStackImpl getSIPStack()
ConnectionOrientedMessageChannel
getSIPStack
in interface NioTlsChannelInterface
getSIPStack
in class ConnectionOrientedMessageChannel
Copyright © 2015. All Rights Reserved.