Class SyncXmlIdToIdBreakEdgeHandler

  • All Implemented Interfaces:
    EventListener, EventListener, GraphModifierListener

    public class SyncXmlIdToIdBreakEdgeHandler
    extends Object
    implements GraphModifierListener
    Whenever edges are broken, these edges' XML ids remain the same and are no longer unique. It is likely the user wants to keep the XML ids unique despite using internal ids in the memory model. For example when the network is persisted to disk afterwards in which case the XML ids can be used to map ids. In this situation the XML ids need to remain unique. If it is known that the XML ids are initially synced with the internal ids, then this listener can be used to sync all broken links' XML id to the internal id of these links ensuring uniqueness after performing a break link action. Class supports BreakEdgeEvent.EVENT_TYPE to apply its syncing functionality upon notification
    Author:
    markr
    • Constructor Detail

      • SyncXmlIdToIdBreakEdgeHandler

        public SyncXmlIdToIdBreakEdgeHandler()
        Default constructor
    • Method Detail

      • onBreakEdge

        protected void onBreakEdge​(Edge aToBreak,
                                   Edge breakToB)
        Perform action by syncing XML ids to ids
        Parameters:
        aToBreak - edge running from original a node to break location (new node)
        breakToB - aToBreak edge running from break location (new node) to original node b
      • getKnownSupportedEventTypes

        public EventType[] getKnownSupportedEventTypes()
        Collect explicitly supported event types that are known. When not defined the user has to explicitly provide them upon registering the listener on an event producer, otherwise they can be extracted from here
        Specified by:
        getKnownSupportedEventTypes in interface EventListener
        Returns:
        the supported event types