Java Doc for SipServerConnectionImpl.java in  » 6.0-JDK-Modules » j2me » gov » nist » microedition » sip » 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.microedition.sip 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   gov.nist.microedition.sip.SipServerConnectionImpl

SipServerConnectionImpl
public class SipServerConnectionImpl implements SipServerConnection(Code)
SIP ServerConnection implementation. This code is in the public domain.


Field Summary
final public static  intCOMPLETED
    
final public static  intINITIALIZED
    
final public static  intREQUEST_RECEIVED
     Request Received, SipServerConnection returned from SipConnectionNotifier or provisional response(s) (1xx) sent.
final public static  intSTREAM_OPEN
     Stream Open, OutputStream opened with openContentOutputStream().
final public static  intTERMINATED
    

Constructor Summary
protected  SipServerConnectionImpl(Request request, SipDialog sipDialog, SipConnectionNotifierImpl sipConnectionNotifierImpl)
     Constructor.

Method Summary
public  voidaddHeader(String name, String value)
     Adds a header to the SIP message.
public  voidclose()
     Closes the connection.
public  SipDialoggetDialog()
     Returns the current SIP dialog.
public  StringgetHeader(String name)
     Gets the header field value of specified header type.
Parameters:
  name - - name of the header type, either in full or compact form.RFC 3261 p.32 topmost header field value, or null if thecurrent message does not have such a header or the header is for otherreason not available (e.g.
public  String[]getHeaders(String name)
     Gets the header field value(s) of specified header type
Parameters:
  name - - name of the header, either in full or compact form.RFC 3261 p.32 array of header field values (topmost first), or null if thecurrent message does not have such a header or the header is for otherreason not available (e.g.
public  StringgetMethod()
     Gets the SIP method.
public  StringgetReasonPhrase()
     Gets SIP response reason phrase.
public  StringgetRequestURI()
     Gets Request-URI.
public  intgetState()
    
public  intgetStatusCode()
     Gets SIP response status code.
public  voidinitResponse(int code)
     Initializes SipServerConnection with a specific SIP response to the received request. The default headers and reason phrase will be initialized automatically. After this the SipServerConnection is in Initialized state. The response can be sent.
public  InputStreamopenContentInputStream()
     Returns InputStream to read SIP message body content. InputStream to read body content
throws:
  java.io.IOException - - if the InputStream can not be opened,because of an I/O error occurred.
throws:
  SipException - - INVALID_STATE the InputStream can not be openedin this state (e.g.
public  OutputStreamopenContentOutputStream()
     Returns OutputStream to fill the SIP message body content. When calling close() on OutputStream the message will be sent to the network.
public  voidremoveHeader(String name)
     Removes header from the SIP message.
public  voidsend()
    
public  voidsetHeader(String name, String value)
     Sets header value in SIP message.
public  voidsetReasonPhrase(String phrase)
     Changes the default reason phrase.

Field Detail
COMPLETED
final public static int COMPLETED(Code)
Completed, transaction completed with sending final response (2xx, 3xx, 4xx, 5xx, 6xx)



INITIALIZED
final public static int INITIALIZED(Code)
Initialized, response initialized calling initResponse()



REQUEST_RECEIVED
final public static int REQUEST_RECEIVED(Code)
Request Received, SipServerConnection returned from SipConnectionNotifier or provisional response(s) (1xx) sent.



STREAM_OPEN
final public static int STREAM_OPEN(Code)
Stream Open, OutputStream opened with openContentOutputStream(). Opening InputStream for received request does not trigger state transition.



TERMINATED
final public static int TERMINATED(Code)
Terminated, the final state, in which the SIP connection has been terminated by error or closed




Constructor Detail
SipServerConnectionImpl
protected SipServerConnectionImpl(Request request, SipDialog sipDialog, SipConnectionNotifierImpl sipConnectionNotifierImpl)(Code)
Constructor.
Parameters:
  request - the protocol connection request
Parameters:
  sipDialog - the current transaction state
Parameters:
  sipConnectionNotifierImpl - the notification handler




Method Detail
addHeader
public void addHeader(String name, String value) throws SipException, IllegalArgumentException(Code)
Adds a header to the SIP message. If multiple header field values exist the header value is added topmost of this type of headers. The implementations MAY restrict the access to some headers according to RFC 3261.
Parameters:
  name - - name of the header, either in full or compact form.RFC 3261 p.32
Parameters:
  value - - the header value
throws:
  SipException - - INVALID_STATE if header can not be added inthis state.
INVALID_OPERATION if the system does not allow to addthis header.
throws:
  IllegalArgumentException - - MAY be thrown if the header orvalue is invalid



close
public void close() throws IOException(Code)
Closes the connection.
exception:
  IOException - if an I/O error occurs
See Also:   javax.microedition.io.Connection.close



getDialog
public SipDialog getDialog()(Code)
Returns the current SIP dialog. This is available when the SipConnection belongs to a created SipDialog and the system has received (or sent) provisional (101-199) or final response (200). SipDialog object if this connection belongs to a dialog,otherwise returns null.



getHeader
public String getHeader(String name)(Code)
Gets the header field value of specified header type.
Parameters:
  name - - name of the header type, either in full or compact form.RFC 3261 p.32 topmost header field value, or null if thecurrent message does not have such a header or the header is for otherreason not available (e.g. message not initialized).



getHeaders
public String[] getHeaders(String name)(Code)
Gets the header field value(s) of specified header type
Parameters:
  name - - name of the header, either in full or compact form.RFC 3261 p.32 array of header field values (topmost first), or null if thecurrent message does not have such a header or the header is for otherreason not available (e.g. message not initialized).



getMethod
public String getMethod()(Code)
Gets the SIP method. Applicable when a message has been initialized or received. SIP method name REGISTER, INVITE, NOTIFY, etc. Returns null ifthe method is not available.



getReasonPhrase
public String getReasonPhrase()(Code)
Gets SIP response reason phrase. Available when SipClientConnection is in Proceeding or Completed state or when SipServerConnection is in Initialized state. reason phrase. Returns null if the reason phrase isnot available.



getRequestURI
public String getRequestURI()(Code)
Gets Request-URI. Available when SipClientConnection is in Initialized state or when SipServerConnection is in Request Received state. Built from the original URI given in Connector.open(). See RFC 3261 p.35 (8.1.1.1 Request-URI) Request-URI of the message. Returns null if the Request-URIis not available.



getState
public int getState()(Code)
Return the state of SIP server connection state of the SIP Server Connection



getStatusCode
public int getStatusCode()(Code)
Gets SIP response status code. Available when SipClientConnection is in Proceeding or Completed state or when SipServerConnection is in Initialized state. status code 1xx, 2xx, 3xx, 4xx, ... Returns 0 if the status codeis not available.



initResponse
public void initResponse(int code) throws IllegalArgumentException, SipException(Code)
Initializes SipServerConnection with a specific SIP response to the received request. The default headers and reason phrase will be initialized automatically. After this the SipServerConnection is in Initialized state. The response can be sent. The procedure of generating the response and header fields is defined in RFC 3261 [1] p. 49-50. At least following information is set by the method: From MUST equal the From header field of the request Call-ID MUST equal the Call-ID header field of the request CSeq MUST equal the CSeq field of the request Via MUST equal the Via header field values in the request and MUST maintain the same ordering To MUST Copy if exists in the original request, 'tag' MUST be added if not present Furthermore, if the system has automatically sent the 100 Trying response, the 100 response initialized and sent by the user is just ignored.
Parameters:
  code - - Response status code 1xx - 6xx
throws:
  IllegalArgumentException - - if the status code is out ofrange 100-699 (RFC 3261 p.28-29)
throws:
  SipException - - INVALID_STATE if the response can not beinitialized, because of wrong state.



openContentInputStream
public InputStream openContentInputStream() throws IOException, SipException(Code)
Returns InputStream to read SIP message body content. InputStream to read body content
throws:
  java.io.IOException - - if the InputStream can not be opened,because of an I/O error occurred.
throws:
  SipException - - INVALID_STATE the InputStream can not be openedin this state (e.g. no message received).



openContentOutputStream
public OutputStream openContentOutputStream() throws IOException, SipException(Code)
Returns OutputStream to fill the SIP message body content. When calling close() on OutputStream the message will be sent to the network. So it is equivalent to call send(). Again send() must not be called after closing the OutputStream, since it will throw Exception because of calling the method in wrong state. Before opening OutputStream the Content-Length and Content-Type headers has to se set. If not SipException.UNKNOWN_LENGTH or SipException.UNKNOWN_TYPE will be thrown respectively. OutputStream to write body content
throws:
  IOException - if the OutputStream can not be opened,because of an I/O error occurred.
throws:
  SipException - INVALID_STATE the OutputStream can not be openedin this state (e.g. no message initialized).UNKNOWN_LENGTH Content-Length header not set.UNKNOWN_TYPE Content-Type header not set.



removeHeader
public void removeHeader(String name) throws SipException, IllegalArgumentException(Code)
Removes header from the SIP message. If multiple header field values exist the topmost is removed. The implementations MAY restrict the access to some headers according to RFC 3261. If the named header is not found this method does nothing.
Parameters:
  name - - name of the header to be removed, either intfull or compact form RFC 3261 p.32.
throws:
  SipException - - INVALID_STATE if header can not be removed inthis state.
INVALID_OPERATION if the system does not allow to removethis header.



send
public void send() throws IOException, InterruptedIOException, SipException(Code)
(non-Javadoc)
See Also:   javax.microedition.sip.SipConnection.send



setHeader
public void setHeader(String name, String value) throws SipException, IllegalArgumentException(Code)
Sets header value in SIP message. If the header does not exist it will be added to the message, otherwise the existing header is overwritten. If multiple header field values exist the topmost is overwritten. The implementations MAY restrict the access to some headers according to RFC 3261.
Parameters:
  name - - name of the header, either in full or compact form.RFC 3261 p.32
Parameters:
  value - - the header value
throws:
  SipException - - INVALID_STATE if header can not be set inthis state.
INVALID_OPERATION if the system does not allow to setthis header.
throws:
  IllegalArgumentException - - MAY be thrown if the header orvalue is invalid



setReasonPhrase
public void setReasonPhrase(String phrase) throws SipException, IllegalArgumentException(Code)
Changes the default reason phrase.
Parameters:
  phrase - the default reason phrase.
throws:
  SipException - INVALID_STATE if the response can notbe initialized, because of wrong state.INVALID_OPERATION if the reason phrase can not be set.
throws:
  IllegalArgumentException - if the reason phrase is illegal.



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.