anon.infoservice
Class MessageDBEntry

java.lang.Object
  extended by anon.infoservice.AbstractDatabaseEntry
      extended by anon.infoservice.AbstractDistributableDatabaseEntry
          extended by anon.infoservice.MessageDBEntry
All Implemented Interfaces:
IDistributable, IXMLEncodable

public class MessageDBEntry
extends AbstractDistributableDatabaseEntry
implements IDistributable

Used to send messages to JAP.

Author:
Rolf Wendolsky

Nested Class Summary
 
Nested classes/interfaces inherited from class anon.infoservice.AbstractDistributableDatabaseEntry
AbstractDistributableDatabaseEntry.SerialDBEntry, AbstractDistributableDatabaseEntry.Serials
 
Field Summary
private static java.lang.String ENCODING_BASE64
           
private static java.lang.String ENCODING_URL
           
static java.lang.String HTTP_REQUEST_STRING
           
static java.lang.String HTTP_SERIALS_REQUEST_STRING
           
private  boolean m_bFree
           
private  boolean m_bIsDummy
           
private  boolean m_bShowPopup
           
private  int m_externalIdentifier
           
private  java.util.Hashtable m_hashPopupText
           
private  java.util.Hashtable m_hashText
           
private  java.util.Hashtable m_hashUrl
           
private  java.lang.String m_id
           
private  long m_lastUpdate
           
private  long m_serial
           
private  org.w3c.dom.Element m_xmlDescription
           
static java.lang.String POST_FILE
           
static java.lang.String PROPERTY_NAME
           
private static long TIMEOUT
           
private static java.lang.String XML_ATTR_ENCODING
           
private static java.lang.String XML_ATTR_FREE
           
private static java.lang.String XML_ATTR_LANG
           
private static java.lang.String XML_ATTR_POPUP
           
private static java.lang.String XML_ELEM_POPUP_TEXT
           
static java.lang.String XML_ELEMENT_CONTAINER_NAME
           
static java.lang.String XML_ELEMENT_NAME
           
private static java.lang.String XML_TEXT
           
private static java.lang.String XML_URL
           
 
Fields inherited from class anon.infoservice.AbstractDistributableDatabaseEntry
XML_ATTR_LAST_UPDATE, XML_ATTR_SERIAL, XML_ATTR_VALID, XML_ATTR_VERIFIED
 
Fields inherited from class anon.infoservice.AbstractDatabaseEntry
XML_LAST_UPDATE
 
Fields inherited from interface anon.infoservice.IDistributable
FIELD_HTTP_REQUEST_STRING, FIELD_HTTP_SERIALS_REQUEST_STRING
 
Fields inherited from interface anon.util.IXMLEncodable
FIELD_XML_ELEMENT_CONTAINER_NAME, FIELD_XML_ELEMENT_NAME, XML_ATTR_ID, XML_ATTR_LANGUAGE, XML_ATTR_VERSION
 
Constructor Summary
MessageDBEntry(org.w3c.dom.Element a_xmlElement)
           
 
Method Summary
 int getExternalIdentifier()
           
 java.lang.String getId()
          Returns a unique ID for a database entry.
 long getLastUpdate()
          Returns the time in milliseconds when this db entry was created from the origin instance.
 java.lang.String getPopupText(java.util.Locale a_locale)
           
 java.lang.String getPostFile()
          Returns the filename (InfoService command) to which the data of this entry is posted at the other infoservice.
 java.lang.String getText(java.util.Locale a_locale)
           
private  java.lang.String getText(java.util.Locale a_locale, java.util.Hashtable a_textHash)
           
 java.net.URL getURL(java.util.Locale a_locale)
           
 long getVersionNumber()
          Returns version number which is used to determine the more recent infoservice entry, if two entries are compared (higher version number -> more recent entry).
 org.w3c.dom.Element getXmlStructure()
          Returns the XML structure for this db entry.
 boolean isDummy()
           
 boolean isForFreeCascadesOnly()
           
 boolean isPopupShown()
           
private  boolean parseTextNodes(org.w3c.dom.NodeList a_textNodes, java.util.Hashtable a_nodeTable)
           
 void setExternalIdentifier(int a_identifier)
           
 
Methods inherited from class anon.infoservice.AbstractDistributableDatabaseEntry
getHttpRequestString, getHttpSerialsRequestString, getPostData, getPostEncoding, toXmlElement
 
Methods inherited from class anon.infoservice.AbstractDatabaseEntry
deletePersistence, getCreationTime, getExpireTime, isNewerThan, isPersistanceDeletionAllowed, isUserDefined, resetCreationTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface anon.infoservice.IDistributable
getPostData, getPostEncoding
 

Field Detail

XML_ELEMENT_CONTAINER_NAME

public static final java.lang.String XML_ELEMENT_CONTAINER_NAME
See Also:
Constant Field Values

XML_ELEMENT_NAME

public static final java.lang.String XML_ELEMENT_NAME
See Also:
Constant Field Values

HTTP_REQUEST_STRING

public static final java.lang.String HTTP_REQUEST_STRING
See Also:
Constant Field Values

HTTP_SERIALS_REQUEST_STRING

public static final java.lang.String HTTP_SERIALS_REQUEST_STRING
See Also:
Constant Field Values

PROPERTY_NAME

public static final java.lang.String PROPERTY_NAME
See Also:
Constant Field Values

POST_FILE

public static final java.lang.String POST_FILE
See Also:
Constant Field Values

XML_TEXT

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

XML_URL

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

XML_ATTR_LANG

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

XML_ATTR_POPUP

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

XML_ATTR_ENCODING

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

XML_ATTR_FREE

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

XML_ELEM_POPUP_TEXT

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

ENCODING_URL

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

ENCODING_BASE64

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

TIMEOUT

private static final long TIMEOUT
See Also:
Constant Field Values

m_externalIdentifier

private int m_externalIdentifier

m_serial

private long m_serial

m_lastUpdate

private long m_lastUpdate

m_bIsDummy

private boolean m_bIsDummy

m_bFree

private boolean m_bFree

m_bShowPopup

private boolean m_bShowPopup

m_id

private java.lang.String m_id

m_xmlDescription

private org.w3c.dom.Element m_xmlDescription

m_hashText

private java.util.Hashtable m_hashText

m_hashPopupText

private java.util.Hashtable m_hashPopupText

m_hashUrl

private java.util.Hashtable m_hashUrl
Constructor Detail

MessageDBEntry

public MessageDBEntry(org.w3c.dom.Element a_xmlElement)
               throws XMLParseException,
                      java.security.SignatureException
Throws:
XMLParseException
java.security.SignatureException
Method Detail

getURL

public java.net.URL getURL(java.util.Locale a_locale)

getText

public java.lang.String getText(java.util.Locale a_locale)

getPopupText

public java.lang.String getPopupText(java.util.Locale a_locale)

getExternalIdentifier

public int getExternalIdentifier()

setExternalIdentifier

public void setExternalIdentifier(int a_identifier)

isPopupShown

public boolean isPopupShown()

isForFreeCascadesOnly

public boolean isForFreeCascadesOnly()

isDummy

public boolean isDummy()

getVersionNumber

public long getVersionNumber()
Description copied from class: AbstractDatabaseEntry
Returns version number which is used to determine the more recent infoservice entry, if two entries are compared (higher version number -> more recent entry). Never (!) insert the local creation time here, as this will DoS the InfoServices in an endless loop.

Specified by:
getVersionNumber in class AbstractDatabaseEntry
Returns:
The version number for this entry.

getId

public java.lang.String getId()
Description copied from class: AbstractDatabaseEntry
Returns a unique ID for a database entry.

Specified by:
getId in interface IDistributable
Specified by:
getId in class AbstractDatabaseEntry
Returns:
The ID of this database entry.

getPostFile

public java.lang.String getPostFile()
Description copied from interface: IDistributable
Returns the filename (InfoService command) to which the data of this entry is posted at the other infoservice.

Specified by:
getPostFile in interface IDistributable
Returns:
The filename, where the data is posted when this entry is forwarded.

getLastUpdate

public long getLastUpdate()
Description copied from class: AbstractDatabaseEntry
Returns the time in milliseconds when this db entry was created from the origin instance. Never (!) insert the local creation time here, as this will DoS the InfoServices in an endless loop.

Specified by:
getLastUpdate in class AbstractDatabaseEntry
Returns:
the time in milliseconds when this db entry was created from the origin instance

getXmlStructure

public org.w3c.dom.Element getXmlStructure()
Description copied from class: AbstractDistributableDatabaseEntry
Returns the XML structure for this db entry.

Specified by:
getXmlStructure in class AbstractDistributableDatabaseEntry
Returns:
The XML node of this db entry

getText

private java.lang.String getText(java.util.Locale a_locale,
                                 java.util.Hashtable a_textHash)

parseTextNodes

private boolean parseTextNodes(org.w3c.dom.NodeList a_textNodes,
                               java.util.Hashtable a_nodeTable)