Package org.bedework.calfacade.util
Class ChangeTable
java.lang.Object
org.bedework.calfacade.util.ChangeTable
- All Implemented Interfaces:
Serializable,org.bedework.util.logging.Logged
Class to track changes to calendar entities. CalDAV (and file uploads)
present a new copy of the event. From this we have to figure out what the
changes were and apply only those changes.
This is particularly important for multivalued fields where replacement of the entire property can lead to a large number of deletions and reinsertions.
- Author:
- Mike Douglass
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddValues(org.bedework.util.calendar.PropertyIndex.PropertyInfoIndex index, Collection<?> val) booleanReturn true if from is not the same as to and set the entry changed flag.voidclear()Clear all changes - will force an updatevoidDump the entries.getEntry(org.bedework.util.calendar.PropertyIndex.PropertyInfoIndex index) Get the indexed entryorg.bedework.util.logging.BwLoggerbooleanbooleanGet the collection set changed flag - true if any collection had entries added or removed.booleanisEmpty()voidmark the addition or removal of members of a collectionbooleanpresent(org.bedework.util.calendar.PropertyIndex.PropertyInfoIndex index) Set the present flag on the named entry.voidprocessChanges(BwEvent ev, boolean update, boolean attendeeFromOrganizer) Go through the change table entries removing fields that were not present in the incoming data.booleanTrue if any recurrence property changed.booleanTrue if any recurrence rules property changed.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.bedework.util.logging.Logged
audit, debug, debug, debug, enableAuditLogger, enableErrorLogger, enableMetricsLogger, error, error, error, getLogLevel, info, isAuditLoggerEnabled, isErrorLoggerEnabled, isMetricsDebugEnabled, isMetricsLoggerEnabled, metrics, setLoggerClass, setLoggerClass, trace, trace, trace, warn
-
Constructor Details
-
ChangeTable
Constructor- Parameters:
userHref- principal href
-
-
Method Details
-
getUserHref
- Returns:
- user we are acting for
-
clear
public void clear()Clear all changes - will force an update -
isEmpty
public boolean isEmpty()- Returns:
- true if no change information has been added.
-
getSignificantChange
public boolean getSignificantChange()Get the collection set changed flag - true if any collection had entries added or removed.- Returns:
- boolean false if no change to any collection set
-
getSequenceChangeNeeded
public boolean getSequenceChangeNeeded()- Returns:
- true if a change requires the sequence be updated
-
present
public boolean present(org.bedework.util.calendar.PropertyIndex.PropertyInfoIndex index) Set the present flag on the named entry.- Parameters:
index- of property- Returns:
- boolean false if entry not found
-
changed
public boolean changed(org.bedework.util.calendar.PropertyIndex.PropertyInfoIndex index, Object from, Object to) Return true if from is not the same as to and set the entry changed flag.- Parameters:
index- - the property indexfrom- old valueto- new value- Returns:
- boolean true if changed
-
addValue
- Parameters:
index- - the property indexval- to add
-
addValues
public void addValues(org.bedework.util.calendar.PropertyIndex.PropertyInfoIndex index, Collection<?> val) - Parameters:
index- - the property indexval- to add
-
getEntry
Get the indexed entry- Parameters:
index- - the property index- Returns:
- Entry null if not found
-
getEntries
- Returns:
- entries added to table.
-
processChanges
Go through the change table entries removing fields that were not present in the incoming data. This method is for the traditional update by replacement approach. Do NOT call for the patch or selective update approach as found in e.g. SOAP.- Parameters:
ev- to updateupdate- true to do updateattendeeFromOrganizer- true if we are updating an attendee from the organizer message
-
noteCollectionSetChanged
public void noteCollectionSetChanged()mark the addition or removal of members of a collection -
recurrenceChanged
public boolean recurrenceChanged()True if any recurrence property changed.- Returns:
- boolean true if changed
-
recurrenceRulesChanged
public boolean recurrenceRulesChanged()True if any recurrence rules property changed.- Returns:
- boolean true if changed
-
dumpEntries
public void dumpEntries()Dump the entries. -
toString
-
getLogger
public org.bedework.util.logging.BwLogger getLogger()- Specified by:
getLoggerin interfaceorg.bedework.util.logging.Logged
-