Class NetworkMapLink


  • public class NetworkMapLink
    extends Object
    Represents link between two elements on map
    • Constructor Detail

      • NetworkMapLink

        public NetworkMapLink​(String name,
                              int type,
                              long element1,
                              long element2,
                              String connectorName1,
                              String connectorName2,
                              SingleDciConfig[] dciList,
                              int flags,
                              boolean isLocked)
        Parameters:
        name -
        type -
        element1 - network map internal element id
        element2 - network map internal element id
        connectorName1 -
        connectorName2 -
        dciList -
        flags -
      • NetworkMapLink

        public NetworkMapLink​(String name,
                              int type,
                              long element1,
                              long element2,
                              String connectorName1,
                              String connectorName2,
                              int flags)
        Parameters:
        name -
        type -
        element1 - network map internal element id
        element2 - network map internal element id
        connectorName1 -
        connectorName2 -
        flags -
      • NetworkMapLink

        public NetworkMapLink​(int type,
                              long element1,
                              long element2)
        Parameters:
        type -
        element1 - network map internal element id
        element2 - network map internal element id
      • NetworkMapLink

        public NetworkMapLink​(org.netxms.base.NXCPMessage msg,
                              long baseId)
        Create link object from NXCP message
        Parameters:
        msg - NXCP message
        baseId - base variable ID
    • Method Detail

      • initData

        public void initData​(String name,
                             int type,
                             long element1,
                             long element2,
                             String connectorName1,
                             String connectorName2,
                             int flags)
        Parameters:
        name -
        type -
        element1 - network map internal element id
        element2 - network map internal element id
        connectorName1 -
        connectorName2 -
        flags -
      • fillMessage

        public void fillMessage​(org.netxms.base.NXCPMessage msg,
                                long baseId)
        Fill NXCP message with link data
        Parameters:
        msg - NXCP message
        baseId - base variable ID
      • getType

        public int getType()
        Returns:
        the linkType
      • getElement1

        public long getElement1()
        Returns:
        first (left) element
      • getElement2

        public long getElement2()
        Returns:
        second (right) element
      • getConnectorName1

        public String getConnectorName1()
        Returns:
        first (left) connector name
      • getConnectorName2

        public String getConnectorName2()
        Returns:
        second (right) connector name
      • getName

        public String getName()
        Returns:
        the name
      • getLabel

        public String getLabel()
        Get label for display. If name is not null and not empty, label will have form name (connector1 - connector2) otherwise it will have form connector1 - connector2 If any of connector names is null or empty, it will be replaced with string "<noname>".
        Returns:
        display label or null for unnamed link
      • hasName

        public boolean hasName()
        Check if link has non-empty name
        Returns:
        true if link has non-empty name
      • hasConnectorName1

        public boolean hasConnectorName1()
        Check if link has non-empty name for connector 1
        Returns:
        true if link has non-empty name for connector 1
      • hasConnectorName2

        public boolean hasConnectorName2()
        Check if link has non-empty name for connector 2
        Returns:
        true if link has non-empty name for connector 2
      • isUnnamed

        public boolean isUnnamed()
        Check if this link is unnamed.
        Returns:
        true if all names (link and both connectors) are null or empty
      • getColor

        public int getColor()
        Returns:
        the color
      • setColor

        public void setColor​(int color)
        Parameters:
        color - the color to set
      • getColorSource

        public int getColorSource()
        Get color source
        Returns:
        color source
      • setColorSource

        public void setColorSource​(int colorSource)
        Set color source
        Parameters:
        colorSource - new color source
      • getStatusObjects

        public List<Long> getStatusObjects()
        Get list of objects used for status calculation
        Returns:
        list of objects used for status calculation
      • setStatusObjects

        public void setStatusObjects​(List<Long> statusObjects)
        Set list of objects used for status calculation
        Parameters:
        statusObjects - new list of objects
      • getRouting

        public int getRouting()
        Returns:
        the routing
      • setRouting

        public void setRouting​(int routing)
        Parameters:
        routing - the routing to set
      • getBendPoints

        public long[] getBendPoints()
        Returns:
        the bendPoints
      • setBendPoints

        public void setBendPoints​(long[] bendPoints)
        Parameters:
        bendPoints - the bendPoints to set
      • getFlags

        public int getFlags()
        Returns:
        the flags
      • setFlags

        public void setFlags​(int flags)
        Parameters:
        flags - the flags to set
      • hasDciData

        public boolean hasDciData()
        Returns:
        returns if DCI list is not empty
      • getDciList

        public SingleDciConfig[] getDciList()
        Returns:
        returns the DCI list if not empty or null
      • setName

        public void setName​(String name)
        Parameters:
        name - the name to set
      • setConnectorName1

        public void setConnectorName1​(String connectorName1)
        Parameters:
        connectorName1 - the connectorName1 to set
      • setConnectorName2

        public void setConnectorName2​(String connectorName2)
        Parameters:
        connectorName2 - the connectorName2 to set
      • isLocked

        public boolean isLocked()
      • setLocked

        public void setLocked​(boolean isLocked)
        Parameters:
        isLocked - set true if link should be locked
      • setDuplicateCount

        public void setDuplicateCount​(int duplicateCount)
      • getDuplicateCount

        public int getDuplicateCount()
        Returns:
        link duplicate count
      • updatePosition

        public void updatePosition()
        Increase link position and duplicate count
      • resetPosition

        public void resetPosition()
        Reset link position and duplicate count
      • getPosition

        public int getPosition()
        Returns:
        link position
      • getConfig

        public LinkConfig getConfig()
        Returns:
        link config