Package org.netxms.client.maps
Class NetworkMapLink
java.lang.Object
org.netxms.client.maps.NetworkMapLink
Represents link between two elements on map.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionNetworkMapLink(long id, int type, long element1, long element2) Create link object from scratch.NetworkMapLink(long id, String name, int type, long element1, long interfaceId1, long element2, long interfaceId2, String connectorName1, String connectorName2, MapLinkDataSource[] dciList, int flags) Create link object from scratch.NetworkMapLink(long id, String name, int type, long element1, long element2, String connectorName1, String connectorName2, int flags) Create link object from scratch.NetworkMapLink(NXCPMessage msg, long baseId) Create link object from NXCP message. -
Method Summary
Modifier and TypeMethodDescriptionvoidfillMessage(NXCPMessage msg, long baseId) Fill NXCP message with link datalong[]intgetColor()intGet color sourcelongGet common first element - used to check if links are inverted to each otherGet copy of DCIs configured on this link as list.intlonglongintgetFlags()longgetId()longlonggetLabel()Get label for display.getName()intintGet list of objects used for status calculationintgetType()booleanCheck if link has non-empty name for connector 1booleanCheck if link has non-empty name for connector 2booleanbooleanhasName()Check if link has non-empty namebooleanCheck if this link was generated automatically.booleanIf link direction is inverted to other linksbooleanCheck if this link is excluded from automatic updatebooleanCheck if this link is unnamed.voidReset link position and duplicate countvoidsetBendPoints(long[] bendPoints) voidsetColor(int color) voidsetColorProvider(String colorProvider) voidsetColorSource(int colorSource) Set color sourcevoidsetCommonFirstElement(long commonFirstElement) Update common first element and set inverted flagvoidsetConnectorName1(String connectorName1) voidsetConnectorName2(String connectorName2) voidsetDuplicateCount(int duplicateCount) voidsetExcludedFromAutomaticUpdate(boolean exclude) Set if this link is excluded from automatic DCI data updatevoidsetInterfaceId1(long interfaceId1) voidsetInterfaceId2(long interfaceId2) voidvoidsetRouting(int routing) voidsetStatusObjects(List<Long> statusObjects) Set list of objects used for status calculationtoString()voidIncrease link position and duplicate count
-
Field Details
-
AUTO_GENERATED
public static final int AUTO_GENERATED- See Also:
-
EXCLUDE_FROM_AUTO_UPDATE
public static final int EXCLUDE_FROM_AUTO_UPDATE- See Also:
-
NORMAL
public static final int NORMAL- See Also:
-
VPN
public static final int VPN- See Also:
-
MULTILINK
public static final int MULTILINK- See Also:
-
AGENT_TUNEL
public static final int AGENT_TUNEL- See Also:
-
AGENT_PROXY
public static final int AGENT_PROXY- See Also:
-
SSH_PROXY
public static final int SSH_PROXY- See Also:
-
SNMP_PROXY
public static final int SNMP_PROXY- See Also:
-
ICMP_PROXY
public static final int ICMP_PROXY- See Also:
-
SENSOR_PROXY
public static final int SENSOR_PROXY- See Also:
-
ZONE_PROXY
public static final int ZONE_PROXY- See Also:
-
ROUTING_DEFAULT
public static final int ROUTING_DEFAULT- See Also:
-
ROUTING_DIRECT
public static final int ROUTING_DIRECT- See Also:
-
ROUTING_MANHATTAN
public static final int ROUTING_MANHATTAN- See Also:
-
ROUTING_BENDPOINTS
public static final int ROUTING_BENDPOINTS- See Also:
-
COLOR_SOURCE_UNDEFINED
public static final int COLOR_SOURCE_UNDEFINED- See Also:
-
COLOR_SOURCE_DEFAULT
public static final int COLOR_SOURCE_DEFAULT- See Also:
-
COLOR_SOURCE_OBJECT_STATUS
public static final int COLOR_SOURCE_OBJECT_STATUS- See Also:
-
COLOR_SOURCE_CUSTOM_COLOR
public static final int COLOR_SOURCE_CUSTOM_COLOR- See Also:
-
COLOR_SOURCE_SCRIPT
public static final int COLOR_SOURCE_SCRIPT- See Also:
-
COLOR_SOURCE_LINK_UTILIZATION
public static final int COLOR_SOURCE_LINK_UTILIZATION- See Also:
-
COLOR_SOURCE_INTERFACE_STATUS
public static final int COLOR_SOURCE_INTERFACE_STATUS- See Also:
-
-
Constructor Details
-
NetworkMapLink
public NetworkMapLink(long id, String name, int type, long element1, long interfaceId1, long element2, long interfaceId2, String connectorName1, String connectorName2, MapLinkDataSource[] dciList, int flags) Create link object from scratch.- Parameters:
id- link object IDname- link name (will be displayed in the middle of the link)type- link typeelement1- network map internal element idinterfaceId1- ID of interface object on element1 sideelement2- network map internal element idinterfaceId2- ID of interface object on element2 sideconnectorName1- 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 IDname- link name (will be displayed in the middle of the link)type- link typeelement1- network map internal element idelement2- network map internal element idconnectorName1- 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 IDtype- link typeelement1- network map internal element idelement2- network map internal element id
-
NetworkMapLink
Create link object from NXCP message.- Parameters:
msg- NXCP messagebaseId- base field ID
-
-
Method Details
-
fillMessage
Fill NXCP message with link data- Parameters:
msg- NXCP messagebaseId- 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
- Returns:
- first (left) connector name
-
getConnectorName2
- Returns:
- second (right) connector name
-
getName
- Returns:
- the name
-
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
- Returns:
- the colorProvider
-
setColorProvider
- Parameters:
colorProvider- the colorProvider to set
-
getStatusObjects
Get list of objects used for status calculation- Returns:
- list of objects used for status calculation
-
setStatusObjects
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
-
isAutoGenerated
public boolean isAutoGenerated()Check if this link was generated automatically.- Returns:
- true if this link was generated automatically
-
isExcludedFromAutomaticUpdate
public boolean isExcludedFromAutomaticUpdate()Check if this link is excluded from automatic update- Returns:
- true if this link should be excluded from auto update
-
setExcludedFromAutomaticUpdate
public void setExcludedFromAutomaticUpdate(boolean exclude) Set if this link is excluded from automatic DCI data update- Parameters:
exclude- if it is excluded
-
hasDciData
public boolean hasDciData()- Returns:
- returns if DCI list is not empty
-
getDciList
- Returns:
- returns the DCI list if not empty or null
-
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
- Parameters:
name- the name to set
-
setConnectorName1
- Parameters:
connectorName1- the connectorName1 to set
-
setConnectorName2
- 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
- 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
-
getCommonFirstElement
public long getCommonFirstElement()Get common first element - used to check if links are inverted to each other- Returns:
- common first element
-
setCommonFirstElement
public void setCommonFirstElement(long commonFirstElement) Update common first element and set inverted flag- Parameters:
commonFirstElement-
-
isDirectionInverted
public boolean isDirectionInverted()If link direction is inverted to other links- Returns:
-
toString
-