Java Doc for SipProvider.java in  » 6.0-JDK-Modules » j2me » gov » nist » siplite » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » gov.nist.siplite 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   gov.nist.siplite.SipProvider

SipProvider
final public class SipProvider implements SIPTransactionEventListener(Code)
Implementation of the JAIN-SIP provider interface.
version:
   JAIN-SIP-1.1
version:
  
version:
   This code is in the public domain.


Field Summary
protected  ServerTransactioncurrentTransaction
     Curent server transactions.
protected  booleanisActive
     Flag to indicate the provider is active.
protected  ListeningPointlisteningPoint
     Current event listening filter.
protected  SipListenersipListener
     Current SIP listener.
protected  SipStacksipStack
     Current SIP Stack context.

Constructor Summary
protected  SipProvider(SipStack sipStack)
     Creates a new instance of SipProvider.

Method Summary
public  voidaddSipListener(SipListener sipListener)
     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.
public  booleanequals(Object obj)
     Compares to this instance for equivalence.
public  voidequipADialogForTransaction(ServerTransaction transaction, Request sipRequest)
     Find or create a dialog with the dialog-id obtained from the request.
public  ListeningPointgetListeningPoint()
     Returns the ListeningPoint of this SipProvider.
public  CallIdHeadergetNewCallId()
     Returns a unique CallIdHeader for identifying dialogues between two SIP applications.
public  ClientTransactiongetNewClientTransaction(Request request)
     Once an application wants to a send a new request it must first request a new client transaction identifier.
public  ServerTransactiongetNewServerTransaction(Request request)
     An application has the responsibility of deciding to respond to a Request that does not match an existing server transaction.
public  SipStackgetSipStack()
     Returns the SipStack that this SipProvider is attached to.
public  voidhandleEvent(SipEvent sipEvent, Transaction transaction)
     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.
public  voidremoveSipListener(SipListener sipListener)
     Removes the SipListener from this SipProvider.
public  voidsendRequest(Request request)
     Sends specified Request and returns void i.e. no transaction record is associated with this action.
public  voidsendResponse(Response sipResponse)
     Sends specified Response and returns void i.e. no transaction record is associated with this action.
public  voidsetListeningPoint(ListeningPoint listeningPoint)
     This method sets the listening point of the SipProvider. A SipProvider can only have a single listening point at any specific time.
protected  voidstop()
     Stops processing messages for this provider.
public  voidtransactionErrorEvent(SIPTransactionErrorEvent transactionErrorEvent)
     Invoked when an error has ocurred with a transaction.

Field Detail
currentTransaction
protected ServerTransaction currentTransaction(Code)
Curent server transactions.



isActive
protected boolean isActive(Code)
Flag to indicate the provider is active.



listeningPoint
protected ListeningPoint listeningPoint(Code)
Current event listening filter.



sipListener
protected SipListener sipListener(Code)
Current SIP listener.



sipStack
protected SipStack sipStack(Code)
Current SIP Stack context.




Constructor Detail
SipProvider
protected SipProvider(SipStack sipStack)(Code)
Creates a new instance of SipProvider.
Parameters:
  sipStack - the current SIP stack context




Method Detail
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.



Methods inherited from java.lang.Object
public boolean equals(Object obj)(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.