anon.infoservice
Class JAPMinVersion

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

public class JAPMinVersion
extends AbstractDistributableDatabaseEntry

Holds the information about the currently minimum required JAP version to access the mixcascades.


Nested Class Summary
 
Nested classes/interfaces inherited from class anon.infoservice.AbstractDistributableDatabaseEntry
AbstractDistributableDatabaseEntry.SerialDBEntry, AbstractDistributableDatabaseEntry.Serials
 
Field Summary
private static long DATABASE_TIMEOUT
          The timeout for minimum JAP version information in the database.
static java.lang.String DEFAULT_ID
           
private  byte[] m_bytesPostData
          The same as above as byte[]
private  ServiceSoftware m_japSoftware
          Stores the included ServiceSoftware information.
private  long m_lastUpdate
          Time (see System.currentTimeMillis()) when the root-of-update information infoservice has propagated this minimum version info.
private  org.w3c.dom.Element m_xmlStructure
          Stores the XML structure of this JAPVersionInfo.
 
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
JAPMinVersion(org.w3c.dom.Element a_japRootNode)
          Creates a new JAPMinVersion from XML description received from remote infoservice or local filesystem.
JAPMinVersion(java.io.File a_fileRootNode)
          Creates a new JAPMinVersion from XML description load from local filesystem.
 
Method Summary
 java.lang.String getId()
          Returns the ID for this JAPMinVersion instance.
 ServiceSoftware getJapSoftware()
          Returns the included ServiceSoftware information about the minimum required JAP software version.
 long getLastUpdate()
          Returns the time in milliseconds when this db entry was created from the origin instance.
 byte[] getPostData()
          This returns the data, which are posted to other InfoServices.
 java.lang.String getPostFile()
          This returns the filename (InfoService command), where this JAP minimum required version information is posted at other InfoServices, It's always '/currentjapversion'.
 long getVersionNumber()
          Returns the time when this mimimum version information was created by the root-of-update-information infoservice.
static java.lang.String getXmlElementName()
          Returns the name of the XML root element used by this class.
 org.w3c.dom.Element getXmlStructure()
          Returns the XML structure of this mimimum version info entry.
 
Methods inherited from class anon.infoservice.AbstractDistributableDatabaseEntry
getHttpRequestString, getHttpSerialsRequestString, 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
 

Field Detail

DEFAULT_ID

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

DATABASE_TIMEOUT

private static final long DATABASE_TIMEOUT
The timeout for minimum JAP version information in the database. This should be an infinite timeout (1000 years are infinite enough).

See Also:
Constant Field Values

m_japSoftware

private ServiceSoftware m_japSoftware
Stores the included ServiceSoftware information.


m_lastUpdate

private long m_lastUpdate
Time (see System.currentTimeMillis()) when the root-of-update information infoservice has propagated this minimum version info.


m_xmlStructure

private org.w3c.dom.Element m_xmlStructure
Stores the XML structure of this JAPVersionInfo.


m_bytesPostData

private byte[] m_bytesPostData
The same as above as byte[]

Constructor Detail

JAPMinVersion

public JAPMinVersion(java.io.File a_fileRootNode)
              throws java.lang.Exception
Creates a new JAPMinVersion from XML description load from local filesystem.

Parameters:
a_fileJapMinVersion - The XML file containing the root node of the XML structure of this JAPMinVersion ('Jap' node).
Throws:
java.lang.Exception

JAPMinVersion

public JAPMinVersion(org.w3c.dom.Element a_japRootNode)
              throws java.lang.Exception
Creates a new JAPMinVersion from XML description received from remote infoservice or local filesystem.

Parameters:
a_japRootNode - The root node of the XML structure of this JAPMinVersion ('Jap' node).
Throws:
java.lang.Exception
Method Detail

getXmlElementName

public static java.lang.String getXmlElementName()
Returns the name of the XML root element used by this class.

Returns:
The name of the XML root element used by this class ('Jap').

getId

public java.lang.String getId()
Returns the ID for this JAPMinVersion instance. Because there is only one instance in the system, it's always 'JAPMinVersion'.

Specified by:
getId in interface IDistributable
Specified by:
getId in class AbstractDatabaseEntry
Returns:
The ID for this JAPMinVersion.

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

getVersionNumber

public long getVersionNumber()
Returns the time when this mimimum version information was created by the root-of-update-information infoservice. That infoservice will update and propagate the minimum version info periodically even if nothing has changed. Attention: The version number returned here is only necessary for message exchange between the infoservices and is completely independent from the version number of the JAP version described in this minimum version info. Don't mix up those two version numbers.

Specified by:
getVersionNumber in class AbstractDatabaseEntry
Returns:
A version number which is used to determine the more recent minimum version info entry, if two entries are compared (higher version number -> more recent entry).

getJapSoftware

public ServiceSoftware getJapSoftware()
Returns the included ServiceSoftware information about the minimum required JAP software version.

Returns:
The software information about the minimum JAP software version.

getPostFile

public java.lang.String getPostFile()
This returns the filename (InfoService command), where this JAP minimum required version information is posted at other InfoServices, It's always '/currentjapversion'.

Returns:
The filename where this JAPMinVersion entry is posted at other InfoServices when this entry is forwarded.

getXmlStructure

public org.w3c.dom.Element getXmlStructure()
Returns the XML structure of this mimimum version info entry.

Specified by:
getXmlStructure in class AbstractDistributableDatabaseEntry
Returns:
The XML node of this JAPMinVersion entry ('Jap' node).

getPostData

public byte[] getPostData()
Description copied from class: AbstractDistributableDatabaseEntry
This returns the data, which are posted to other InfoServices. It's the whole XML structure of this DBEntry by default but may be overwritten

Specified by:
getPostData in interface IDistributable
Overrides:
getPostData in class AbstractDistributableDatabaseEntry
Returns:
The data, which are posted to other InfoServices when this entry is forwarded.