org.hd.d.pg2k.svrCore
Class ExhibitPropsGlobalImmutable.EPGIDiff

java.lang.Object
  extended by org.hd.d.pg2k.svrCore.ExhibitPropsGlobalImmutable.EPGIDiff
All Implemented Interfaces:
java.io.ObjectInputValidation, java.io.Serializable
Enclosing class:
ExhibitPropsGlobalImmutable

public static final class ExhibitPropsGlobalImmutable.EPGIDiff
extends java.lang.Object
implements java.io.Serializable, java.io.ObjectInputValidation

Immutable record of the difference between two EPGI instances. This contains the "diffable" items.

See Also:
Serialized Form

Field Summary
private  PropertiesDiff locationDBDiff
          The diffed location DB in properties format; non-empty else null.
 long locationDBTimestampNew
          The new location DB timestamp; strictly positive, or zero for empty diff.
private static long serialVersionUID
          Serial UID.
private  PropertiesBundleDiff treedescDiff
          The diffed treedesc in properties format; non-empty else null.
 long treedescTimestampNew
          The new treedesc timestamp; strictly positive, or zero for empty diff.
 
Constructor Summary
ExhibitPropsGlobalImmutable.EPGIDiff()
          Create an empty instance.
ExhibitPropsGlobalImmutable.EPGIDiff(long locationDBTimestampNew, PropertiesDiff locationDBDiff, long treedescTimestampNew, PropertiesBundleDiff treedescDiff)
          Create an instance.
 
Method Summary
static ExhibitPropsGlobalImmutable applyDiff(ExhibitPropsGlobalImmutable oldEpgi, ExhibitPropsGlobalImmutable.EPGIDiff diff)
          Apply diff to derive new EPGI; never null.
static ExhibitPropsGlobalImmutable.EPGIDiff createDiff(ExhibitPropsGlobalImmutable e1, ExhibitPropsGlobalImmutable e2)
          Create a diff from the old EPGI value to the new one.
protected  java.lang.Object readResolve()
          Deserialise: use constructor for validation, defensive copying, conversion from old formats, etc.
 void validateObject()
          Checks that the object is internally consistent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

locationDBTimestampNew

public final long locationDBTimestampNew
The new location DB timestamp; strictly positive, or zero for empty diff.


locationDBDiff

private final PropertiesDiff locationDBDiff
The diffed location DB in properties format; non-empty else null.


treedescTimestampNew

public final long treedescTimestampNew
The new treedesc timestamp; strictly positive, or zero for empty diff.


treedescDiff

private final PropertiesBundleDiff treedescDiff
The diffed treedesc in properties format; non-empty else null.


serialVersionUID

private static final long serialVersionUID
Serial UID.

See Also:
Constant Field Values
Constructor Detail

ExhibitPropsGlobalImmutable.EPGIDiff

public ExhibitPropsGlobalImmutable.EPGIDiff()
Create an empty instance.


ExhibitPropsGlobalImmutable.EPGIDiff

public ExhibitPropsGlobalImmutable.EPGIDiff(long locationDBTimestampNew,
                                            PropertiesDiff locationDBDiff,
                                            long treedescTimestampNew,
                                            PropertiesBundleDiff treedescDiff)
Create an instance.

Method Detail

createDiff

public static ExhibitPropsGlobalImmutable.EPGIDiff createDiff(ExhibitPropsGlobalImmutable e1,
                                                              ExhibitPropsGlobalImmutable e2)
                                                       throws AllExhibitPropertiesDelta.DiffException
Create a diff from the old EPGI value to the new one. If the new locationDB is absent then we fake a timestamp of now.

Throws:
AllExhibitPropertiesDelta.DiffException

applyDiff

public static ExhibitPropsGlobalImmutable applyDiff(ExhibitPropsGlobalImmutable oldEpgi,
                                                    ExhibitPropsGlobalImmutable.EPGIDiff diff)
Apply diff to derive new EPGI; never null.

Parameters:
oldEpgi - null is treated as if an empty EPGI
diff - diff to apply; never null
Returns:
new non-null EPGI value from old one (null implies empty) and diff

readResolve

protected java.lang.Object readResolve()
                                throws java.io.ObjectStreamException
Deserialise: use constructor for validation, defensive copying, conversion from old formats, etc. Also allows us to (re)normalise the data in this instance.

Throws:
java.io.ObjectStreamException

validateObject

public void validateObject()
                    throws java.io.InvalidObjectException
Checks that the object is internally consistent.

Specified by:
validateObject in interface java.io.ObjectInputValidation
Throws:
java.io.InvalidObjectException

DHD Multimedia Gallery V1.50.55

Copyright (c) 1996-2008, Damon Hart-Davis. All rights reserved.