Package org.netxms.client.maps
Class NetworkMapLink
java.lang.Object
org.netxms.client.maps.NetworkMapLink
Represents link between two elements on map.
- 
Field SummaryFieldsModifier 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 SummaryConstructorsConstructorDescriptionNetworkMapLink(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 SummaryModifier 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_GENERATEDpublic static final int AUTO_GENERATED- See Also:
 
- 
EXCLUDE_FROM_AUTO_UPDATEpublic static final int EXCLUDE_FROM_AUTO_UPDATE- See Also:
 
- 
NORMALpublic static final int NORMAL- See Also:
 
- 
VPNpublic static final int VPN- See Also:
 
- 
MULTILINKpublic static final int MULTILINK- See Also:
 
- 
AGENT_TUNELpublic static final int AGENT_TUNEL- See Also:
 
- 
AGENT_PROXYpublic static final int AGENT_PROXY- See Also:
 
- 
SSH_PROXYpublic static final int SSH_PROXY- See Also:
 
- 
SNMP_PROXYpublic static final int SNMP_PROXY- See Also:
 
- 
ICMP_PROXYpublic static final int ICMP_PROXY- See Also:
 
- 
SENSOR_PROXYpublic static final int SENSOR_PROXY- See Also:
 
- 
ZONE_PROXYpublic static final int ZONE_PROXY- See Also:
 
- 
ROUTING_DEFAULTpublic static final int ROUTING_DEFAULT- See Also:
 
- 
ROUTING_DIRECTpublic static final int ROUTING_DIRECT- See Also:
 
- 
ROUTING_MANHATTANpublic static final int ROUTING_MANHATTAN- See Also:
 
- 
ROUTING_BENDPOINTSpublic static final int ROUTING_BENDPOINTS- See Also:
 
- 
COLOR_SOURCE_UNDEFINEDpublic static final int COLOR_SOURCE_UNDEFINED- See Also:
 
- 
COLOR_SOURCE_DEFAULTpublic static final int COLOR_SOURCE_DEFAULT- See Also:
 
- 
COLOR_SOURCE_OBJECT_STATUSpublic static final int COLOR_SOURCE_OBJECT_STATUS- See Also:
 
- 
COLOR_SOURCE_CUSTOM_COLORpublic static final int COLOR_SOURCE_CUSTOM_COLOR- See Also:
 
- 
COLOR_SOURCE_SCRIPTpublic static final int COLOR_SOURCE_SCRIPT- See Also:
 
- 
COLOR_SOURCE_LINK_UTILIZATIONpublic static final int COLOR_SOURCE_LINK_UTILIZATION- See Also:
 
- 
COLOR_SOURCE_INTERFACE_STATUSpublic static final int COLOR_SOURCE_INTERFACE_STATUS- See Also:
 
 
- 
- 
Constructor Details- 
NetworkMapLinkpublic 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 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
 
- 
NetworkMapLinkpublic 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
 
- 
NetworkMapLinkpublic 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
 
- 
NetworkMapLinkCreate link object from NXCP message.- Parameters:
- msg- NXCP message
- baseId- base field ID
 
 
- 
- 
Method Details- 
fillMessageFill NXCP message with link data- Parameters:
- msg- NXCP message
- baseId- base variable ID
 
- 
getIdpublic long getId()- Returns:
- the id
 
- 
getTypepublic int getType()- Returns:
- the linkType
 
- 
getElement1public long getElement1()- Returns:
- first (left) element
 
- 
getElement2public long getElement2()- Returns:
- second (right) element
 
- 
getConnectorName1- Returns:
- first (left) connector name
 
- 
getConnectorName2- Returns:
- second (right) connector name
 
- 
getName- Returns:
- the name
 
- 
getLabelGet 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
 
- 
hasNamepublic boolean hasName()Check if link has non-empty name- Returns:
- true if link has non-empty name
 
- 
hasConnectorName1public boolean hasConnectorName1()Check if link has non-empty name for connector 1- Returns:
- true if link has non-empty name for connector 1
 
- 
hasConnectorName2public boolean hasConnectorName2()Check if link has non-empty name for connector 2- Returns:
- true if link has non-empty name for connector 2
 
- 
isUnnamedpublic boolean isUnnamed()Check if this link is unnamed.- Returns:
- true if all names (link and both connectors) are null or empty
 
- 
getColorpublic int getColor()- Returns:
- the color
 
- 
setColorpublic void setColor(int color) - Parameters:
- color- the color to set
 
- 
getColorSourcepublic int getColorSource()Get color source- Returns:
- color source
 
- 
setColorSourcepublic void setColorSource(int colorSource) Set color source- Parameters:
- colorSource- new color source
 
- 
getColorProvider- Returns:
- the colorProvider
 
- 
setColorProvider- Parameters:
- colorProvider- the colorProvider to set
 
- 
getStatusObjectsGet list of objects used for status calculation- Returns:
- list of objects used for status calculation
 
- 
setStatusObjectsSet list of objects used for status calculation- Parameters:
- statusObjects- new list of objects
 
- 
getRoutingpublic int getRouting()- Returns:
- the routing
 
- 
setRoutingpublic void setRouting(int routing) - Parameters:
- routing- the routing to set
 
- 
getBendPointspublic long[] getBendPoints()- Returns:
- the bendPoints
 
- 
setBendPointspublic void setBendPoints(long[] bendPoints) - Parameters:
- bendPoints- the bendPoints to set
 
- 
getFlagspublic int getFlags()- Returns:
- the flags
 
- 
isAutoGeneratedpublic boolean isAutoGenerated()Check if this link was generated automatically.- Returns:
- true if this link was generated automatically
 
- 
isExcludedFromAutomaticUpdatepublic boolean isExcludedFromAutomaticUpdate()Check if this link is excluded from automatic update- Returns:
- true if this link should be excluded from auto update
 
- 
setExcludedFromAutomaticUpdatepublic void setExcludedFromAutomaticUpdate(boolean exclude) Set if this link is excluded from automatic DCI data update- Parameters:
- exclude- if it is excluded
 
- 
hasDciDatapublic boolean hasDciData()- Returns:
- returns if DCI list is not empty
 
- 
getDciList- Returns:
- returns the DCI list if not empty or null
 
- 
getDciAsListGet 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
 
- 
setDuplicateCountpublic void setDuplicateCount(int duplicateCount) 
- 
getDuplicateCountpublic int getDuplicateCount()- Returns:
- link duplicate count
 
- 
updatePositionpublic void updatePosition()Increase link position and duplicate count
- 
resetPositionpublic void resetPosition()Reset link position and duplicate count
- 
getPositionpublic int getPosition()- Returns:
- link position
 
- 
getConfig- Returns:
- link config
 
- 
getInterfaceId1public long getInterfaceId1()- Returns:
- the interfaceId1
 
- 
setInterfaceId1public void setInterfaceId1(long interfaceId1) - Parameters:
- interfaceId1- the interfaceId1 to set
 
- 
getInterfaceId2public long getInterfaceId2()- Returns:
- the interfaceId2
 
- 
setInterfaceId2public void setInterfaceId2(long interfaceId2) - Parameters:
- interfaceId2- the interfaceId2 to set
 
- 
getCommonFirstElementpublic long getCommonFirstElement()Get common first element - used to check if links are inverted to each other- Returns:
- common first element
 
- 
setCommonFirstElementpublic void setCommonFirstElement(long commonFirstElement) Update common first element and set inverted flag- Parameters:
- commonFirstElement-
 
- 
isDirectionInvertedpublic boolean isDirectionInverted()If link direction is inverted to other links- Returns:
 
- 
toString
 
-