com.isti.util.test
Class MsgCachedArchiveTest.QWServerMsgRecord

java.lang.Object
  extended by com.isti.util.IstiTimeObjectCache.BasicTimeObjectEntry
      extended by com.isti.util.IstiMessageObjectCache.BasicMessageObjectEntry
          extended by com.isti.util.IstiMessageCachedArchive.BasicArchivableMsgObjEntry
              extended by com.isti.util.test.MsgCachedArchiveTest.QWServerMsgRecord
All Implemented Interfaces:
Archivable, IstiMessageCachedArchive.ArchivableMsgObjEntry, IstiMessageObjectCache.MessageObjectEntry, IstiTimeObjectCache.TimeObjectEntry
Enclosing class:
MsgCachedArchiveTest

public static class MsgCachedArchiveTest.QWServerMsgRecord
extends IstiMessageCachedArchive.BasicArchivableMsgObjEntry


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.isti.util.Archivable
Archivable.Marker
 
Field Summary
 
Fields inherited from class com.isti.util.IstiMessageObjectCache.BasicMessageObjectEntry
msgNum
 
Fields inherited from class com.isti.util.IstiTimeObjectCache.BasicTimeObjectEntry
dataObj, dataSize, keyStr, timeGenerated
 
Constructor Summary
MsgCachedArchiveTest.QWServerMsgRecord(java.lang.String archivedDataStr, Archivable.Marker mkrObj)
          Creates a record of data from the archived-string data for an XML message.
 
Method Summary
static java.lang.String dataElemToKeyStr(org.jdom.Element elementObj)
          Creates a key string that will be used as a key into the cache.
static java.lang.String elemToStr(org.jdom.Element elementObj)
          Converts an Element object to a string.
 boolean equals(java.lang.Object obj)
          Compares the given 'QWServerMsgRecord' for "equality" using the 'keyStr' field (if available).
 java.lang.String toArchivedForm()
          Returns the archivable representation for this object.
 void updateArchivedForm()
          Updates the archivable representation for this object.
 
Methods inherited from class com.isti.util.IstiMessageCachedArchive.BasicArchivableMsgObjEntry
getArchiveDate
 
Methods inherited from class com.isti.util.IstiMessageObjectCache.BasicMessageObjectEntry
getMsgNum
 
Methods inherited from class com.isti.util.IstiTimeObjectCache.BasicTimeObjectEntry
getDataObj, getDataSize, getKeyStr, getTimeGenerated, setDataSize
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.isti.util.IstiMessageObjectCache.MessageObjectEntry
getMsgNum
 
Methods inherited from interface com.isti.util.IstiTimeObjectCache.TimeObjectEntry
getDataObj, getDataSize, getKeyStr, getTimeGenerated
 

Constructor Detail

MsgCachedArchiveTest.QWServerMsgRecord

public MsgCachedArchiveTest.QWServerMsgRecord(java.lang.String archivedDataStr,
                                              Archivable.Marker mkrObj)
                                       throws com.isti.util.test.QWRecordException
Creates a record of data from the archived-string data for an XML message. This constructor is needed to have this class implement the 'Archivable' interface.

Parameters:
archivedDataStr - the archived-string data to use.
mkrObj - Archivable.Marker parameter to indicate that this constructor is used to dearchive a record.
Throws:
com.isti.util.test.QWRecordException - if an error occurs while creating the data record.
Method Detail

toArchivedForm

public java.lang.String toArchivedForm()
Returns the archivable representation for this object. When the object is recreated from the string, it should be identical to the original.

Returns:
A String representing the archived form of the object.

equals

public boolean equals(java.lang.Object obj)
Compares the given 'QWServerMsgRecord' for "equality" using the 'keyStr' field (if available).

Overrides:
equals in class java.lang.Object
Parameters:
obj - the 'QWServerMsgRecord' object to compare.
Returns:
true if the given 'QWServerMsgRecord' object is "equal" to this object.

updateArchivedForm

public void updateArchivedForm()
                        throws com.isti.util.test.QWRecordException
Updates the archivable representation for this object.

Throws:
com.isti.util.test.QWRecordException - if an error occurred.

elemToStr

public static java.lang.String elemToStr(org.jdom.Element elementObj)
                                  throws com.isti.util.test.QWRecordException
Converts an Element object to a string.

Parameters:
elementObj - the Element object to use.
Returns:
A new converted string.
Throws:
com.isti.util.test.QWRecordException - if an error occurred.

dataElemToKeyStr

public static java.lang.String dataElemToKeyStr(org.jdom.Element elementObj)
                                         throws com.isti.util.test.QWRecordException
Creates a key string that will be used as a key into the cache. The string consists of the value of the "Action" attribute (if found) and all child elements.

Parameters:
elementObj - the 'DataMessage' element object to use.
Returns:
The generated key string.
Throws:
com.isti.util.test.QWRecordException - if an error occurred.