| |
|
| java.lang.Object gov.nist.siplite.SipProvider
Constructor Summary | |
protected | SipProvider(SipStack sipStack) Creates a new instance of SipProvider. |
isActive | protected boolean isActive(Code) | | Flag to indicate the provider is active.
|
SipProvider | protected SipProvider(SipStack sipStack)(Code) | | Creates a new instance of SipProvider.
Parameters: sipStack - the current SIP stack context |
addSipListener | public void addSipListener(SipListener sipListener) throws TooManyListenersException(Code) | | This method registers the SipListener object to this SipProvider, once
registered the SIP Listener can send events on the SipProvider and
recieve events emitted from the SipProvider. As JAIN SIP resticts a
unicast Listener special case, that is, that one and only one Listener
may be registered on the SipProvider concurrently.
If an attempt is made to re-register the existing SipListener this
method returns silently. A previous SipListener must be removed from the
SipProvider before another SipListener can be registered to
the SipProvider.
Parameters: sipListener - to be registered with theProvider. throws: TooManyListenersException - this exception is thrown when a newSipListener attempts to register with the SipProvider when anotherSipListener is already registered with this SipProvider. |
equals | public boolean equals(Object obj)(Code) | | Compares to this instance for equivalence.
Parameters: obj - object for comparison true if the object is the same |
equipADialogForTransaction | public void equipADialogForTransaction(ServerTransaction transaction, Request sipRequest)(Code) | | Find or create a dialog with the dialog-id obtained from the request.
Initializing the dialog's route information.
Bind the dialog and the transaction to each other.
Parameters: transaction - trasaction for the request Parameters: sipRequest - request whose tags are the source of dialog-IDand route information |
getListeningPoint | public ListeningPoint getListeningPoint()(Code) | | Returns the ListeningPoint of this SipProvider.
A SipProvider has a single Listening Point at any specific point in time.
See Also: ListeningPoint the ListeningPoint of this SipProvider |
getNewCallId | public CallIdHeader getNewCallId()(Code) | | Returns a unique CallIdHeader for identifying dialogues between two
SIP applications.
new CallId unique within the SIP Stack. |
getNewClientTransaction | public ClientTransaction getNewClientTransaction(Request request) throws TransactionUnavailableException(Code) | | Once an application wants to a send a new request it must first request
a new client transaction identifier. This method is called by an
application to create the client transaction befores it sends the Request
via the SipProvider on that transaction. This methods returns a new
unique client transaction identifier that can be passed to the stateful
sendRequest method on the SipProvider and the sendAck/sendBye
methods on the Dialog in order to send a request.
Parameters: request - the new Request message that is to handledstatefully by the Provider. a new unique client transation identifier See Also: ClientTransaction since: v1.1 |
getNewServerTransaction | public ServerTransaction getNewServerTransaction(Request request) throws TransactionAlreadyExistsException, TransactionUnavailableException(Code) | | An application has the responsibility of deciding to respond to a
Request that does not match an existing server transaction. The method
is called by an application that decides to respond to an unmatched
Request statefully. This methods return a new unique server transaction
identifier that can be passed to the stateful sendResponse methods in
order to respond to the request.
Parameters: request - the initial Request message that the doesn'tmatch an existingtransaction that the application decides to handle statefully. a new unique server transation identifier throws: TransactionAlreadyExistsException - if a transaction already existsthat is already handling this Request. This may happen if the applicationgets retransmits of the same request before the initial transaction isallocated. See Also: ServerTransaction since: v1.1 |
getSipStack | public SipStack getSipStack()(Code) | | Returns the SipStack that this SipProvider is attached to. A SipProvider
can only be attached to a single SipStack object which belongs to
the same SIP stack as the SipProvider.
See Also: SipStack the attached SipStack. |
handleEvent | public void handleEvent(SipEvent sipEvent, Transaction transaction)(Code) | | Handles the SIP event - because we have only one listener and we are
already in the context of a separate thread, we dont need to enque
the event and signal another thread.
Parameters: sipEvent - is the event to process. Parameters: transaction - the current transaction |
removeSipListener | public void removeSipListener(SipListener sipListener)(Code) | | Removes the SipListener from this SipProvider. This method returns
silently if the sipListener argument is not registered
with the SipProvider.
Parameters: sipListener - - the SipListener to be removed from thisSipProvider |
sendRequest | public void sendRequest(Request request) throws SipException(Code) | | Sends specified Request and returns void i.e.
no transaction record is associated with this action. This method
implies that the application is functioning statelessly specific to this
Request, hence the underlying SipProvider acts statelessly.
Once the Request message has been passed to this method, the SipProvider
will forget about this Request. No transaction semantics will be
associated with the Request and no retranmissions will occur on the
Request by the SipProvider, if these semantics are required it is the
responsibility of the application not the JAIN SIP Stack.
- Stateless Proxy - A stateless proxy simply forwards every request
it receives downstream and discards information about the request
message once the message has been forwarded. A stateless proxy does not
have any notion of a transaction.
since: v1.1 See Also: Request Parameters: request - - the Request message to send statelessly throws: SipException - if implementation cannot send request for any reason |
sendResponse | public void sendResponse(Response sipResponse) throws IOException, SipException(Code) | | Sends specified
Response and returns void i.e.
no transaction record is associated with this action. This method implies
that the application is functioning as either a stateless proxy or a
stateless User Agent Server.
- Stateless proxy - A stateless proxy simply forwards every response
it receives upstream and discards information about the response message
once the message has been forwarded. A stateless proxy does not
have any notion of a transaction.
- Stateless User Agent Server - A stateless UAS does not maintain
transaction state. It replies to requests normally, but discards
any state that would ordinarily be retained by a UAS after a response
has been sent. If a stateless UAS receives a retransmission of a
request, it regenerates the response and resends it, just as if it
were replying to the first instance of the request. A UAS cannot be
stateless unless the request processing for that method would always
result in the same response if the requests are identical. Stateless
UASs do not use a transaction layer; they receive requests directly
from the transport layer and send responses directly to the transport
layer.
See Also: Response Parameters: sipResponse - the Response to send statelessly. throws: IOException - if I/O error occured throws: SipException - if implementation cannot send response forany other reason See Also: Response since: v1.1 |
setListeningPoint | public void setListeningPoint(ListeningPoint listeningPoint)(Code) | | This method sets the listening point of the SipProvider.
A SipProvider can only have a single listening point at any
specific time. This method returns
silently if the same listeningPoint argument is re-set
on the SipProvider.
JAIN SIP supports recieving messages from
any port and interface that a server listens on for UDP, on that same
port and interface for TCP in case a message may need to be sent
using TCP, rather than UDP, if it is too large. In order to satisfy this
functionality an application must create two SipProviders and set
identical listeningPoints except for transport on each SipProvder.
Multiple SipProviders are prohibited to listen on the same
listening point.
Parameters: listeningPoint - of this SipProvider See Also: ListeningPoint since: v1.1 |
stop | protected void stop()(Code) | | Stops processing messages for this provider. Post an empty
message to our message processing queue that signals us to
quit.
|
transactionErrorEvent | public void transactionErrorEvent(SIPTransactionErrorEvent transactionErrorEvent)(Code) | | Invoked when an error has ocurred with a transaction.
Propagate up to the listeners.
Parameters: transactionErrorEvent - Error event. |
|
|
|