anon.infoservice
Class JAPVersionInfo

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

public class JAPVersionInfo
extends AbstractDistributableDatabaseEntry

This stores the version information about the current JAP release or development version.


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 JAP version information in the database.
static java.lang.String ID_BETA
           
static java.lang.String ID_STABLE
           
static int JAP_DEVELOPMENT_VERSION
          Describes a JAP development version.
static int JAP_RELEASE_VERSION
          Describes a JAP release version.
private  java.net.URL m_codeBase
          Stores the URL of the server, where the corresponding JAP software can be downloaded from.
private  java.lang.String m_jarFileName
          Stores the filename of the where the corresponding JAP software is available on the server.
private  java.lang.String m_lastSupportedJavaVersion
           
private  long m_lastUpdate
          Time (see System.currentTimeMillis()) when the root-of-update information infoservice has propagated this version info.
private  java.util.Date m_releaseDate
          Stores release date of the described JAP version.
private  java.lang.String m_version
          Stores the version number of the described JAP version.
private  int m_versionInfoType
          Stores whether this is the version info for the development version or the release version.
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
JAPVersionInfo(org.w3c.dom.Element a_jnlpRootNode, int a_versionInfoType)
          Creates a new JAP version info out of a JNLP file.
 
Method Summary
 java.net.URL getCodeBase()
          Returns the URL of the server, where the corresponding JAP software can be downloaded from.
 java.util.Date getDate()
          Returns the release date of the JAP software described in this version info structure.
 java.lang.String getId()
          Returns the ID of this version information.
 java.lang.String getJAPJarFileName()
          Returns the filename of the JAP file on the download server.
 java.lang.String getJapVersion()
          Returns the JAP software version described by this version info structure.
 long getLastUpdate()
          Returns the time in milliseconds when this db entry was created from the origin instance.
 java.lang.String getPostFile()
          This returns the filename (InfoService command), where this JAPVersionInfo entry is posted at other InfoServices.
static JAPVersionInfo getRecommendedUpdate(java.lang.String a_currentVersion, boolean a_bStable)
           
 java.lang.String getSupportedJavaVersion()
           
 long getVersionNumber()
          Returns the time when this 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 for this version info entry.
 boolean isJavaVersionStillSupported()
           
 
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
 

Field Detail

ID_BETA

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

ID_STABLE

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

JAP_RELEASE_VERSION

public static final int JAP_RELEASE_VERSION
Describes a JAP release version.

See Also:
Constant Field Values

JAP_DEVELOPMENT_VERSION

public static final int JAP_DEVELOPMENT_VERSION
Describes a JAP development version.

See Also:
Constant Field Values

DATABASE_TIMEOUT

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

See Also:
Constant Field Values

m_versionInfoType

private int m_versionInfoType
Stores whether this is the version info for the development version or the release version. See the constants in this class.


m_version

private java.lang.String m_version
Stores the version number of the described JAP version.


m_releaseDate

private java.util.Date m_releaseDate
Stores release date of the described JAP version.


m_jarFileName

private java.lang.String m_jarFileName
Stores the filename of the where the corresponding JAP software is available on the server.


m_codeBase

private java.net.URL m_codeBase
Stores the URL of the server, where the corresponding JAP software can be downloaded from.


m_lastSupportedJavaVersion

private java.lang.String m_lastSupportedJavaVersion

m_lastUpdate

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


m_xmlStructure

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

Constructor Detail

JAPVersionInfo

public JAPVersionInfo(org.w3c.dom.Element a_jnlpRootNode,
                      int a_versionInfoType)
               throws java.lang.Exception
Creates a new JAP version info out of a JNLP file.

Parameters:
a_jnlpRootNode - The root node of the JNLP document.
a_versionInfoType - The type of the JAPVersionInfo (release / development), see the constants in this class.
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 ('jnlp').

getRecommendedUpdate

public static JAPVersionInfo getRecommendedUpdate(java.lang.String a_currentVersion,
                                                  boolean a_bStable)

isJavaVersionStillSupported

public boolean isJavaVersionStillSupported()

getSupportedJavaVersion

public java.lang.String getSupportedJavaVersion()

getId

public java.lang.String getId()
Returns the ID of this version information. It's the filename where this version info is available on the infoservice ('/japRelease.jnlp' or '/japDevelopment.jnlp' depending on the type of this version info)

Specified by:
getId in interface IDistributable
Specified by:
getId in class AbstractDatabaseEntry
Returns:
The ID of this version info.

getVersionNumber

public long getVersionNumber()
Returns the time when this version information was created by the root-of-update-information infoservice. That infoservice will update and propagate the 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 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 version info entry, if two entries are compared (higher version number -> more recent entry).

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

getJapVersion

public java.lang.String getJapVersion()
Returns the JAP software version described by this version info structure.

Returns:
The JAP software version described in this JAPVersionInfo.

getDate

public java.util.Date getDate()
Returns the release date of the JAP software described in this version info structure.

Returns:
The release date of the JAP software described in this JAPVersionInfo.

getCodeBase

public java.net.URL getCodeBase()
Returns the URL of the server, where the corresponding JAP software can be downloaded from.

Returns:
The URL of the download server for the JAP software described in this version info structure.

getJAPJarFileName

public java.lang.String getJAPJarFileName()
Returns the filename of the JAP file on the download server.

Returns:
The filename where the JAP software described in this JAPVersionInfo is available on the download server.

getPostFile

public java.lang.String getPostFile()
This returns the filename (InfoService command), where this JAPVersionInfo entry is posted at other InfoServices. Depending on the type of this version info, it's '/japRelease.jnlp' or 'japDevelopment.jnlp'. This method returns the same value as the getId() method of this instance.

Returns:
The filename where this version information is posted at other infoservices when this entry is forwarded.

getXmlStructure

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

Specified by:
getXmlStructure in class AbstractDistributableDatabaseEntry
Returns:
The XML node of this JAPVersionInfo entry (jnlp node).