Package org.netxms.client.objects
Class AbstractObject
- java.lang.Object
-
- org.netxms.client.objects.AbstractObject
-
- Direct Known Subclasses:
GenericObject
public abstract class AbstractObject extends Object
Abstract base class for all NetXMS objects (both built-in and provided by extensions)
-
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractObject(long id, NXCSession session)Create dummy object of GENERIC classAbstractObject(org.netxms.base.NXCPMessage msg, NXCSession session)Create object from NXCP message
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static voidaddString(Set<String> strings, String s)Add string to string setAccessListElement[]getAccessList()Set<AbstractObject>getAllChildren(int classFilter)Get all child objects, direct and indirectSet<AbstractObject>getAllChildren(int[] classFilter)Get all child objects, direct and indirectSet<AbstractObject>getAllParents(int classFilter)Get all parent objects, direct and indirectSet<AbstractObject>getAllParents(int[] classFilter)Get all parent objects, direct and indirectlonggetBackupZoneProxyId()Get backup zone proxy IDlong[]getChildIdList()Return identifiers of all child objectsIterator<Long>getChildren()AbstractObject[]getChildrenAsArray()Get all child objects as array.StringgetComments()Get object's comments.DategetCreationTime()CustomAttributegetCustomAttribute(String key)Get object's custom attribute by keyMap<String,CustomAttribute>getCustomAttributes()Get object's custom attributesStringgetCustomAttributeValue(String key)Get object's custom attribute's value by keyList<AbstractObject>getDashboards(boolean accessibleOnly)Get list of associated dashboardslonggetDrillDownObjectId()intgetEffectiveRights()Get effective rights for this object.ObjectStatusgetFixedPropagatedStatus()org.netxms.base.GeoLocationgetGeolocation()UUIDgetGuid()UUIDgetImage()ObjectgetModuleData(String module)Get module-specific dataintgetObjectClass()StringgetObjectClassName()longgetObjectId()Get object ID (unique within single NetXMS server).StringgetObjectName()Get object name.intgetParentCount()Get number of parent objectslong[]getParentIdList()Return identifiers of all parent objectsIterator<Long>getParents()AbstractObject[]getParentsAsArray()org.netxms.base.PostalAddressgetPostalAddress()longgetPrimaryZoneProxyId()Get primary zone proxy IDList<Long>getResponsibleUsers()Get direct responsible usersObjectStatusgetStatus()Get object status.intgetStatusCalculationMethod()intgetStatusPropagationMethod()intgetStatusShift()intgetStatusSingleThreshold()int[]getStatusThresholds()ObjectStatus[]getStatusTransformation()Set<String>getStrings()Get all strings in objectList<AbstractObject>getTrustedNodes()Get list of trusted nodesList<ObjectUrl>getUrls()Get associated URLsbooleanhasAccessibleChildren()booleanhasChildren()inthashCode()booleanhasParents()booleanhasUrls()Check if object has associated URLsbooleanisAlarmsVisible()If this method returns true object can have visible alarms.booleanisAllowedOnMap()If this method returns true object is allowed to be on custom network map.booleanisChildOf(long objectId)Check if given object is direct or indirect parentbooleanisChildOf(long[] objects)Check if at least one of given objects is direct or indirect parentbooleanisDefaultImage()Check if object should be represented by class default imagebooleanisDeleted()booleanisDirectChildOf(long objectId)Check if given object is direct parentbooleanisDirectParentOf(long objectId)Check if given object is direct childbooleanisInheritAccessRights()Check setting of "inherit access rights" flagbooleanisInMaintenanceMode()booleanisParentOf(long objectId)Check if given object is direct or indirect childbooleanisParentOf(long[] objects)Check if at least one of given objects is direct or indirect childvoidsetSession(NXCSession session)Update internal session reference during session handover.
-
-
-
Field Detail
-
NETWORK
public static final int NETWORK
Entire network- See Also:
- Constant Field Values
-
SERVICEROOT
public static final int SERVICEROOT
Infrastructure Services- See Also:
- Constant Field Values
-
TEMPLATEROOT
public static final int TEMPLATEROOT
Templates- See Also:
- Constant Field Values
-
ZONE0
public static final int ZONE0
Default zone- See Also:
- Constant Field Values
-
POLICYROOT
public static final int POLICYROOT
Configuration Policies- See Also:
- Constant Field Values
-
NETWORKMAPROOT
public static final int NETWORKMAPROOT
Network Maps- See Also:
- Constant Field Values
-
DASHBOARDROOT
public static final int DASHBOARDROOT
Dashboards- See Also:
- Constant Field Values
-
REPORTROOT
public static final int REPORTROOT
Reports- See Also:
- Constant Field Values
-
BUSINESSSERVICEROOT
public static final int BUSINESSSERVICEROOT
Business Services- See Also:
- Constant Field Values
-
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_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
-
OBJECT_MOBILEDEVICE
public static final int OBJECT_MOBILEDEVICE
- See Also:
- Constant Field Values
-
OBJECT_RACK
public static final int OBJECT_RACK
- See Also:
- Constant Field Values
-
OBJECT_ACCESSPOINT
public static final int OBJECT_ACCESSPOINT
- See Also:
- Constant Field Values
-
OBJECT_AGENTPOLICY_LOGPARSER
public static final int OBJECT_AGENTPOLICY_LOGPARSER
- See Also:
- Constant Field Values
-
OBJECT_CHASSIS
public static final int OBJECT_CHASSIS
- See Also:
- Constant Field Values
-
OBJECT_DASHBOARDGROUP
public static final int OBJECT_DASHBOARDGROUP
- See Also:
- Constant Field Values
-
OBJECT_SENSOR
public static final int OBJECT_SENSOR
- See Also:
- Constant Field Values
-
OBJECT_CUSTOM
public static final int OBJECT_CUSTOM
- 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
-
objectId
protected long objectId
-
guid
protected UUID guid
-
objectName
protected String objectName
-
objectClass
protected int objectClass
-
status
protected ObjectStatus status
-
isDeleted
protected boolean isDeleted
-
inMaintenanceMode
protected boolean inMaintenanceMode
-
primaryZoneProxyId
protected long primaryZoneProxyId
-
backupZoneProxyId
protected long backupZoneProxyId
-
comments
protected String comments
-
geolocation
protected org.netxms.base.GeoLocation geolocation
-
postalAddress
protected org.netxms.base.PostalAddress postalAddress
-
image
protected UUID image
-
drillDownObjectId
protected long drillDownObjectId
-
inheritAccessRights
protected boolean inheritAccessRights
-
accessList
protected HashSet<AccessListElement> accessList
-
statusCalculationMethod
protected int statusCalculationMethod
-
statusPropagationMethod
protected int statusPropagationMethod
-
fixedPropagatedStatus
protected ObjectStatus fixedPropagatedStatus
-
statusShift
protected int statusShift
-
statusTransformation
protected ObjectStatus[] statusTransformation
-
statusSingleThreshold
protected int statusSingleThreshold
-
statusThresholds
protected int[] statusThresholds
-
creationTime
protected Date creationTime
-
customAttributes
protected final Map<String,CustomAttribute> customAttributes
-
-
Constructor Detail
-
AbstractObject
protected AbstractObject(long id, NXCSession session)Create dummy object of GENERIC class- Parameters:
id- object ID to setsession- associated session
-
AbstractObject
public AbstractObject(org.netxms.base.NXCPMessage msg, NXCSession session)Create object from NXCP message- Parameters:
msg- Message to create object fromsession- 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
-
getParentCount
public int getParentCount()
Get number of parent objects- Returns:
- number of parent objects
-
getAccessList
public AccessListElement[] getAccessList()
- Returns:
- Access list
-
hasUrls
public boolean hasUrls()
Check if object has associated URLs- Returns:
- true if object has associated URLs
-
getComments
public String getComments()
Get object's comments.- Returns:
- object's comments
-
getObjectId
public long getObjectId()
Get object ID (unique within single NetXMS server).- Returns:
- object ID
-
getObjectName
public String getObjectName()
Get object name.- Returns:
- object name
-
getStatus
public ObjectStatus getStatus()
Get object status.- Returns:
- object status
-
isDeleted
public boolean isDeleted()
- Returns:
- the isDeleted
-
isInheritAccessRights
public boolean isInheritAccessRights()
Check setting of "inherit access rights" flag- Returns:
- true if "inherit access rights" flag is set
-
isChildOf
public boolean isChildOf(long objectId)
Check if given object is direct or indirect parent- Parameters:
objectId- ID of object to check- Returns:
- true if given object is direct or indirect parent of this object
-
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- Returns:
- true if at least one of given objects is direct or indirect parent of this object
-
isDirectChildOf
public boolean isDirectChildOf(long objectId)
Check if given object is direct parent- Parameters:
objectId- ID of object to check
-
isParentOf
public boolean isParentOf(long objectId)
Check if given object is direct or indirect child- Parameters:
objectId- ID of object to check- Returns:
- true if given object is direct or indirect child of this object
-
isParentOf
public boolean isParentOf(long[] objects)
Check if at least one of given objects is direct or indirect child- Parameters:
objects- List of object identifiers to check- Returns:
- true if at least one of given objects is direct or indirect child of this object
-
isDirectParentOf
public boolean isDirectParentOf(long objectId)
Check if given object is direct child- Parameters:
objectId- ID of object to check- Returns:
- true if given object is direct child of this object
-
getParentsAsArray
public AbstractObject[] getParentsAsArray()
- Returns:
- List of parent objects
-
getChildrenAsArray
public AbstractObject[] getChildrenAsArray()
Get all child objects as array.- Returns:
- Array of child objects
-
getChildIdList
public long[] getChildIdList()
Return identifiers of all child objects- Returns:
- list of children
-
getParentIdList
public long[] getParentIdList()
Return identifiers of all parent objects- Returns:
- list of object parents
-
getAllChildren
public Set<AbstractObject> getAllChildren(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
-
getAllChildren
public Set<AbstractObject> getAllChildren(int[] classFilter)
Get all child objects, direct and indirect- Parameters:
classFilter- null to get all childs, or NetXMS class id(s) to retrieve objects of given class(es)- Returns:
- set of child objects
-
getAllParents
public Set<AbstractObject> getAllParents(int classFilter)
Get all parent objects, direct and indirect- Parameters:
classFilter- -1 to get all parents, or NetXMS class id to retrieve objects of given class- Returns:
- set of parent objects
-
getAllParents
public Set<AbstractObject> getAllParents(int[] classFilter)
Get all parent objects, direct and indirect- Parameters:
classFilter- null to get all parents, or NetXMS class id(s) to retrieve objects of given class(es)- Returns:
- set of parent objects
-
getTrustedNodes
public List<AbstractObject> getTrustedNodes()
Get list of trusted nodes- Returns:
- List of trusted nodes
-
getDashboards
public List<AbstractObject> getDashboards(boolean accessibleOnly)
Get list of associated dashboards- Parameters:
accessibleOnly- if set to true, only accessible dashboards will be returned- Returns:
- list of the dashboard objects
-
hasParents
public boolean hasParents()
- Returns:
- true if object has parents
-
hasChildren
public boolean hasChildren()
- Returns:
- true if object has children
-
hasAccessibleChildren
public boolean hasAccessibleChildren()
- Returns:
- true if object has children accessible by this session
-
isAllowedOnMap
public boolean isAllowedOnMap()
If this method returns true object is allowed to be on custom network map. Default implementation always returns false.- Returns:
- true if object is allowed to be on custom network map
-
isAlarmsVisible
public boolean isAlarmsVisible()
If this method returns true object can have visible alarms. Default implementation always returns false.- Returns:
- true if object can contain visible alarms
-
getObjectClass
public int getObjectClass()
- Returns:
- the objectClass
-
getObjectClassName
public String getObjectClassName()
- Returns:
- Name of NetXMS object's class
-
getCustomAttributes
public Map<String,CustomAttribute> getCustomAttributes()
Get object's custom attributes
-
getCustomAttribute
public CustomAttribute getCustomAttribute(String key)
Get object's custom attribute by key- Returns:
- custom attribute object or null
-
getCustomAttributeValue
public String getCustomAttributeValue(String key)
Get object's custom attribute's value by key- Returns:
- custom attribute's value or null
-
getGeolocation
public org.netxms.base.GeoLocation getGeolocation()
- Returns:
- the geolocation
-
getGuid
public UUID getGuid()
- Returns:
- the guid
-
getImage
public UUID getImage()
- Returns:
- the image
-
getDrillDownObjectId
public long getDrillDownObjectId()
- Returns:
- the submapId
-
getStatusCalculationMethod
public int getStatusCalculationMethod()
- Returns:
- the statusCalculationMethod
-
getStatusPropagationMethod
public int getStatusPropagationMethod()
- Returns:
- the statusPropagationMethod
-
getFixedPropagatedStatus
public ObjectStatus getFixedPropagatedStatus()
- Returns:
- the fixedPropagatedStatus
-
getStatusShift
public int getStatusShift()
- Returns:
- the statusShift
-
getStatusTransformation
public ObjectStatus[] 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
-
getEffectiveRights
public int getEffectiveRights()
Get effective rights for this object. On first call this method will do request to server, and on all subsequent calls will return cached value obtained at first call.- Returns:
- effective user rights on this object
-
getModuleData
public Object getModuleData(String module)
Get module-specific data- Parameters:
module- module name- Returns:
- custom data in module-specific format
-
getPostalAddress
public org.netxms.base.PostalAddress getPostalAddress()
- Returns:
- the postalAddress
-
isInMaintenanceMode
public boolean isInMaintenanceMode()
- Returns:
- the inMaintenanceMode
-
getPrimaryZoneProxyId
public long getPrimaryZoneProxyId()
Get primary zone proxy ID- Returns:
- primary zone proxy ID
-
getBackupZoneProxyId
public long getBackupZoneProxyId()
Get backup zone proxy ID- Returns:
- backup zone proxy ID
-
addString
protected static void addString(Set<String> strings, String s)
Add string to string set- Parameters:
strings-s-
-
getStrings
public Set<String> getStrings()
Get all strings in object- Returns:
- set of all strings in object
-
getResponsibleUsers
public List<Long> getResponsibleUsers()
Get direct responsible users- Returns:
- responsible users list
-
getCreationTime
public Date getCreationTime()
- Returns:
- the creationTime
-
-