org.netxms.client.maps
Class NetworkMapLink

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

public class NetworkMapLink
extends java.lang.Object

Represents link between two elements on map


Field Summary
static int NORMAL
           
static int VPN
           
 
Constructor Summary
NetworkMapLink(int type, long element1, long element2)
           
NetworkMapLink(NXCPMessage msg, long baseId)
          Create link object from NXCP message
NetworkMapLink(java.lang.String name, int type, long element1, long element2, java.lang.String connectorName1, java.lang.String connectorName2)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 void fillMessage(NXCPMessage msg, long baseId)
          Fill NXCP message with link data
 java.lang.String getConnectorName1()
           
 java.lang.String getConnectorName2()
           
 long getElement1()
           
 long getElement2()
           
 java.lang.String getLabel()
          Get label for display.
 java.lang.String getName()
           
 int getType()
           
 boolean hasConnectorName1()
          Check if link has non-empty name for connector 1
 boolean hasConnectorName2()
          Check if link has non-empty name for connector 2
 boolean hasName()
          Check if link has non-empty name
 boolean isUnnamed()
          Check if this link is unnamed.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NORMAL

public static final int NORMAL
See Also:
Constant Field Values

VPN

public static final int VPN
See Also:
Constant Field Values
Constructor Detail

NetworkMapLink

public NetworkMapLink(java.lang.String name,
                      int type,
                      long element1,
                      long element2,
                      java.lang.String connectorName1,
                      java.lang.String connectorName2)
Parameters:
name -
type -
element1 -
element2 -
connectorName1 -
connectorName2 -

NetworkMapLink

public NetworkMapLink(int type,
                      long element1,
                      long element2)
Parameters:
linkType -
element1 -
element2 -
connectorName1 -
connectorName2 -

NetworkMapLink

public NetworkMapLink(NXCPMessage msg,
                      long baseId)
Create link object from NXCP message

Parameters:
msg - NXCP message
baseId - base variable ID
Method Detail

fillMessage

public void fillMessage(NXCPMessage msg,
                        long baseId)
Fill NXCP message with link data

Parameters:
msg - NXCP message
baseId - 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 java.lang.String getConnectorName1()
Returns:
first (left) connector name

getConnectorName2

public java.lang.String getConnectorName2()
Returns:
second (right) connector name

getName

public java.lang.String getName()
Returns:
the name

getLabel

public java.lang.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 "".

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

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 2011. All Rights Reserved.