org.netxms.client.objects
Class GenericObject

java.lang.Object
  extended by org.netxms.client.objects.GenericObject
Direct Known Subclasses:
AgentPolicy, Cluster, Condition, Container, Dashboard, DashboardRoot, EntireNetwork, Interface, NetworkMap, NetworkMapGroup, NetworkMapRoot, NetworkService, Node, PolicyGroup, PolicyRoot, Report, ReportGroup, ReportRoot, ServiceCheck, ServiceContainer, ServiceRoot, Subnet, Template, TemplateGroup, TemplateRoot, UnknownObject, Zone

public class GenericObject
extends java.lang.Object

Generic NetXMS object class


Field Summary
static int CALCULATE_DEFAULT
           
static int CALCULATE_MOST_CRITICAL
           
static int CALCULATE_MULTIPLE_THRESHOLDS
           
static int CALCULATE_SINGLE_THRESHOLD
           
protected  java.util.HashSet<java.lang.Long> childs
           
protected  java.util.Map<java.lang.String,java.lang.String> customAttributes
           
static int OBJECT_AGENTPOLICY
           
static int OBJECT_AGENTPOLICY_CONFIG
           
static int OBJECT_BUSINESSSERVICE
           
static int OBJECT_BUSINESSSERVICEROOT
           
static int OBJECT_CLUSTER
           
static int OBJECT_CONDITION
           
static int OBJECT_CONTAINER
           
static int OBJECT_DASHBOARD
           
static int OBJECT_DASHBOARDROOT
           
static int OBJECT_GENERIC
           
static int OBJECT_INTERFACE
           
static int OBJECT_NETWORK
           
static int OBJECT_NETWORKMAP
           
static int OBJECT_NETWORKMAPGROUP
           
static int OBJECT_NETWORKMAPROOT
           
static int OBJECT_NETWORKSERVICE
           
static int OBJECT_NODE
           
static int OBJECT_NODELINK
           
static int OBJECT_POLICYGROUP
           
static int OBJECT_POLICYROOT
           
static int OBJECT_REPORT
           
static int OBJECT_REPORTGROUP
           
static int OBJECT_REPORTROOT
           
static int OBJECT_SERVICEROOT
           
static int OBJECT_SLMCHECK
           
static int OBJECT_SUBNET
           
static int OBJECT_TEMPLATE
           
static int OBJECT_TEMPLATEGROUP
           
static int OBJECT_TEMPLATEROOT
           
static int OBJECT_VPNCONNECTOR
           
static int OBJECT_ZONE
           
protected  java.util.HashSet<java.lang.Long> parents
           
static int PROPAGATE_DEFAULT
           
static int PROPAGATE_FIXED
           
static int PROPAGATE_RELATIVE
           
static int PROPAGATE_TRANSLATED
           
static int PROPAGATE_UNCHANGED
           
protected  NXCSession session
           
static int STATUS_CRITICAL
           
static int STATUS_DISABLED
           
static int STATUS_MAJOR
           
static int STATUS_MINOR
           
static int STATUS_NORMAL
           
static int STATUS_TESTING
           
static int STATUS_UNKNOWN
           
static int STATUS_UNMANAGED
           
static int STATUS_WARNING
           
 
Constructor Summary
protected GenericObject(long id, NXCSession session)
          Create dummy object of GENERIC class
  GenericObject(NXCPMessage msg, NXCSession session)
          Create object from NXCP message
 
Method Summary
 AccessListElement[] getAccessList()
           
 java.util.Set<GenericObject> getAllChilds(int classFilter)
          Get all child objects, direct and indirect
 long[] getChildIdList()
          Return identifiers of all child objects
 java.util.Iterator<java.lang.Long> getChilds()
           
 GenericObject[] getChildsAsArray()
           
 java.lang.String getComments()
           
 java.util.Map<java.lang.String,java.lang.String> getCustomAttributes()
          Get object's custom attributes
 int getFixedPropagatedStatus()
           
 GeoLocation getGeolocation()
           
 java.util.UUID getGuid()
           
 java.util.UUID getImage()
           
 int getNumberOfChilds()
           
 int getNumberOfParents()
           
 int getObjectClass()
           
 java.lang.String getObjectClassName()
           
 long getObjectId()
           
 java.lang.String getObjectName()
           
 long[] getParentIdList()
          Return identifiers of all parent objects
 java.util.Iterator<java.lang.Long> getParents()
           
 GenericObject[] getParentsAsArray()
           
 java.net.InetAddress getPrimaryIP()
           
 int getStatus()
           
 int getStatusCalculationMethod()
           
 int getStatusPropagationMethod()
           
 int getStatusShift()
           
 int getStatusSingleThreshold()
           
 int[] getStatusThresholds()
           
 int[] getStatusTransformation()
           
 long getSubmapId()
           
 GenericObject[] getTrustedNodes()
           
 int hashCode()
           
 boolean isChildOf(long objectId)
          Check if given object is direct or indirect parent
 boolean isChildOf(long[] objects)
          Check if at least one of given objects is direct or indirect parent
 boolean isDefaultImage()
          Check if object should be represented by class default image
 boolean isDeleted()
           
 boolean isDirectChildOf(long objectId)
          Check if given object is direct parent
 boolean isInheritAccessRights()
           
 void setSession(NXCSession session)
          Update internal session reference during session handover.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OBJECT_GENERIC

public static final int OBJECT_GENERIC
See Also:
Constant Field Values

OBJECT_SUBNET

public static final int OBJECT_SUBNET
See Also:
Constant Field Values

OBJECT_NODE

public static final int OBJECT_NODE
See Also:
Constant Field Values

OBJECT_INTERFACE

public static final int OBJECT_INTERFACE
See Also:
Constant Field Values

OBJECT_NETWORK

public static final int OBJECT_NETWORK
See Also:
Constant Field Values

OBJECT_CONTAINER

public static final int OBJECT_CONTAINER
See Also:
Constant Field Values

OBJECT_ZONE

public static final int OBJECT_ZONE
See Also:
Constant Field Values

OBJECT_SERVICEROOT

public static final int OBJECT_SERVICEROOT
See Also:
Constant Field Values

OBJECT_TEMPLATE

public static final int OBJECT_TEMPLATE
See Also:
Constant Field Values

OBJECT_TEMPLATEGROUP

public static final int OBJECT_TEMPLATEGROUP
See Also:
Constant Field Values

OBJECT_TEMPLATEROOT

public static final int OBJECT_TEMPLATEROOT
See Also:
Constant Field Values

OBJECT_NETWORKSERVICE

public static final int OBJECT_NETWORKSERVICE
See Also:
Constant Field Values

OBJECT_VPNCONNECTOR

public static final int OBJECT_VPNCONNECTOR
See Also:
Constant Field Values

OBJECT_CONDITION

public static final int OBJECT_CONDITION
See Also:
Constant Field Values

OBJECT_CLUSTER

public static final int OBJECT_CLUSTER
See Also:
Constant Field Values

OBJECT_POLICYGROUP

public static final int OBJECT_POLICYGROUP
See Also:
Constant Field Values

OBJECT_POLICYROOT

public static final int OBJECT_POLICYROOT
See Also:
Constant Field Values

OBJECT_AGENTPOLICY

public static final int OBJECT_AGENTPOLICY
See Also:
Constant Field Values

OBJECT_AGENTPOLICY_CONFIG

public static final int OBJECT_AGENTPOLICY_CONFIG
See Also:
Constant Field Values

OBJECT_NETWORKMAPROOT

public static final int OBJECT_NETWORKMAPROOT
See Also:
Constant Field Values

OBJECT_NETWORKMAPGROUP

public static final int OBJECT_NETWORKMAPGROUP
See Also:
Constant Field Values

OBJECT_NETWORKMAP

public static final int OBJECT_NETWORKMAP
See Also:
Constant Field Values

OBJECT_DASHBOARDROOT

public static final int OBJECT_DASHBOARDROOT
See Also:
Constant Field Values

OBJECT_DASHBOARD

public static final int OBJECT_DASHBOARD
See Also:
Constant Field Values

OBJECT_REPORTROOT

public static final int OBJECT_REPORTROOT
See Also:
Constant Field Values

OBJECT_REPORTGROUP

public static final int OBJECT_REPORTGROUP
See Also:
Constant Field Values

OBJECT_REPORT

public static final int OBJECT_REPORT
See Also:
Constant Field Values

OBJECT_BUSINESSSERVICEROOT

public static final int OBJECT_BUSINESSSERVICEROOT
See Also:
Constant Field Values

OBJECT_BUSINESSSERVICE

public static final int OBJECT_BUSINESSSERVICE
See Also:
Constant Field Values

OBJECT_NODELINK

public static final int OBJECT_NODELINK
See Also:
Constant Field Values

OBJECT_SLMCHECK

public static final int OBJECT_SLMCHECK
See Also:
Constant Field Values

STATUS_NORMAL

public static final int STATUS_NORMAL
See Also:
Constant Field Values

STATUS_WARNING

public static final int STATUS_WARNING
See Also:
Constant Field Values

STATUS_MINOR

public static final int STATUS_MINOR
See Also:
Constant Field Values

STATUS_MAJOR

public static final int STATUS_MAJOR
See Also:
Constant Field Values

STATUS_CRITICAL

public static final int STATUS_CRITICAL
See Also:
Constant Field Values

STATUS_UNKNOWN

public static final int STATUS_UNKNOWN
See Also:
Constant Field Values

STATUS_UNMANAGED

public static final int STATUS_UNMANAGED
See Also:
Constant Field Values

STATUS_DISABLED

public static final int STATUS_DISABLED
See Also:
Constant Field Values

STATUS_TESTING

public static final int STATUS_TESTING
See Also:
Constant Field Values

CALCULATE_DEFAULT

public static final int CALCULATE_DEFAULT
See Also:
Constant Field Values

CALCULATE_MOST_CRITICAL

public static final int CALCULATE_MOST_CRITICAL
See Also:
Constant Field Values

CALCULATE_SINGLE_THRESHOLD

public static final int CALCULATE_SINGLE_THRESHOLD
See Also:
Constant Field Values

CALCULATE_MULTIPLE_THRESHOLDS

public static final int CALCULATE_MULTIPLE_THRESHOLDS
See Also:
Constant Field Values

PROPAGATE_DEFAULT

public static final int PROPAGATE_DEFAULT
See Also:
Constant Field Values

PROPAGATE_UNCHANGED

public static final int PROPAGATE_UNCHANGED
See Also:
Constant Field Values

PROPAGATE_FIXED

public static final int PROPAGATE_FIXED
See Also:
Constant Field Values

PROPAGATE_RELATIVE

public static final int PROPAGATE_RELATIVE
See Also:
Constant Field Values

PROPAGATE_TRANSLATED

public static final int PROPAGATE_TRANSLATED
See Also:
Constant Field Values

session

protected NXCSession session

parents

protected java.util.HashSet<java.lang.Long> parents

childs

protected java.util.HashSet<java.lang.Long> childs

customAttributes

protected java.util.Map<java.lang.String,java.lang.String> customAttributes
Constructor Detail

GenericObject

protected GenericObject(long id,
                        NXCSession session)
Create dummy object of GENERIC class

Parameters:
id - object ID to set
session - associated session

GenericObject

public GenericObject(NXCPMessage msg,
                     NXCSession session)
Create object from NXCP message

Parameters:
msg - Message to create object from
session - Associated client session
Method Detail

isDefaultImage

public boolean isDefaultImage()
Check if object should be represented by class default image

Returns:
true if default image should be used

getParents

public java.util.Iterator<java.lang.Long> getParents()
Returns:
Iterator for list of parent objects

getChilds

public java.util.Iterator<java.lang.Long> getChilds()
Returns:
Iterator for list of child objects

getAccessList

public AccessListElement[] getAccessList()
Returns:
Access list

getComments

public java.lang.String getComments()
Returns:
the comments

getObjectId

public long getObjectId()
Returns:
the objectId

getObjectName

public java.lang.String getObjectName()
Returns:
the objectName

getPrimaryIP

public java.net.InetAddress getPrimaryIP()
Returns:
the primaryIP

getStatus

public int getStatus()
Returns:
the status

isDeleted

public boolean isDeleted()
Returns:
the isDeleted

isInheritAccessRights

public boolean isInheritAccessRights()
Returns:
the inheritAccessRights

isChildOf

public boolean isChildOf(long objectId)
Check if given object is direct or indirect parent

Parameters:
objectId - ID of object to check

isChildOf

public boolean isChildOf(long[] objects)
Check if at least one of given objects is direct or indirect parent

Parameters:
objects - List of object ID to check

isDirectChildOf

public boolean isDirectChildOf(long objectId)
Check if given object is direct parent

Parameters:
objectId - ID of object to check

getParentsAsArray

public GenericObject[] getParentsAsArray()
Returns:
List of parent objects

getChildsAsArray

public GenericObject[] getChildsAsArray()
Returns:
List of child objects

getChildIdList

public long[] getChildIdList()
Return identifiers of all child objects

Returns:

getParentIdList

public long[] getParentIdList()
Return identifiers of all parent objects

Returns:

getAllChilds

public java.util.Set<GenericObject> getAllChilds(int classFilter)
Get all child objects, direct and indirect

Parameters:
classFilter - -1 to get all childs, or NetXMS class id to retrieve objects of given class
Returns:
set of child objects

getTrustedNodes

public GenericObject[] getTrustedNodes()
Returns:
List of trusted nodes

getNumberOfParents

public int getNumberOfParents()
Returns:
Number of parent objects

getNumberOfChilds

public int getNumberOfChilds()
Returns:
Number of child objects

getObjectClass

public int getObjectClass()
Returns:
the objectClass

getObjectClassName

public java.lang.String getObjectClassName()
Returns:
Name of NetXMS object's class

getCustomAttributes

public java.util.Map<java.lang.String,java.lang.String> getCustomAttributes()
Get object's custom attributes


getGeolocation

public GeoLocation getGeolocation()
Returns:
the geolocation

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getGuid

public java.util.UUID getGuid()
Returns:
the guid

getImage

public java.util.UUID getImage()
Returns:
the image

getSubmapId

public long getSubmapId()
Returns:
the submapId

getStatusCalculationMethod

public int getStatusCalculationMethod()
Returns:
the statusCalculationMethod

getStatusPropagationMethod

public int getStatusPropagationMethod()
Returns:
the statusPropagationMethod

getFixedPropagatedStatus

public int getFixedPropagatedStatus()
Returns:
the fixedPropagatedStatus

getStatusShift

public int getStatusShift()
Returns:
the statusShift

getStatusTransformation

public int[] getStatusTransformation()
Returns:
the statusTransformation

getStatusSingleThreshold

public int getStatusSingleThreshold()
Returns:
the statusSingleThreshold

getStatusThresholds

public int[] getStatusThresholds()
Returns:
the statusThresholds

setSession

public final void setSession(NXCSession session)
Update internal session reference during session handover. This method should not be called directly!

Parameters:
session - new session object


Copyright © 2012. All Rights Reserved.