org.cmis.interopserver.services.cap
Class CAPAlertTranslator

java.lang.Object
  extended by org.cmis.interopserver.services.cap.CAPAlertTranslator

public class CAPAlertTranslator
extends java.lang.Object

Author:
WHITEJ-C This is a utility class that will read an XML document that follows the CAP standard and translate it to an AlertBean that can be used in the DMIS environment

This class also provides utility methods for converting data formats


Field Summary
(package private) static java.util.logging.Logger log
           
 
Constructor Summary
CAPAlertTranslator()
           
 
Method Summary
 org.cmis.interopserver.beans.cap.Alert alertBeanToAlert(org.cmis.client.app.alerts.model.AlertBean abean)
          Conversion routines to convert an AlertBean to an Alert to send to Web services
 gov.noaa.nws.hazcollect.cap.CAPAlert alertBeanToCAPAlert(org.cmis.client.app.alerts.model.AlertBean alertBean)
          t.
 gov.noaa.nws.hazcollect.cap.CAPAlertInfo alertInfoBeanToCapAlertInfo(org.cmis.client.app.alerts.model.AlertInfoBean infoBean)
          Creates an CAPAlertInfo from a AlertInfoBean object Modified by C.
 java.lang.String alertToXML(org.cmis.interopserver.beans.cap.Alert alert)
           
 java.lang.String alertToXML(org.cmis.interopserver.beans.capv2.Alert alert)
           
 org.cmis.client.app.alerts.model.AlertInfoBean capAlertInfoToAlertInfoBean(CAPAlertInfo capAlertInfo)
          Creates an AlertInfoBean from a CAPAlertInfo object
 org.cmis.client.app.alerts.model.AlertBean capAlertToAlertBean(CAPAlert capAlert)
          Creates an AlertBean from a CAPAlert object
 java.lang.String capAlertToXML(CAPAlert capAlert)
           
static java.sql.Timestamp iso8601StringToTimestamp(java.lang.String dateString)
          Creates a Timestamp from a String that is a date in iso8601 format.
static void main(java.lang.String[] args)
           
 java.util.Calendar timeStampToCalendar(java.sql.Timestamp date)
           
 java.lang.String timestampToIso8601String(java.util.Date dt)
          Converts Timestamp to an ISO8601 Date String
 CAPAlert XMLToCAPAlert(org.w3c.dom.Document capDoc)
          Creates a CAPAlert object from the given XML document
 CAPAlert XMLToCAPAlert(java.io.InputStream stream)
          Creates a CAPAlertObject from the given XML document The Documnet must follow the CAP standard.
 gov.noaa.nws.hazcollect.cap.CAPAlert XMLToNWMEAlert(java.io.InputStream stream)
          Creates a NWEM CAPAlertObject from the given XML document The Documnet must follow the CAP standard.
 gov.noaa.nws.hazcollect.cap.CAPAlert XMLToNWMECAPAlert(org.w3c.dom.Document capDoc)
          Creates a CAPAlert object from the given XML document
static void XXmain(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

static java.util.logging.Logger log
Constructor Detail

CAPAlertTranslator

public CAPAlertTranslator()
Method Detail

XMLToCAPAlert

public CAPAlert XMLToCAPAlert(java.io.InputStream stream)
                       throws java.io.IOException
Creates a CAPAlertObject from the given XML document The Documnet must follow the CAP standard.

Parameters:
stream - CAP XML Document
Returns:
CAPAlert
Throws:
java.io.IOException - if the Document was unreadable

XMLToNWMEAlert

public gov.noaa.nws.hazcollect.cap.CAPAlert XMLToNWMEAlert(java.io.InputStream stream)
                                                    throws java.io.IOException
Creates a NWEM CAPAlertObject from the given XML document The Documnet must follow the CAP standard.

Parameters:
stream - CAP XML Document
Returns:
CAPAlert for the NWEM package
Throws:
java.io.IOException - if the Document was unreadable

XMLToNWMECAPAlert

public gov.noaa.nws.hazcollect.cap.CAPAlert XMLToNWMECAPAlert(org.w3c.dom.Document capDoc)
                                                       throws java.io.IOException
Creates a CAPAlert object from the given XML document

Parameters:
capDoc -
Returns:
CAPAlert
Throws:
java.io.IOException

XMLToCAPAlert

public CAPAlert XMLToCAPAlert(org.w3c.dom.Document capDoc)
                       throws java.io.IOException
Creates a CAPAlert object from the given XML document

Parameters:
capDoc -
Returns:
CAPAlert
Throws:
java.io.IOException

alertToXML

public java.lang.String alertToXML(org.cmis.interopserver.beans.cap.Alert alert)
                            throws java.io.IOException
Throws:
java.io.IOException

alertToXML

public java.lang.String alertToXML(org.cmis.interopserver.beans.capv2.Alert alert)
                            throws java.io.IOException
Throws:
java.io.IOException

capAlertToXML

public java.lang.String capAlertToXML(CAPAlert capAlert)
                               throws java.io.IOException
Throws:
java.io.IOException

capAlertToAlertBean

public org.cmis.client.app.alerts.model.AlertBean capAlertToAlertBean(CAPAlert capAlert)
Creates an AlertBean from a CAPAlert object

Parameters:
capAlert -
Returns:
AlertBean

capAlertInfoToAlertInfoBean

public org.cmis.client.app.alerts.model.AlertInfoBean capAlertInfoToAlertInfoBean(CAPAlertInfo capAlertInfo)
Creates an AlertInfoBean from a CAPAlertInfo object

Parameters:
capAlertInfo -
Returns:
AlertInfoBean

iso8601StringToTimestamp

public static java.sql.Timestamp iso8601StringToTimestamp(java.lang.String dateString)
Creates a Timestamp from a String that is a date in iso8601 format.

If the String is not in the correct format a null value will be returned.

Parameters:
dateString -
Returns:
Timestamp

main

public static void main(java.lang.String[] args)

XXmain

public static void XXmain(java.lang.String[] args)

alertBeanToCAPAlert

public gov.noaa.nws.hazcollect.cap.CAPAlert alertBeanToCAPAlert(org.cmis.client.app.alerts.model.AlertBean alertBean)
t. Peacemaker Conversion routines for converting AlertBeans to CapAlerts MOdified by C. Higgins 4/6/06 Method is specific to creating a gov.noaa.nws.hazcollect.cap.CAPAlert and should not be mistaken for an org.cmis.interoopserver.services.cap.CAPAlert. Both types at this time are generated by using the WSDL2Java command for Web Services, but since the WSDL's used as input are different, the resulting classes generated are different.


alertInfoBeanToCapAlertInfo

public gov.noaa.nws.hazcollect.cap.CAPAlertInfo alertInfoBeanToCapAlertInfo(org.cmis.client.app.alerts.model.AlertInfoBean infoBean)
Creates an CAPAlertInfo from a AlertInfoBean object Modified by C. Higgins 4/6/06 Method is specific to creating a gov.noaa.nws.hazcollect.cap.CAPAlertInfo and should not be mistaken for an org.cmis.interoopserver.services.cap.CAPAlertInfo. Both types at this time are generated by using the WSDL2Java command for Web Services, but since the WSDL's used as input are different, the resulting classes generated are different.

Parameters:
capAlertInfo - todo put in fix
Returns:
AlertInfoBean

timestampToIso8601String

public java.lang.String timestampToIso8601String(java.util.Date dt)
Converts Timestamp to an ISO8601 Date String

Parameters:
ts - Timestamp
Returns:
String
To Do:
Make sure this works correctly

alertBeanToAlert

public org.cmis.interopserver.beans.cap.Alert alertBeanToAlert(org.cmis.client.app.alerts.model.AlertBean abean)
Conversion routines to convert an AlertBean to an Alert to send to Web services


timeStampToCalendar

public java.util.Calendar timeStampToCalendar(java.sql.Timestamp date)