Package org.netxms.client.maps
Class NetworkMapLink
- java.lang.Object
-
- org.netxms.client.maps.NetworkMapLink
-
public class NetworkMapLink extends Object
Represents link between two elements on map
-
-
Field Summary
Fields Modifier and Type Field Description static intAGENT_PROXYstatic intAGENT_TUNELstatic intICMP_PROXYstatic intMULTILINKstatic intNORMALstatic intROUTING_BENDPOINTSstatic intROUTING_DEFAULTstatic intROUTING_DIRECTstatic intROUTING_MANHATTANstatic intSENSOR_PROXYstatic intSNMP_PROXYstatic intSSH_PROXYstatic intVPNstatic intZONE_PROXY
-
Constructor Summary
Constructors Constructor Description NetworkMapLink(int type, long element1, long element2)NetworkMapLink(String name, int type, long element1, long element2, String connectorName1, String connectorName2, int flags)NetworkMapLink(String name, int type, long element1, long element2, String connectorName1, String connectorName2, SingleDciConfig[] dciList, int flags, boolean isLocked)NetworkMapLink(org.netxms.base.NXCPMessage msg, long baseId)Create link object from NXCP message
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfillMessage(org.netxms.base.NXCPMessage msg, long baseId)Fill NXCP message with link datalong[]getBendPoints()intgetColor()intgetColorSource()Get color sourceLinkConfiggetConfig()StringgetConnectorName1()StringgetConnectorName2()List<SingleDciConfig>getDciAsList()Returns DCI array as a listSingleDciConfig[]getDciList()intgetDuplicateCount()longgetElement1()longgetElement2()intgetFlags()StringgetLabel()Get label for display.StringgetName()intgetPosition()intgetRouting()List<Long>getStatusObjects()Get list of objects used for status calculationintgetType()booleanhasConnectorName1()Check if link has non-empty name for connector 1booleanhasConnectorName2()Check if link has non-empty name for connector 2booleanhasDciData()booleanhasName()Check if link has non-empty namevoidinitData(String name, int type, long element1, long element2, String connectorName1, String connectorName2, int flags)booleanisLocked()booleanisUnnamed()Check if this link is unnamed.voidresetPosition()Reset link position and duplicate countvoidsetBendPoints(long[] bendPoints)voidsetColor(int color)voidsetColorSource(int colorSource)Set color sourcevoidsetConnectorName1(String connectorName1)voidsetConnectorName2(String connectorName2)voidsetDuplicateCount(int duplicateCount)voidsetFlags(int flags)voidsetLocked(boolean isLocked)voidsetName(String name)voidsetRouting(int routing)voidsetStatusObjects(List<Long> statusObjects)Set list of objects used for status calculationStringtoString()voidupdatePosition()Increase link position and duplicate count
-
-
-
Field Detail
-
NORMAL
public static final int NORMAL
- See Also:
- Constant Field Values
-
VPN
public static final int VPN
- See Also:
- Constant Field Values
-
MULTILINK
public static final int MULTILINK
- See Also:
- Constant Field Values
-
AGENT_TUNEL
public static final int AGENT_TUNEL
- See Also:
- Constant Field Values
-
AGENT_PROXY
public static final int AGENT_PROXY
- See Also:
- Constant Field Values
-
SSH_PROXY
public static final int SSH_PROXY
- See Also:
- Constant Field Values
-
SNMP_PROXY
public static final int SNMP_PROXY
- See Also:
- Constant Field Values
-
ICMP_PROXY
public static final int ICMP_PROXY
- See Also:
- Constant Field Values
-
SENSOR_PROXY
public static final int SENSOR_PROXY
- See Also:
- Constant Field Values
-
ZONE_PROXY
public static final int ZONE_PROXY
- See Also:
- Constant Field Values
-
ROUTING_DEFAULT
public static final int ROUTING_DEFAULT
- See Also:
- Constant Field Values
-
ROUTING_DIRECT
public static final int ROUTING_DIRECT
- See Also:
- Constant Field Values
-
ROUTING_MANHATTAN
public static final int ROUTING_MANHATTAN
- See Also:
- Constant Field Values
-
ROUTING_BENDPOINTS
public static final int ROUTING_BENDPOINTS
- See Also:
- Constant Field Values
-
-
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 idelement2- network map internal element idconnectorName1-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 idelement2- network map internal element idconnectorName1-connectorName2-flags-
-
NetworkMapLink
public NetworkMapLink(int type, long element1, long element2)- Parameters:
type-element1- network map internal element idelement2- network map internal element id
-
NetworkMapLink
public NetworkMapLink(org.netxms.base.NXCPMessage msg, long baseId)Create link object from NXCP message- Parameters:
msg- NXCP messagebaseId- 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 idelement2- network map internal element idconnectorName1-connectorName2-flags-
-
fillMessage
public void fillMessage(org.netxms.base.NXCPMessage msg, long baseId)Fill NXCP message with link data- Parameters:
msg- NXCP messagebaseId- 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
-
getDciAsList
public List<SingleDciConfig> getDciAsList()
Returns DCI array as a 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
-
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
-
-