|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nist.javax.sip.stack.MessageChannel
gov.nist.javax.sip.stack.ConnectionOrientedMessageChannel
public abstract class ConnectionOrientedMessageChannel
Field Summary | |
---|---|
protected boolean |
isCached
|
protected boolean |
isRunning
|
protected String |
key
|
protected String |
myAddress
|
protected InputStream |
myClientInputStream
|
protected PipelinedMsgParser |
myParser
|
protected int |
myPort
|
protected Socket |
mySock
|
protected Thread |
mythread
|
protected InetAddress |
peerAddress
|
protected int |
peerPort
|
protected int |
peerPortAdvertisedInHeaders
|
protected String |
peerProtocol
|
protected SIPTransactionStack |
sipStack
|
Fields inherited from class gov.nist.javax.sip.stack.MessageChannel |
---|
messageProcessor, useCount |
Constructor Summary | |
---|---|
ConnectionOrientedMessageChannel(SIPTransactionStack sipStack)
|
Method Summary | |
---|---|
void |
cancelPingKeepAliveTimeoutTaskIfStarted()
|
void |
close()
Close the message channel. |
protected abstract void |
close(boolean b)
|
long |
getKeepAliveTimeout()
|
String |
getKey()
Get an identifying key. |
String |
getPeerAddress()
get the address of the client that sent the data to us. |
protected InetAddress |
getPeerInetAddress()
|
InetAddress |
getPeerPacketSourceAddress()
|
int |
getPeerPacketSourcePort()
|
int |
getPeerPort()
Get the port of the peer to whom we are sending messages. |
String |
getPeerProtocol()
|
SIPTransactionStack |
getSIPStack()
Get my SIP Stack. |
String |
getViaHost()
Get the host to assign to outgoing messages. |
int |
getViaPort()
Get the port for outgoing messages sent from the channel. |
boolean |
isReliable()
Returns "true" as this is a reliable transport. |
void |
processMessage(SIPMessage sipMessage)
Gets invoked by the parser as a callback on successful message parsing (i.e. |
void |
processMessage(SIPMessage sipMessage,
InetAddress address)
|
void |
rescheduleKeepAliveTimeout(long newKeepAliveTimeout)
|
void |
run()
This gets invoked when thread.start is called from the constructor. |
protected abstract void |
sendMessage(byte[] msg,
boolean b)
|
void |
sendMessage(SIPMessage sipMessage)
Return a formatted message to the client. |
void |
sendSingleCLRF()
|
void |
setKeepAliveTimeout(long keepAliveTimeout)
|
protected void |
uncache()
Hook method, overridden by subclasses |
Methods inherited from class gov.nist.javax.sip.stack.MessageChannel |
---|
createBadReqRes, getEncapsulatedClientTransaction, getHost, getHostPort, getKey, getKey, getMessageProcessor, getPeerHostPort, getPort, getRawIpSourceAddress, getTransport, getViaHeader, getViaHostPort, isSecure, logMessage, logResponse, sendMessage, sendMessage, sendMessage, setEncapsulatedClientTransaction |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface gov.nist.javax.sip.parser.ParseExceptionListener |
---|
handleException |
Field Detail |
---|
protected SIPTransactionStack sipStack
protected Socket mySock
protected PipelinedMsgParser myParser
protected String key
protected InputStream myClientInputStream
protected boolean isRunning
protected boolean isCached
protected Thread mythread
protected String myAddress
protected int myPort
protected InetAddress peerAddress
protected int peerPortAdvertisedInHeaders
protected int peerPort
protected String peerProtocol
Constructor Detail |
---|
public ConnectionOrientedMessageChannel(SIPTransactionStack sipStack)
Method Detail |
---|
public boolean isReliable()
isReliable
in class MessageChannel
public void close()
close
in class MessageChannel
protected abstract void close(boolean b)
public SIPTransactionStack getSIPStack()
getSIPStack
in class MessageChannel
public String getPeerAddress()
getPeerAddress
in class MessageChannel
protected InetAddress getPeerInetAddress()
getPeerInetAddress
in class MessageChannel
public String getPeerProtocol()
getPeerProtocol
in class MessageChannel
public void sendMessage(SIPMessage sipMessage) throws IOException
sendMessage
in class MessageChannel
sipMessage
- Message to send.
IOException
- If there is an error sending the messageprotected abstract void sendMessage(byte[] msg, boolean b) throws IOException
IOException
public void processMessage(SIPMessage sipMessage, InetAddress address)
public void processMessage(SIPMessage sipMessage) throws Exception
processMessage
in interface SIPMessageListener
processMessage
in interface RawMessageChannel
sipMessage
- Message to process (this calls the application for processing
the message).
Jvb: note that this code is identical to TCPMessageChannel,
refactor some day
Exception
for the method that gets called
on parse exception.
public void run()
run
in interface Runnable
protected void uncache()
MessageChannel
uncache
in class MessageChannel
public String getKey()
getKey
in class MessageChannel
public String getViaHost()
getViaHost
in class MessageChannel
public int getViaPort()
getViaPort
in class MessageChannel
public int getPeerPort()
getPeerPort
in class MessageChannel
public int getPeerPacketSourcePort()
getPeerPacketSourcePort
in class MessageChannel
public InetAddress getPeerPacketSourceAddress()
getPeerPacketSourceAddress
in class MessageChannel
public void sendSingleCLRF() throws Exception
sendSingleCLRF
in interface SIPMessageListener
Exception
public void cancelPingKeepAliveTimeoutTaskIfStarted()
public void setKeepAliveTimeout(long keepAliveTimeout)
public long getKeepAliveTimeout()
public void rescheduleKeepAliveTimeout(long newKeepAliveTimeout)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |