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


java.lang.Object
   gov.nist.core.GenericObject
      gov.nist.siplite.message.Message
         gov.nist.siplite.message.Request

Request
final public class Request extends Message (Code)
The SIP Request structure-- this belongs to the parser who fills it up.
version:
   JAIN-SIP-1.1
version:
   This code is in the public domain.


Field Summary
final public static  StringACK
     Acknowledgement request.
final public static  StringBYE
     End of session request.
final public static  StringCANCEL
     Terminate session request.
final public static  StringDEFAULT_METHOD
     Default method is to intiate an INVITE.
final public static  StringDEFAULT_TRANSPORT
     Default transport is "udp".
final public static  intDEFAULT_TTL
     Default time to live is 1 second.
final public static  StringDEFAULT_USER
     Default user name is "ip".
final public static  StringINFO
     Basic information request.
final public static  StringINVITE
     Invitation request.
final public static  StringMESSAGE
     Message request.
final public static  StringNOTIFY
     Notification request.
final public static  StringOPTIONS
     Optional settings request.
final public static  StringPRACK
     PRACK ??? RFC.
final public static  StringPUBLISH
     Publish request.
final public static  StringREFER
     Redirection request.
final public static  StringREGISTER
     Regsitration request.
final public static  StringSUBSCRIBE
     Subscription for notification request.
final public static  StringUPDATE
     Update request.
protected  RequestLinerequestLine
     Current requestline.

Constructor Summary
public  Request()
     Constructor.

Method Summary
protected  voidcheckHeaders()
     Checks header for constraints.
public  Objectclone()
     Makes a clone (deep copy) of this object.
public  RequestcreateACKRequest()
     Creates an ACK request from this request.
public  RequestcreateAckRequest(ToHeader responseToHeader)
     Creates a default ACK Request message for this original request. Note that the defaultACK Request does not include the content of the original Request.
public  RequestcreateBYERequest(boolean switchHeaders)
     Creates a BYE request from this request.
Parameters:
  switchHeaders - is a boolean flag that causes from andisServerTransaction to headers to be swapped.
public  RequestcreateCancelRequest()
     Creates a default SIPResquest message that would cancel this request.
public  RequestcreateRequest(RequestLine requestLine, boolean switchHeaders)
     Creates a new default Request from the original request.
public  ResponsecreateResponse(int statusCode)
     Creates a default Response message for this request.
public  ResponsecreateResponse(int statusCode, String reasonPhrase)
     Creates a default Response message for this request.
public  Stringencode()
     Encodes the SIP Request as a string.
public  byte[]encodeAsBytes()
     Encodes this into a byte array.
public  booleanequals(Object other)
     Compares for equality.
Parameters:
  other - object to compare ourselves with.
public  AcceptContactHeadergetAcceptContact()
     Gets the Accept-Contact header (null if one does not exist).
public  StringgetFirstLine()
     Gets the first line encoded.
public  StringgetMethod()
     Gets the method from the request line.
public  RequestLinegetRequestLine()
     Gets the Request Line of the Request.
public  URIgetRequestURI()
     A conveniance function to access the Request URI.
public  StringgetSIPVersion()
     Gets the SIP version.
public  ObjectgetTransaction()
     Gets the transaction pointer.
public  StringgetViaHost()
     Gets the host from the topmost via header.
public  intgetViaPort()
     Gets the port from the topmost via header.
protected  voidsetDefaults()
     Sets the default values in the request URI if necessary.
public  voidsetMethod(String method)
     Sets the method.
public  voidsetRequestLine(RequestLine requestLine)
     Sets the request line of the SIP Request.
protected  voidsetRequestLineDefaults()
     Patch up the request line as necessary.
public  voidsetRequestURI(URI uri)
     Sets the RequestURI of Request.
public  voidsetSIPVersion(String sipVersion)
     Sets the sip version.
public  voidsetTransaction(Object transaction)
     Sets the transaction pointer.
public  StringtoString()
     Alias for encode above.

Field Detail
ACK
final public static String ACK(Code)
Acknowledgement request.



BYE
final public static String BYE(Code)
End of session request.



CANCEL
final public static String CANCEL(Code)
Terminate session request.



DEFAULT_METHOD
final public static String DEFAULT_METHOD(Code)
Default method is to intiate an INVITE.



DEFAULT_TRANSPORT
final public static String DEFAULT_TRANSPORT(Code)
Default transport is "udp".



DEFAULT_TTL
final public static int DEFAULT_TTL(Code)
Default time to live is 1 second.



DEFAULT_USER
final public static String DEFAULT_USER(Code)
Default user name is "ip".



INFO
final public static String INFO(Code)
Basic information request.



INVITE
final public static String INVITE(Code)
Invitation request.



MESSAGE
final public static String MESSAGE(Code)
Message request.



NOTIFY
final public static String NOTIFY(Code)
Notification request.



OPTIONS
final public static String OPTIONS(Code)
Optional settings request.



PRACK
final public static String PRACK(Code)
PRACK ??? RFC.



PUBLISH
final public static String PUBLISH(Code)
Publish request.



REFER
final public static String REFER(Code)
Redirection request.



REGISTER
final public static String REGISTER(Code)
Regsitration request.



SUBSCRIBE
final public static String SUBSCRIBE(Code)
Subscription for notification request.



UPDATE
final public static String UPDATE(Code)
Update request.



requestLine
protected RequestLine requestLine(Code)
Current requestline.




Constructor Detail
Request
public Request()(Code)
Constructor.




Method Detail
checkHeaders
protected void checkHeaders() throws ParseException(Code)
Checks header for constraints.
 (1) Invite options and bye requests can only have SIP URIs in the
 contact headers.
 (2) Request must have cseq, to and from and via headers.
 (3) Method in request URI must match that in CSEQ.
 



clone
public Object clone()(Code)
Makes a clone (deep copy) of this object. You can use this if you want to modify a request while preserving the original a deep copy of this object.



createACKRequest
public Request createACKRequest() throws SipException(Code)
Creates an ACK request from this request. This is suitable for generating an ACK for an INVITE client transaction. an ACK request that is generated from this request.
throws:
  SipException - if the request can't be created.



createAckRequest
public Request createAckRequest(ToHeader responseToHeader) throws SipException(Code)
Creates a default ACK Request message for this original request. Note that the defaultACK Request does not include the content of the original Request. If responseToHeader is null then the toHeader of this request is used to construct the ACK. Note that tag fields are just copied from the original SIP Request. Added by Jeff Keyser.
Parameters:
  responseToHeader - To header to use for this request. A Request with an ACK method.
throws:
  SipException - if the request can't be created.



createBYERequest
public Request createBYERequest(boolean switchHeaders) throws SipException(Code)
Creates a BYE request from this request.
Parameters:
  switchHeaders - is a boolean flag that causes from andisServerTransaction to headers to be swapped. Set thisto true if you are the server of the dialog and are generatinga BYE request for the dialog. a new default BYE request.
throws:
  SipException - if the request can't be created.



createCancelRequest
public Request createCancelRequest() throws SipException(Code)
Creates a default SIPResquest message that would cancel this request. Note that tag assignment and removal of is left to the caller (we use whatever tags are present in the original request). Acknowledgement: Added by Jeff Keyser. A CANCEL Request with a copy all the original headersfrom this request except for Require, ProxyRequire.
throws:
  SipException - if the request can't be created.



createRequest
public Request createRequest(RequestLine requestLine, boolean switchHeaders) throws SipException(Code)
Creates a new default Request from the original request. Warning: the newly created Request, shares the headers of this request but we generate any new headers that we need to modify so the original request is umodified. However, if you modify the shared headers after this request is created, then the newly created request will also be modified. If you want to modify the original request without affecting the returned Request make sure you clone it before calling this method. Following are the differences between the original request headers and the generated request headers.
  • Contact headers are not included in the newly created request. Setting the appropriate sequence number is the responsibility of the caller.
  • RouteList is not copied for ACK and CANCEL
  • Note that we DO NOT copy the body of the argument into the returned header. We do not copy the content type header from the original request either. These have to be added seperately and the content length has to be correctly set if necessary the content length is set to 0 in the returned header.
  • Contact List is not copied from the original request.
  • RecordRoute List is not included from original request.
  • Via header is not included from the original request.

Parameters:
  requestLine - is the new request line.
Parameters:
  switchHeaders - is a boolean flag that causes to and fromheaders to switch (set this to true if you are theserver of the transaction and are generating a BYErequest). If the headers are switched, we generatenew FromHeader and To headers otherwise we just use theincoming headers. a new Default SIP Request which has the requestLine specified.
throws:
  SipException - if the request can't be created.



createResponse
public Response createResponse(int statusCode)(Code)
Creates a default Response message for this request. Note You must add the necessary tags to outgoing responses if need be. For efficiency, this method does not clone the incoming request. If you want to modify the outgoing response, be sure to clone the incoming request as the headers are shared and any modification to the headers of the outgoing response will result in a modification of the incoming request. Tag fields are just copied from the incoming request. Contact headers are removed from the incoming request. Added by Jeff Keyser.
Parameters:
  statusCode - Status code for the response.Reason phrase is generated. A Response with the status and reason supplied, and a copyof all the original headers from this request.



createResponse
public Response createResponse(int statusCode, String reasonPhrase) throws IllegalArgumentException(Code)
Creates a default Response message for this request. Note You must add the necessary tags to outgoing responses if need be. For efficiency, this method does not clone the incoming request. If you want to modify the outgoing response, be sure to clone the incoming request as the headers are shared and any modification to the headers of the outgoing response will result in a modification of the incoming request. Tag fields are just copied from the incoming request. Contact headers are removed from the incoming request. Added by Jeff Keyser. Route headers are not added to the response.
Parameters:
  statusCode - Status code for the response.
Parameters:
  reasonPhrase - Reason phrase for this response. A Response with the status and reason supplied.
throws:
  IllegalArgumentException - if some argument has an invalid value.



encode
public String encode()(Code)
Encodes the SIP Request as a string. an encoded String containing the encoded SIP Message.



encodeAsBytes
public byte[] encodeAsBytes()(Code)
Encodes this into a byte array. This is used when the body has been set as a binary array and you want to encode the body as a byte array for transmission. a byte array containing the Request encoded as a bytearray.



equals
public boolean equals(Object other)(Code)
Compares for equality.
Parameters:
  other - object to compare ourselves with. true if objects match



getAcceptContact
public AcceptContactHeader getAcceptContact()(Code)
Gets the Accept-Contact header (null if one does not exist). Accept-Contact header



getFirstLine
public String getFirstLine()(Code)
Gets the first line encoded. a string containing the encoded request line.



getMethod
public String getMethod()(Code)
Gets the method from the request line. the method from the request line if the method exits andnull if the request line or the method does not exist.



getRequestLine
public RequestLine getRequestLine()(Code)
Gets the Request Line of the Request. the request line of the SIP Request.



getRequestURI
public URI getRequestURI()(Code)
A conveniance function to access the Request URI. the requestURI if it exists.



getSIPVersion
public String getSIPVersion()(Code)
Gets the SIP version. the SIP version from the request line.



getTransaction
public Object getTransaction()(Code)
Gets the transaction pointer. the transaction pointer



getViaHost
public String getViaHost()(Code)
Gets the host from the topmost via header. the string representation of the host from the topmost viaheader.



getViaPort
public int getViaPort()(Code)
Gets the port from the topmost via header. the port from the topmost via header (5060 if there isno port indicated).



setDefaults
protected void setDefaults()(Code)
Sets the default values in the request URI if necessary.



setMethod
public void setMethod(String method) throws IllegalArgumentException(Code)
Sets the method.
Parameters:
  method - is the method to set.
throws:
  IllegalArgumentException - if the method is null



setRequestLine
public void setRequestLine(RequestLine requestLine)(Code)
Sets the request line of the SIP Request.
Parameters:
  requestLine - is the request line to set in the SIP Request.



setRequestLineDefaults
protected void setRequestLineDefaults()(Code)
Patch up the request line as necessary.



setRequestURI
public void setRequestURI(URI uri)(Code)
Sets the RequestURI of Request. The Request-URI is a SIP or SIPS URI or a general URI. It indicates the user or service to which this request is being addressed. SIP elements MAY support Request-URIs with schemes other than "sip" and "sips", for example the "tel" URI scheme. SIP elements MAY translate non-SIP URIs using any mechanism at their disposal, resulting in SIP URI, SIPS URI, or some other scheme.
Parameters:
  uri - the new Request URI of this request message



setSIPVersion
public void setSIPVersion(String sipVersion) throws ParseException(Code)
Sets the sip version.
Parameters:
  sipVersion - the sip version to set.



setTransaction
public void setTransaction(Object transaction)(Code)
Sets the transaction pointer.
Parameters:
  transaction - thenew transaction pointer



toString
public String toString()(Code)
Alias for encode above. encoded string of object contents



Fields inherited from gov.nist.siplite.message.Message
final protected static String DEFAULT_ENCODING(Code)(Java Doc)
protected CSeqHeader cSeqHeader(Code)(Java Doc)
protected CallIdHeader callIdHeader(Code)(Java Doc)
protected ContentLengthHeader contentLengthHeader(Code)(Java Doc)
protected FromHeader fromHeader(Code)(Java Doc)
protected Vector headers(Code)(Java Doc)
protected String messageContent(Code)(Java Doc)
protected byte[] messageContentBytes(Code)(Java Doc)
protected Object messageContentObject(Code)(Java Doc)
protected ToHeader toHeader(Code)(Java Doc)
protected Vector unrecognizedHeaders(Code)(Java Doc)

Methods inherited from gov.nist.siplite.message.Message
public void addHeader(Header sipHeader) throws SipException(Code)(Java Doc)
public void addHeader(String sipHeader) throws SipException(Code)(Java Doc)
public void addUnparsed(String unparsed)(Code)(Java Doc)
public void attachHeader(Header h, boolean replaceflag) throws SipException(Code)(Java Doc)
public void attachHeader(Header header, boolean replaceFlag, boolean top) throws SipException(Code)(Java Doc)
public Object clone()(Code)(Java Doc)
public String encode()(Code)(Java Doc)
public byte[] encodeAsBytes()(Code)(Java Doc)
public boolean equals(Object other)(Code)(Java Doc)
public CSeqHeader getCSeqHeader()(Code)(Java Doc)
public int getCSeqHeaderNumber()(Code)(Java Doc)
public CallIdHeader getCallId()(Code)(Java Doc)
public String getCallIdentifier()(Code)(Java Doc)
public ContactList getContactHeaders()(Code)(Java Doc)
public Object getContent()(Code)(Java Doc)
public ContentLengthHeader getContentLengthHeader()(Code)(Java Doc)
public ContentTypeHeader getContentTypeHeader()(Code)(Java Doc)
public String getDialogId(boolean isServer)(Code)(Java Doc)
public String getDialogId(boolean isServer, String toTag)(Code)(Java Doc)
abstract public String getFirstLine()(Code)(Java Doc)
public FromHeader getFromHeader()(Code)(Java Doc)
public String getFromHeaderTag()(Code)(Java Doc)
public Header getHeader(String headerName)(Code)(Java Doc)
public HeaderList getHeaderList(String headerName)(Code)(Java Doc)
public Enumeration getHeaderNames()(Code)(Java Doc)
public Enumeration getHeaders()(Code)(Java Doc)
public Enumeration getHeaders(String headerName)(Code)(Java Doc)
public String getMessageContent() throws UnsupportedEncodingException(Code)(Java Doc)
public byte[] getRawContent()(Code)(Java Doc)
public RecordRouteList getRecordRouteHeaders()(Code)(Java Doc)
public RouteList getRouteHeaders()(Code)(Java Doc)
abstract public String getSIPVersion()(Code)(Java Doc)
public ToHeader getTo()(Code)(Java Doc)
public String getToTag()(Code)(Java Doc)
public ViaHeader getTopmostVia()(Code)(Java Doc)
public String getTransactionId()(Code)(Java Doc)
public Enumeration getUnrecognizedHeaders()(Code)(Java Doc)
public ViaList getViaHeaders()(Code)(Java Doc)
public boolean hasContent()(Code)(Java Doc)
public boolean hasFromHeaderTag()(Code)(Java Doc)
public boolean hasHeader(String headerName)(Code)(Java Doc)
public boolean hasToTag()(Code)(Java Doc)
public static boolean isRequestHeader(Header sipHeader)(Code)(Java Doc)
public static boolean isResponseHeader(Header sipHeader)(Code)(Java Doc)
public void removeContent()(Code)(Java Doc)
public void removeHeader(String headerName, boolean top)(Code)(Java Doc)
public void removeHeader(String headerName)(Code)(Java Doc)
public void setCSeqHeader(CSeqHeader cseqHeader) throws SipException(Code)(Java Doc)
public void setCallId(CallIdHeader callId) throws SipException(Code)(Java Doc)
public void setCallId(String callId) throws ParseException, SipException(Code)(Java Doc)
public void setContent(Object content, ContentTypeHeader contentTypeHeader) throws SipException(Code)(Java Doc)
public void setContent(Object content)(Code)(Java Doc)
public void setContentLength(ContentLengthHeader contentLength) throws SipException(Code)(Java Doc)
public void setFromHeader(FromHeader from) throws SipException(Code)(Java Doc)
public void setFromHeaderTag(String tag) throws SipException(Code)(Java Doc)
public void setHeader(Header header) throws IllegalArgumentException, SipException(Code)(Java Doc)
public void setHeader(HeaderList sipHeaderList) throws SipException(Code)(Java Doc)
public void setHeaders(Vector headers) throws SipException(Code)(Java Doc)
public void setMessageContent(String type, String subType, String messageContent) throws IllegalArgumentException(Code)(Java Doc)
public void setMessageContent(String type, String subType, byte[] messageContent) throws SipException(Code)(Java Doc)
public void setMessageContent(String content)(Code)(Java Doc)
public void setMessageContent(byte[] content)(Code)(Java Doc)
abstract public void setSIPVersion(String sipVersion) throws ParseException(Code)(Java Doc)
public void setTo(ToHeader to) throws SipException(Code)(Java Doc)
public void setToTag(String tag) throws SipException(Code)(Java Doc)
public void setVia(ViaList viaList) throws SipException(Code)(Java Doc)
public void setVia(Vector viaList) throws SipException(Code)(Java Doc)

Methods inherited from gov.nist.core.GenericObject
abstract public Object clone()(Code)(Java Doc)
public static int compareToIgnoreCase(String s1, String s2)(Code)(Java Doc)
abstract public String encode()(Code)(Java Doc)
public static boolean equalsIgnoreCase(String s1, String s2)(Code)(Java Doc)

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.