anon.terms.template
Class TermsAndConditionsTemplate

java.lang.Object
  extended by anon.infoservice.AbstractDatabaseEntry
      extended by anon.infoservice.AbstractDistributableDatabaseEntry
          extended by anon.infoservice.AbstractDistributableCertifiedDatabaseEntry
              extended by anon.terms.template.TermsAndConditionsTemplate
All Implemented Interfaces:
ICertifiedDatabaseEntry, IDistributable, IXMLEncodable

public class TermsAndConditionsTemplate
extends AbstractDistributableCertifiedDatabaseEntry


Nested Class Summary
 
Nested classes/interfaces inherited from class anon.infoservice.AbstractDistributableDatabaseEntry
AbstractDistributableDatabaseEntry.SerialDBEntry, AbstractDistributableDatabaseEntry.Serials
 
Field Summary
static java.lang.String INFOSERVICE_CONTAINER_PATH
           
static java.lang.String INFOSERVICE_PATH
           
static java.lang.String INFOSERVICE_SERIALS_PATH
           
private  MultiCertPath m_certPath
           
private  java.lang.String m_date
           
private  java.lang.String m_locale
           
private  XMLSignature m_signature
           
private  java.lang.String m_strId
           
private  java.lang.String m_type
           
private  java.lang.String name
           
private  Preamble preamble
           
static java.lang.String[] REPLACEMENT_ELEMENT_NAMES
           
private static java.lang.String[] REQUIRED_ATTRIBUTES
           
private  TCComposite sections
           
private  org.w3c.dom.Document signedDocument
           
static java.lang.String TERMS_AND_CONDITIONS_TYPE_COMMON_LAW
           
static java.lang.String TERMS_AND_CONDITIONS_TYPE_GENERAL_LAW
           
static java.lang.String TERMS_AND_CONDITIONS_TYPE_GERMAN_LAW
           
private static java.lang.String XML_ATTR_DATE
           
private static java.lang.String XML_ATTR_LOCALE
           
private static java.lang.String XML_ATTR_NAME
           
private static java.lang.String XML_ATTR_TYPE
           
static java.lang.String XML_ELEMENT_CONTAINER_NAME
           
private static java.lang.String XML_ELEMENT_DATE
           
static java.lang.String XML_ELEMENT_NAME
           
private static java.lang.String XML_ELEMENT_OPERATOR_COUNTRY
           
private static java.lang.String XML_ELEMENT_SIGNATURE
           
private static java.lang.String XSLT_PATH
           
 
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
TermsAndConditionsTemplate(org.w3c.dom.Element element, long aLong)
           
TermsAndConditionsTemplate(java.io.File a_file)
           
TermsAndConditionsTemplate(org.w3c.dom.Node rootNode)
           
 
Method Summary
 org.w3c.dom.Document createTCDocument(TermsAndConditionsTranslation tcTranslation)
           
 boolean equals(java.lang.Object a_object)
           
static java.util.Enumeration getAllStoredRefIDs()
           
static TermsAndConditionsTemplate getById(java.lang.String a_id, boolean a_bUpdateFromInfoService)
           
 MultiCertPath getCertPath()
           
 java.lang.String getDate()
           
 org.w3c.dom.Document getDocument()
           
 java.lang.String getId()
          Returns a unique ID for a database entry.
 java.lang.String getLanguage()
           
 long getLastUpdate()
          Returns the time in milliseconds when this db entry was created from the origin instance.
 java.lang.String getPostFile()
          Returns the filename (InfoService command) to which the data of this entry is posted at the other infoservice.
 TCComposite getSections()
           
 XMLSignature getSignature()
           
 org.w3c.dom.Document getSignedDocument()
           
 java.lang.String getType()
           
 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.
 int hashCode()
           
 boolean isValid()
           
 boolean isVerified()
          Returns if this entry has been verified with a certificate chain.
static void loadFromDirectory(java.io.File a_dir)
           
 void setSignedDocument(org.w3c.dom.Document signedDocument)
           
static void store(org.w3c.dom.Element root)
           
 java.lang.String transform(TermsAndConditionsTranslation translation)
           
 void transform(java.io.Writer writer, TermsAndConditionsTranslation translation)
           
 
Methods inherited from class anon.infoservice.AbstractDistributableCertifiedDatabaseEntry
checkId
 
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, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML_ATTR_DATE

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

XML_ATTR_LOCALE

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

XML_ATTR_NAME

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

XML_ATTR_TYPE

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

REQUIRED_ATTRIBUTES

private static final java.lang.String[] REQUIRED_ATTRIBUTES

XML_ELEMENT_OPERATOR_COUNTRY

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

XML_ELEMENT_SIGNATURE

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

XML_ELEMENT_DATE

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

INFOSERVICE_PATH

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

INFOSERVICE_CONTAINER_PATH

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

INFOSERVICE_SERIALS_PATH

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

REPLACEMENT_ELEMENT_NAMES

public static final java.lang.String[] REPLACEMENT_ELEMENT_NAMES

XSLT_PATH

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

TERMS_AND_CONDITIONS_TYPE_COMMON_LAW

public static java.lang.String TERMS_AND_CONDITIONS_TYPE_COMMON_LAW

TERMS_AND_CONDITIONS_TYPE_GERMAN_LAW

public static java.lang.String TERMS_AND_CONDITIONS_TYPE_GERMAN_LAW

TERMS_AND_CONDITIONS_TYPE_GENERAL_LAW

public static java.lang.String TERMS_AND_CONDITIONS_TYPE_GENERAL_LAW

XML_ELEMENT_CONTAINER_NAME

public static java.lang.String XML_ELEMENT_CONTAINER_NAME

XML_ELEMENT_NAME

public static java.lang.String XML_ELEMENT_NAME

m_strId

private java.lang.String m_strId

m_locale

private java.lang.String m_locale

m_type

private java.lang.String m_type

m_date

private java.lang.String m_date

signedDocument

private org.w3c.dom.Document signedDocument

m_signature

private XMLSignature m_signature

m_certPath

private MultiCertPath m_certPath

name

private java.lang.String name

preamble

private Preamble preamble

sections

private TCComposite sections
Constructor Detail

TermsAndConditionsTemplate

public TermsAndConditionsTemplate(org.w3c.dom.Element element,
                                  long aLong)
                           throws XMLParseException
Throws:
XMLParseException

TermsAndConditionsTemplate

public TermsAndConditionsTemplate(org.w3c.dom.Node rootNode)
                           throws XMLParseException
Throws:
XMLParseException

TermsAndConditionsTemplate

public TermsAndConditionsTemplate(java.io.File a_file)
                           throws XMLParseException,
                                  java.io.IOException
Throws:
XMLParseException
java.io.IOException
Method Detail

createTCDocument

public org.w3c.dom.Document createTCDocument(TermsAndConditionsTranslation tcTranslation)

transform

public java.lang.String transform(TermsAndConditionsTranslation translation)

transform

public void transform(java.io.Writer writer,
                      TermsAndConditionsTranslation translation)
               throws java.io.IOException,
                      javax.xml.transform.TransformerException
Throws:
java.io.IOException
javax.xml.transform.TransformerException

getType

public java.lang.String getType()

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.

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()
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.

getLanguage

public java.lang.String getLanguage()

getDate

public java.lang.String getDate()

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.

Returns:
The filename, where the data is posted when this entry is forwarded.

isVerified

public boolean isVerified()
Description copied from class: AbstractDistributableCertifiedDatabaseEntry
Returns if this entry has been verified with a certificate chain.

Specified by:
isVerified in interface ICertifiedDatabaseEntry
Specified by:
isVerified in class AbstractDistributableCertifiedDatabaseEntry
Returns:
if this entry has been verified with a certificate chain

isValid

public boolean isValid()

getSections

public TCComposite getSections()

store

public static void store(org.w3c.dom.Element root)

getAllStoredRefIDs

public static java.util.Enumeration getAllStoredRefIDs()

loadFromDirectory

public static void loadFromDirectory(java.io.File a_dir)

getById

public static TermsAndConditionsTemplate getById(java.lang.String a_id,
                                                 boolean a_bUpdateFromInfoService)

equals

public boolean equals(java.lang.Object a_object)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getSignature

public XMLSignature getSignature()
Specified by:
getSignature in interface ICertifiedDatabaseEntry
Specified by:
getSignature in class AbstractDistributableCertifiedDatabaseEntry

getCertPath

public MultiCertPath getCertPath()

getDocument

public org.w3c.dom.Document getDocument()

getSignedDocument

public org.w3c.dom.Document getSignedDocument()

setSignedDocument

public void setSignedDocument(org.w3c.dom.Document signedDocument)

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