Class NetworkMapLink

java.lang.Object
org.netxms.client.maps.NetworkMapLink

public class NetworkMapLink extends Object
Represents link between two elements on map.
  • Field Details

  • Constructor Details

    • NetworkMapLink

      public NetworkMapLink(long id, String name, int type, long element1, long interfaceId1, long element2, long interfaceId2, String connectorName1, String connectorName2, SingleDciConfig[] dciList, int flags)
      Create link object from scratch.
      Parameters:
      id - link object ID
      name - link name (will be displayed in the middle of the link)
      type - link type
      element1 - network map internal element id
      interfaceId1 - ID of interface object on element1 side
      element2 - network map internal element id
      interfaceId2 - ID of interface object on element2 side
      connectorName1 - connector name 1 (will be displayed close to element 1)
      connectorName2 - connector name 2 (will be displayed close to element 2)
      dciList - list of DCIs to be displayed on the link (can be null)
      flags - link flags
    • NetworkMapLink

      public NetworkMapLink(long id, String name, int type, long element1, long element2, String connectorName1, String connectorName2, int flags)
      Create link object from scratch.
      Parameters:
      id - link object ID
      name - link name (will be displayed in the middle of the link)
      type - link type
      element1 - network map internal element id
      element2 - network map internal element id
      connectorName1 - connector name 1 (will be displayed close to element 1)
      connectorName2 - connector name 2 (will be displayed close to element 2)
      flags - link flags
    • NetworkMapLink

      public NetworkMapLink(long id, int type, long element1, long element2)
      Create link object from scratch.
      Parameters:
      id - link object ID
      type - link type
      element1 - network map internal element id
      element2 - network map internal element id
    • NetworkMapLink

      public NetworkMapLink(NXCPMessage msg, long baseId)
      Create link object from NXCP message.
      Parameters:
      msg - NXCP message
      baseId - base field ID
  • Method Details

    • fillMessage

      public void fillMessage(NXCPMessage msg, long baseId)
      Fill NXCP message with link data
      Parameters:
      msg - NXCP message
      baseId - base variable ID
    • getId

      public long getId()
      Returns:
      the 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
    • getColorProvider

      public String getColorProvider()
      Returns:
      the colorProvider
    • setColorProvider

      public void setColorProvider(String colorProvider)
      Parameters:
      colorProvider - the colorProvider to set
    • 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
    • isAutoGenerated

      public boolean isAutoGenerated()
      Check if this link was generated automatically.
      Returns:
      true if this link was generated automatically
    • 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
    • getDciAsList

      public List<SingleDciConfig> getDciAsList()
      Get copy of DCIs configured on this link as list. Any changes to returned list will not affect link configuration.
      Returns:
      copy of DCIs configured on this link as list
    • 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
    • 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
    • getInterfaceId1

      public long getInterfaceId1()
      Returns:
      the interfaceId1
    • setInterfaceId1

      public void setInterfaceId1(long interfaceId1)
      Parameters:
      interfaceId1 - the interfaceId1 to set
    • getInterfaceId2

      public long getInterfaceId2()
      Returns:
      the interfaceId2
    • setInterfaceId2

      public void setInterfaceId2(long interfaceId2)
      Parameters:
      interfaceId2 - the interfaceId2 to set
    • toString

      public String toString()
      Overrides:
      toString in class Object
      See Also: