| java.lang.Object gov.nist.siplite.stack.MessageChannel gov.nist.siplite.stack.TCPMessageChannel
Method Summary | |
public synchronized void | close() Closes the message channel. | public boolean | equals(Object other) Equals predicate. | protected synchronized void | exit() Closes the message channel regardless whether it is used or not. | public String | getKey() Gets an identifying key. | public String | getPeerAddress() Gets the address of the client that sent the data to us. | public int | getPeerPort() Gets the port of the peer to whom we are sending messages. | public SIPMessageStack | getSIPStack() Gets my SIP Stack. | public String | getTransport() Gets the transport string. | public String | getViaHost() Gets the host to assign to outgoing messages. | public int | getViaPort() Gets the port for outgoing messages sent from the channel. | public void | handleException(SIPServerException ex) Exception processor for exceptions detected from the application. | public void | handleException(ParseException ex, Message sipMessage, Class hdrClass, String header, String message) Exception processor for exceptions detected from the parser. | public void | handleIOException() Called when the pipelined parser cannot read input because the
other end closed the connection. | protected synchronized void | incrementUseCounter() Increments the number of user of this channel. | public boolean | isReliable() Returns "true" as this is a reliable transport. | public boolean | isSecure() TCP Is not a secure protocol. | public void | processMessage(Message sipMessage) Gets invoked by the parser as a callback on successful message
parsing (i.e. | public void | sendMessage(Message sipMessage) Returns a formatted message to the client. | public void | sendMessage(byte message, String receiverAddress, int receiverPort) Sends a message to a specified address. |
TCPMessageChannel | protected TCPMessageChannel(SocketConnection sock, SIPMessageStack sipStack, TCPMessageProcessor msgProcessor) throws IOException(Code) | | Constructor - gets called from the SIPMessageStack class with a socket
on accepting a new client. All the processing of the message is
done here with the stack being freed up to handle new connections.
The sock input is the socket that is returned from the accept.
Global data that is shared by all threads is accessible in the Server
structure.
Parameters: sock - Socket from which to read and write messages. The socketis already connected (was created as a result of an accept). Parameters: sipStack - Ptr to SIP Stack Parameters: msgProcessor - handler for TCP message communication |
TCPMessageChannel | protected TCPMessageChannel(HostPort targetHostPort, SIPMessageStack sipStack, TCPMessageProcessor msgProcessor) throws IOException(Code) | | Constructor - connects to the given inet address.
Parameters: targetHostPort - inet address to connect to. Parameters: sipStack - is the sip stack from which we are created. Parameters: msgProcessor - TCP message processor throws: IOException - if we cannot connect. |
close | public synchronized void close()(Code) | | Closes the message channel.
|
equals | public boolean equals(Object other)(Code) | | Equals predicate.
Parameters: other - is the other object to compare ourselves to for equals true if object matches |
exit | protected synchronized void exit()(Code) | | Closes the message channel regardless whether it is used or not.
|
getKey | public String getKey()(Code) | | Gets an identifying key. This key is used to cache the connection
and re-use it if necessary.
the identifying key |
getPeerAddress | public String getPeerAddress()(Code) | | Gets the address of the client that sent the data to us.
Address of the client that sent us datathat resulted in this channel beingcreated. |
getPeerPort | public int getPeerPort()(Code) | | Gets the port of the peer to whom we are sending messages.
the peer port. |
getSIPStack | public SIPMessageStack getSIPStack()(Code) | | Gets my SIP Stack.
The SIP Stack for this message channel. |
getTransport | public String getTransport()(Code) | | Gets the transport string.
"tcp" in this case. |
getViaHost | public String getViaHost()(Code) | | Gets the host to assign to outgoing messages.
the host to assign to the via header. |
getViaPort | public int getViaPort()(Code) | | Gets the port for outgoing messages sent from the channel.
the port to assign to the via header. |
handleException | public void handleException(SIPServerException ex)(Code) | | Exception processor for exceptions detected from the application.
Parameters: ex - The exception that was generated. |
handleException | public void handleException(ParseException ex, Message sipMessage, Class hdrClass, String header, String message) throws ParseException(Code) | | Exception processor for exceptions detected from the parser. (This
is invoked by the parser when an error is detected).
Parameters: ex - parse exception detected by the parser. Parameters: sipMessage - message that incurred the error. Parameters: hdrClass - header parsing class Parameters: header - header that caused the error. Parameters: message - descriptive text for exception throws: ParseException - Thrown if we want to reject the message. |
handleIOException | public void handleIOException()(Code) | | Called when the pipelined parser cannot read input because the
other end closed the connection.
|
incrementUseCounter | protected synchronized void incrementUseCounter()(Code) | | Increments the number of user of this channel.
|
isReliable | public boolean isReliable()(Code) | | Returns "true" as this is a reliable transport.
true if reliable stream transport |
isSecure | public boolean isSecure()(Code) | | TCP Is not a secure protocol.
always false |
processMessage | public void processMessage(Message sipMessage)(Code) | | Gets invoked by the parser as a callback on successful message
parsing (i.e. no parser errors).
Parameters: sipMessage - Mesage to process (this calls the applicationfor processing the message). |
sendMessage | public void sendMessage(Message sipMessage) throws IOException(Code) | | Returns a formatted message to the client.
We try to re-connect with the peer on the other end if possible.
Parameters: sipMessage - Message to send. throws: IOException - If there is an error sending the message |
sendMessage | public void sendMessage(byte message, String receiverAddress, int receiverPort) throws IOException, IllegalArgumentException(Code) | | Sends a message to a specified address.
Parameters: message - Pre-formatted message to send. Parameters: receiverAddress - Address to send it to. Parameters: receiverPort - Receiver port. throws: IOException - If there is a problem connecting or sending. |
Methods inherited from gov.nist.siplite.stack.MessageChannel | abstract public void close()(Code)(Java Doc) public String getHost()(Code)(Java Doc) public HostPort getHostPort()(Code)(Java Doc) abstract public String getKey()(Code)(Java Doc) public static String getKey(String inetAddr, int port, String transport)(Code)(Java Doc) public MessageProcessor getMessageProcessor()(Code)(Java Doc) abstract public String getPeerAddress()(Code)(Java Doc) public HostPort getPeerHostPort()(Code)(Java Doc) abstract public int getPeerPort()(Code)(Java Doc) public int getPort()(Code)(Java Doc) abstract public SIPMessageStack getSIPStack()(Code)(Java Doc) abstract public String getTransport()(Code)(Java Doc) public ViaHeader getViaHeader()(Code)(Java Doc) abstract public String getViaHost()(Code)(Java Doc) public HostPort getViaHostPort()(Code)(Java Doc) abstract public int getViaPort()(Code)(Java Doc) abstract public void handleException(SIPServerException ex)(Code)(Java Doc) abstract public boolean isReliable()(Code)(Java Doc) abstract public boolean isSecure()(Code)(Java Doc) protected void logMessage(Message sipMessage, String address, int port, long time)(Code)(Java Doc) public void logResponse(Response sipResponse, long receptionTime, String status)(Code)(Java Doc) abstract public void sendMessage(Message sipMessage) throws IOException(Code)(Java Doc) abstract protected void sendMessage(byte[] message, String receiverAddress, int receiverPort) throws IOException(Code)(Java Doc) public void sendMessage(Message sipMessage, String receiverAddress, int receiverPort) throws IOException(Code)(Java Doc)
|
|
|