com.flexive.shared.content
Class FxDelta

java.lang.Object
  extended by com.flexive.shared.content.FxDelta
All Implemented Interfaces:
java.io.Serializable

public class FxDelta
extends java.lang.Object
implements java.io.Serializable

Compute Delta changes for FxContents

Author:
Markus Plesser (markus.plesser@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
See Also:
Serialized Form

Nested Class Summary
static class FxDelta.FxDeltaChange
          A single delta change
 
Constructor Summary
FxDelta(java.util.List<FxDelta.FxDeltaChange> updates, java.util.List<FxDelta.FxDeltaChange> adds, java.util.List<FxDelta.FxDeltaChange> removes)
          Ctor
 
Method Summary
 boolean changes()
          Are there any changes?
 java.lang.String dump()
          Create a dump of all changes for debugging purposes
 java.util.List<FxDelta.FxDeltaChange> getAdds()
          Get a list of all added deltas
 java.util.List<FxDelta.FxDeltaChange> getDiff(FxContent original, FxContent compare)
          Get all changes from original to compare in correct order (for display in UI's)
 java.util.List<FxPropertyData> getFlatStorageAddsUpdates()
          Get all adds and updates that affect a flat storage
 java.util.List<FxDelta.FxDeltaChange> getRemoves()
          Get a list of all removed deltas
 java.util.List<FxDelta.FxDeltaChange> getUpdates()
          Get a list of all updated deltas
 boolean isDataChanged()
          Are there any data (and not only position) changed?
 boolean isGroupDataChanged()
          Are there any changes relating to groups or group positions?
 boolean isInternalPropertyChanged()
          Was there a change of system internal properties like ACL?
 boolean isOnlyInternalPropertyChanges()
          Are there only internal property changes (like step, version) and no data changes?
static FxDelta processDelta(FxContent original, FxContent compare)
          Compare original to compare FxContent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FxDelta

public FxDelta(java.util.List<FxDelta.FxDeltaChange> updates,
               java.util.List<FxDelta.FxDeltaChange> adds,
               java.util.List<FxDelta.FxDeltaChange> removes)
Ctor

Parameters:
updates - delta updates
adds - delta adds
removes - delta removes
Method Detail

getUpdates

public java.util.List<FxDelta.FxDeltaChange> getUpdates()
Get a list of all updated deltas

Returns:
list of all updated deltas

getAdds

public java.util.List<FxDelta.FxDeltaChange> getAdds()
Get a list of all added deltas

Returns:
list of all added deltas

getRemoves

public java.util.List<FxDelta.FxDeltaChange> getRemoves()
Get a list of all removed deltas

Returns:
list of all removed deltas

getFlatStorageAddsUpdates

public java.util.List<FxPropertyData> getFlatStorageAddsUpdates()
Get all adds and updates that affect a flat storage

Returns:
list of all adds and updates that affect a flat storage

isInternalPropertyChanged

public boolean isInternalPropertyChanged()
Was there a change of system internal properties like ACL?

Returns:
change of system internal properies

isOnlyInternalPropertyChanges

public boolean isOnlyInternalPropertyChanges()
Are there only internal property changes (like step, version) and no data changes?

Returns:
only internal property changes

changes

public boolean changes()
Are there any changes?

Returns:
changes?

isDataChanged

public boolean isDataChanged()
Are there any data (and not only position) changed?

Returns:
data changes?
Since:
3.1.5

isGroupDataChanged

public boolean isGroupDataChanged()
Are there any changes relating to groups or group positions?

Returns:
group changes?
Since:
3.2.0

dump

public java.lang.String dump()
Create a dump of all changes for debugging purposes

Returns:
dump of all changes for debugging purposes

getDiff

public java.util.List<FxDelta.FxDeltaChange> getDiff(FxContent original,
                                                     FxContent compare)
Get all changes from original to compare in correct order (for display in UI's)

Parameters:
original - original content
compare - content that original is compared against
Returns:
differences

processDelta

public static FxDelta processDelta(FxContent original,
                                   FxContent compare)
                            throws FxNotFoundException,
                                   FxInvalidParameterException
Compare original to compare FxContent. Both contents should be compacted and empty entries removed for correct results. Flatstorage entries will only be added to the remove list.

Parameters:
original - original content
compare - content that original is compared against
Returns:
deltas
Throws:
FxInvalidParameterException - on errors
FxNotFoundException - on errors