|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.lastbamboo.common.sip.stack.transport.SipTcpTransportLayerImpl
public final class SipTcpTransportLayerImpl
The transport layer implementation for TCP.
| Field Summary |
|---|
| Fields inherited from interface org.littleshoot.mina.common.IoFutureListener |
|---|
CLOSE |
| Constructor Summary | |
|---|---|
SipTcpTransportLayerImpl(SipTransactionFactory transactionFactory,
SipHeaderFactory headerFactory,
SipMessageFactory messageFactory)
Constructs an instance of the TCP transport layer. |
|
| Method Summary | |
|---|---|
void |
addConnection(org.littleshoot.mina.common.IoSession io)
Adds a mapping between the remote host for the connection and the class for reading and writing data from and to that host. |
boolean |
hasConnectionForAny(Collection<InetSocketAddress> socketAddresses)
Checks whether or not the transport layer has a connection to any of the specified socket addresses. |
SipClientTransaction |
invite(Invite request,
org.littleshoot.mina.common.IoSession io,
org.lastbamboo.common.offer.answer.OfferAnswerTransactionListener transactionListener)
Writes a message that is a part of a transaction. |
void |
operationComplete(org.littleshoot.mina.common.IoFuture future)
|
SipClientTransaction |
register(Register request,
org.littleshoot.mina.common.IoSession io,
org.lastbamboo.common.offer.answer.OfferAnswerTransactionListener transactionListener)
Writes a REGISTER request that is a part of a transaction. |
void |
removeConnection(org.littleshoot.mina.common.IoSession io)
Removes this connection. |
org.littleshoot.mina.common.WriteFuture |
writeCrlfKeepAlive(org.littleshoot.mina.common.IoSession io)
Writes a CRLF keep-alive message to the given reader/writer, as specified in the SIP outbound drafts. |
void |
writeRequest(Collection<InetSocketAddress> socketAddresses,
Invite request)
Writes the specified request to the first address in the collection we have a connection for. |
void |
writeRequestStatelessly(Invite request,
org.littleshoot.mina.common.IoSession io)
Writes the specified request without creating a transaction. |
boolean |
writeResponse(InetSocketAddress socketAddress,
SipResponse response)
Writes the specified response message to the connection associated with the specified address. |
void |
writeResponse(SipResponse response)
Writes a response using the routing information in the topmost Via header. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SipTcpTransportLayerImpl(SipTransactionFactory transactionFactory,
SipHeaderFactory headerFactory,
SipMessageFactory messageFactory)
transactionFactory - The factory for creating transactions.headerFactory - The factory for creating any headers necessary
before writing messages, such as the Via header.messageFactory - The factory for creating SIP messages.| Method Detail |
|---|
public void addConnection(org.littleshoot.mina.common.IoSession io)
SipTcpTransportLayer
addConnection in interface SipTcpTransportLayerio - The connection to the host.public void removeConnection(org.littleshoot.mina.common.IoSession io)
SipTcpTransportLayer
removeConnection in interface SipTcpTransportLayerio - The connection to remove.
public SipClientTransaction invite(Invite request,
org.littleshoot.mina.common.IoSession io,
org.lastbamboo.common.offer.answer.OfferAnswerTransactionListener transactionListener)
SipTcpTransportLayer
invite in interface SipTcpTransportLayerrequest - The SIP message we're sending.io - The class for writing the message.transactionListener - Class that listens for transaction events.
public SipClientTransaction register(Register request,
org.littleshoot.mina.common.IoSession io,
org.lastbamboo.common.offer.answer.OfferAnswerTransactionListener transactionListener)
SipTcpTransportLayer
register in interface SipTcpTransportLayerrequest - The SIP message we're sending.io - The class for writing the message.transactionListener - Class that listens for transaction events.
public void writeRequestStatelessly(Invite request,
org.littleshoot.mina.common.IoSession io)
SipTcpTransportLayer
writeRequestStatelessly in interface SipTcpTransportLayerrequest - The SIP request to write.io - The class that will write hte message.
public boolean writeResponse(InetSocketAddress socketAddress,
SipResponse response)
SipTcpTransportLayer
writeResponse in interface SipTcpTransportLayersocketAddress - The address and port remote of the client to send
the response to.response - The response to send.
true of we successfull processed the
response and passed it to the network for transport, otherwise
false.public org.littleshoot.mina.common.WriteFuture writeCrlfKeepAlive(org.littleshoot.mina.common.IoSession io)
SipTcpTransportLayer
writeCrlfKeepAlive in interface SipTcpTransportLayerio - The reader/writer to write the messages over.
public void writeResponse(SipResponse response)
throws IOException
SipTcpTransportLayer
writeResponse in interface SipTcpTransportLayerresponse - The response to write.
IOException - If we could not route the response for any reason.public boolean hasConnectionForAny(Collection<InetSocketAddress> socketAddresses)
SipTcpTransportLayer
hasConnectionForAny in interface SipTcpTransportLayersocketAddresses - The collection of socket addresses to look for.
true if there is a connection to any of the
specified addresses, otherwise false.
public void writeRequest(Collection<InetSocketAddress> socketAddresses,
Invite request)
SipTcpTransportLayer
writeRequest in interface SipTcpTransportLayersocketAddresses - The socket addresses to attempt to send a
message to.request - The request to send.public void operationComplete(org.littleshoot.mina.common.IoFuture future)
operationComplete in interface org.littleshoot.mina.common.IoFutureListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||