Package org.netxms.client.maps
Class NetworkMapLink
java.lang.Object
org.netxms.client.maps.NetworkMapLink
Represents link between two elements on map.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
-
Constructor Summary
ConstructorDescriptionNetworkMapLink
(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, SingleDciConfig[] 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 TypeMethodDescriptionvoid
fillMessage
(NXCPMessage msg, long baseId) Fill NXCP message with link datalong[]
int
getColor()
int
Get color sourceGet copy of DCIs configured on this link as list.int
long
long
int
getFlags()
long
getId()
long
long
getLabel()
Get label for display.getName()
int
int
Get list of objects used for status calculationint
getType()
boolean
Check if link has non-empty name for connector 1boolean
Check if link has non-empty name for connector 2boolean
boolean
hasName()
Check if link has non-empty nameboolean
Check if this link was generated automatically.boolean
Check if this link is unnamed.void
Reset link position and duplicate countvoid
setBendPoints
(long[] bendPoints) void
setColor
(int color) void
setColorProvider
(String colorProvider) void
setColorSource
(int colorSource) Set color sourcevoid
setConnectorName1
(String connectorName1) void
setConnectorName2
(String connectorName2) void
setDuplicateCount
(int duplicateCount) void
setFlags
(int flags) void
setInterfaceId1
(long interfaceId1) void
setInterfaceId2
(long interfaceId2) void
void
setRouting
(int routing) void
setStatusObjects
(List<Long> statusObjects) Set list of objects used for status calculationtoString()
void
Increase link position and duplicate count
-
Field Details
-
AUTO_GENERATED
public static final int AUTO_GENERATED- 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, SingleDciConfig[] 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
-
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
- 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
-
toString
-