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


java.lang.Object
   gov.nist.siplite.parser.StringMsgParser

StringMsgParser
public class StringMsgParser (Code)
Parse SIP message and parts of SIP messages such as URI's etc from memory and return a structure. Intended use: UDP message processing. This class is used when you have an entire SIP message or Header or SIP URL in memory and you want to generate a parsed structure from it. For SIP messages, the payload can be binary or String. If you have a binary payload, use parseMessage(byte[]) else use parseSIPMessage(String) The payload is accessible from the parsed message using the getContent and getContentBytes methods provided by the Message class. Currently only eager parsing of the message is supported (i.e. the entire message is parsed in one feld swoop).
version:
   JAIN-SIP-1.1
version:
   This code is in the public domain.


Field Summary
protected  intcontentLength
     Lengthg of current message body.
protected  booleanreadBody
     Flag indicating body read requested.

Constructor Summary
public  StringMsgParser()
     Default constructor.
public  StringMsgParser(ParseExceptionListener exhandler)
     Constructor (given a parse exception handler).

Method Summary
protected  byte[]getBodyAsBytes()
     Gets the message body as a byte array.
public  StringgetCurrentHeader()
     Gets the current header.
public  intgetCurrentLineNumber()
     Gets the current line number.
protected  StringgetMessageBody()
     Gets the message body.
protected  booleanisBodyString()
     Returns true if the body is encoded as a string.
public  AddressparseAddress(String address)
     Parses an address (nameaddr or address spec) and return and address structure.
Parameters:
  address - is a String containing the address to be parsed.
public  HeaderparseHeader(String header)
     Parses an individual SIP message header from a string.
Parameters:
  header - String containing the SIP header.
public  HostparseHost(String host)
     Parse a host name and return a parsed structure.
public  HostPortparseHostPort(String hostport)
     Parses a host:port and return a parsed structure.
public  RequestLineparseRequestLine(String requestLine)
     Parses the SIP Request Line
Parameters:
  requestLine - a String containing the request line to be parsed.
public  MessageparseSIPMessage(byte[] msgBuffer)
     Parses a buffer containing a single SIP Message where the body is an array of un-interpreted bytes.
public  MessageparseSIPMessage(String sipMessages)
     Parses a buffer containing one or more SIP Messages and return an array of Message parsed structures.
public  StatusLineparseSIPStatusLine(String statusLine)
     Parses the SIP Response message status line
Parameters:
  statusLine - a String containing the Status line to be parsed.
public  SipURIparseSIPUrl(String url)
     Parses a SIP url from a string and return a URI structure for it.
Parameters:
  url - a String containing the URI structure to be parsed.
public  TelephoneNumberparseTelephoneNumber(String telephone_number)
     Parses a telephone number return a parsed structure.
public  URIparseUrl(String url)
     Parses a uri from a string and return a URI structure for it.
Parameters:
  url - a String containing the URI structure to be parsed.
protected  byte[]readBytesToEnd()
     Returns the bytes to the end of the message.
protected  StringreadToEnd()
     Returns the contents till the end of the buffer (this is useful when you encounter an error.
public  voidsetParseExceptionListener(ParseExceptionListener pexhandler)
     Adds a handler for header parsing errors.

Field Detail
contentLength
protected int contentLength(Code)
Lengthg of current message body.



readBody
protected boolean readBody(Code)
Flag indicating body read requested.




Constructor Detail
StringMsgParser
public StringMsgParser()(Code)
Default constructor.



StringMsgParser
public StringMsgParser(ParseExceptionListener exhandler)(Code)
Constructor (given a parse exception handler).
since:
   1.0
Parameters:
  exhandler - is the parse exception listener for the message parser.




Method Detail
getBodyAsBytes
protected byte[] getBodyAsBytes()(Code)
Gets the message body as a byte array. the mesage body



getCurrentHeader
public String getCurrentHeader()(Code)
Gets the current header. the current header



getCurrentLineNumber
public int getCurrentLineNumber()(Code)
Gets the current line number. the current line number



getMessageBody
protected String getMessageBody()(Code)
Gets the message body. the message body



isBodyString
protected boolean isBodyString()(Code)
Returns true if the body is encoded as a string. If the parseMessage(String) method is invoked then the body is assumed to be a string. true if body is a string



parseAddress
public Address parseAddress(String address) throws ParseException(Code)
Parses an address (nameaddr or address spec) and return and address structure.
Parameters:
  address - is a String containing the address to be parsed. a parsed address structure.
since:
   v1.0
exception:
  ParseException - when the address is badly formatted.



parseHeader
public Header parseHeader(String header) throws ParseException(Code)
Parses an individual SIP message header from a string.
Parameters:
  header - String containing the SIP header. a Header structure.
exception:
  ParseException - if there was an error parsing the message.



parseHost
public Host parseHost(String host) throws ParseException(Code)
Parse a host name and return a parsed structure.
Parameters:
  host - is a String containing the host name to be parsed a parsed address structure.
since:
   v1.0
exception:
  ParseException - when the hostname is badly formatted.



parseHostPort
public HostPort parseHostPort(String hostport) throws ParseException(Code)
Parses a host:port and return a parsed structure.
Parameters:
  hostport - is a String containing the host:port to be parsed a parsed address structure.
since:
   v1.0
exception:
  ParseException - when the address is badly formatted.



parseRequestLine
public RequestLine parseRequestLine(String requestLine) throws ParseException(Code)
Parses the SIP Request Line
Parameters:
  requestLine - a String containing the request line to be parsed. a RequestLine structure that has the parsed RequestLine
exception:
  ParseException - if there was an error parsing the requestLine.



parseSIPMessage
public Message parseSIPMessage(byte[] msgBuffer) throws ParseException(Code)
Parses a buffer containing a single SIP Message where the body is an array of un-interpreted bytes. This is intended for parsing the message from a memory buffer when the buffer. Incorporates a bug fix for a bug that was noted by Will Sullin of Callcast
Parameters:
  msgBuffer - a byte buffer containing the messages to be parsed.This can consist of multiple SIP Messages concatenated together. a Message[] structure (request or response)containing the parsed SIP message.
exception:
  ParseException - is thrown when anillegal message has been encountered (andthe rest of the buffer is discarded).
See Also:   ParseExceptionListener



parseSIPMessage
public Message parseSIPMessage(String sipMessages) throws ParseException(Code)
Parses a buffer containing one or more SIP Messages and return an array of Message parsed structures. Note that the current limitation is that this does not handle content encoding properly. The message content is just assumed to be encoded using the same encoding as the sip message itself (i.e. binary encodings such as gzip are not supported).
Parameters:
  sipMessages - a String containing the messages to be parsed.This can consist of multiple SIP Messages concatenated together. a Message structure (request or response)containing the parsed SIP message.
exception:
  ParseException - is thrown when anillegal message has been encountered (andthe rest of the buffer is discarded).
See Also:   ParseExceptionListener



parseSIPStatusLine
public StatusLine parseSIPStatusLine(String statusLine) throws ParseException(Code)
Parses the SIP Response message status line
Parameters:
  statusLine - a String containing the Status line to be parsed. StatusLine class corresponding to message
exception:
  ParseException - if there was an error parsing
See Also:   StatusLine



parseSIPUrl
public SipURI parseSIPUrl(String url) throws ParseException(Code)
Parses a SIP url from a string and return a URI structure for it.
Parameters:
  url - a String containing the URI structure to be parsed. A parsed URI structure
exception:
  ParseException - if there was an error parsing the message.



parseTelephoneNumber
public TelephoneNumber parseTelephoneNumber(String telephone_number) throws ParseException(Code)
Parses a telephone number return a parsed structure.
Parameters:
  telephone_number - is a String containing thetelephone # to be parsed a parsed address structure.
since:
   v1.0
exception:
  ParseException - when the address is badly formatted.



parseUrl
public URI parseUrl(String url) throws ParseException(Code)
Parses a uri from a string and return a URI structure for it.
Parameters:
  url - a String containing the URI structure to be parsed. A parsed URI structure
exception:
  ParseException - if there was an error parsing the message.



readBytesToEnd
protected byte[] readBytesToEnd()(Code)
Returns the bytes to the end of the message. This is invoked when the parser is invoked with an array of bytes rather than with a string. the bytes to the end of message



readToEnd
protected String readToEnd()(Code)
Returns the contents till the end of the buffer (this is useful when you encounter an error. text up to end of message



setParseExceptionListener
public void setParseExceptionListener(ParseExceptionListener pexhandler)(Code)
Adds a handler for header parsing errors.
Parameters:
  pexhandler - is a classthat implements the ParseExceptionListener interface.



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.