Class XmlIcalCompare

  • All Implemented Interfaces:
    org.bedework.util.logging.Logged

    public class XmlIcalCompare
    extends Object
    implements org.bedework.util.logging.Logged
    This class compares 2 components. These components may contain other sub-components, for example alarms. What is produced is a set of updates to generate one from the other.

    For this to work, and for updates to be applicable, we need well defined rules determining how we match components. For example, an event is matched if the UID and RECURRENCE-ID matches.

    This is a little more difficult for some components which don't have a uid, alarms for example.

    Author:
    Mike Douglass
    • Constructor Summary

      Constructors 
      Constructor Description
      XmlIcalCompare​(List<?> skippedEntities, XcalUtil.TzGetter tzs)
      The skippedEntities allow the diff process to ignore components, properties and/or parameters that should not take part in the comparison.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.oasis_open.docs.ws_calendar.ns.soap.ComponentSelectionType diff​(ietf.params.xml.ns.icalendar_2.IcalendarType newval, ietf.params.xml.ns.icalendar_2.IcalendarType oldval)
      Compare the parameters.
      org.bedework.util.logging.BwLogger getLogger()  
      • Methods inherited from interface org.bedework.util.logging.Logged

        audit, debug, debug, enableAuditLogger, enableErrorLogger, enableMetricsLogger, error, error, error, getLogLevel, info, isAuditLoggerEnabled, isErrorLoggerEnabled, isMetricsDebugEnabled, isMetricsLoggerEnabled, metrics, setLoggerClass, setLoggerClass, trace, trace, warn
    • Field Detail

      • defaultSkipList

        public static final List<Object> defaultSkipList
    • Constructor Detail

      • XmlIcalCompare

        public XmlIcalCompare​(List<?> skippedEntities,
                              XcalUtil.TzGetter tzs)
        The skippedEntities allow the diff process to ignore components, properties and/or parameters that should not take part in the comparison.

        Populate the list with empty icalendar objects.

        Parameters:
        skippedEntities - Objects of the class that should be skipped
        tzs - for fetching timezones
    • Method Detail

      • diff

        public org.oasis_open.docs.ws_calendar.ns.soap.ComponentSelectionType diff​(ietf.params.xml.ns.icalendar_2.IcalendarType newval,
                                                                                   ietf.params.xml.ns.icalendar_2.IcalendarType oldval)
        Compare the parameters. Return null for equal or a select element.
        Parameters:
        newval - possible new state
        oldval - the current state
        Returns:
        SelectElementType if newval and oldval differ else null.
      • getLogger

        public org.bedework.util.logging.BwLogger getLogger()
        Specified by:
        getLogger in interface org.bedework.util.logging.Logged