ie.nuigalway.ecrg.jade.jmsmtp.util
Class FipaXMLUtil

java.lang.Object
  |
  +--ie.nuigalway.ecrg.jade.jmsmtp.util.FipaXMLUtil

public class FipaXMLUtil
extends java.lang.Object


Field Summary
private static java.lang.String BLK
           
private static java.lang.String BOUNDARY
           
private static java.lang.String CONTENT_LENGTH
           
private static java.lang.String CONTENT_TYPE
           
private static java.lang.String CRLF
           
private  java.text.DateFormat fipaDateFormat
           
private static org.apache.log4j.Category log
           
private static java.lang.String MIME_VERSION
           
private static java.lang.String MULTIPART_MIXED
           
private  java.lang.String parser
           
 
Constructor Summary
FipaXMLUtil()
          Creates a new FipaXMLUtil object.
FipaXMLUtil(java.lang.String parser)
          Constructor for the FipaXMLUtil object
 
Method Summary
 jade.domain.FIPAAgentManagement.Envelope decode(java.lang.String msg, java.lang.StringBuffer payload)
          Given an FIPA compliant XML message decode its envelope and payload
 java.lang.String encode(jade.domain.FIPAAgentManagement.Envelope env, byte[] payload)
          Convert a JADE Envelope and message Payload to FIPA compatible XML
 java.lang.String encode(jade.domain.FIPAAgentManagement.Envelope env, java.lang.String payload)
          Convert a JADE Envelope and message Payload to FIPA compatible XML
 java.util.Date getDateFromString(java.lang.String dateTxt)
          Given a date in a string format convert it to a Date object
private static java.lang.String processLine(java.lang.String line)
          return the next information of search in the line
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static org.apache.log4j.Category log

fipaDateFormat

private java.text.DateFormat fipaDateFormat

parser

private java.lang.String parser

MIME_VERSION

private static final java.lang.String MIME_VERSION
See Also:
Constant Field Values

CONTENT_TYPE

private static final java.lang.String CONTENT_TYPE
See Also:
Constant Field Values

MULTIPART_MIXED

private static final java.lang.String MULTIPART_MIXED
See Also:
Constant Field Values

CONTENT_LENGTH

private static final java.lang.String CONTENT_LENGTH
See Also:
Constant Field Values

BOUNDARY

private static final java.lang.String BOUNDARY
See Also:
Constant Field Values

CRLF

private static final java.lang.String CRLF
See Also:
Constant Field Values

BLK

private static final java.lang.String BLK
See Also:
Constant Field Values
Constructor Detail

FipaXMLUtil

public FipaXMLUtil()
Creates a new FipaXMLUtil object.


FipaXMLUtil

public FipaXMLUtil(java.lang.String parser)
Constructor for the FipaXMLUtil object

Parameters:
parser - Description of the Parameter
Method Detail

encode

public java.lang.String encode(jade.domain.FIPAAgentManagement.Envelope env,
                               java.lang.String payload)
Convert a JADE Envelope and message Payload to FIPA compatible XML

Parameters:
env - JADE Envelope to be encoded
payload - Message payload to be encoded into XML
Returns:
String FIPA XML containing converted envelope and message payload

encode

public java.lang.String encode(jade.domain.FIPAAgentManagement.Envelope env,
                               byte[] payload)
Convert a JADE Envelope and message Payload to FIPA compatible XML

Parameters:
env - JADE Envelope to be encoded
payload - Message payload to be encoded into XML
Returns:
String FIPA XML containing converted envelope and message payload

decode

public jade.domain.FIPAAgentManagement.Envelope decode(java.lang.String msg,
                                                       java.lang.StringBuffer payload)
                                                throws java.lang.Exception
Given an FIPA compliant XML message decode its envelope and payload

Parameters:
msg - FIPA compliant XML message to be decoded
payload - StringBuffer to populate with message payload
Returns:
Envelope Decoded JADE Message Envelope
Throws:
java.lang.Exception - Error decoding the message

processLine

private static java.lang.String processLine(java.lang.String line)
                                     throws java.io.IOException
return the next information of search in the line

Parameters:
line - Description of the Parameter
Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception

getDateFromString

public java.util.Date getDateFromString(java.lang.String dateTxt)
Given a date in a string format convert it to a Date object

Parameters:
dateTxt - Date to be converted in a string format
Returns:
Date Decoded date from string