Package org.netxms.client.datacollection
Class DataCollectionConfiguration
- java.lang.Object
-
- org.netxms.client.datacollection.DataCollectionConfiguration
-
public class DataCollectionConfiguration extends Object
Data collection configuration for node
-
-
Constructor Summary
Constructors Constructor Description DataCollectionConfiguration(NXCSession session, long nodeId)Create empty data collection configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclearCollectedData(long itemId)Clear collected data for given DCI.voidclose()Close data collection configuration.voidcopyObjects(long destNodeId, long[] items)Copy data collection objects.longcreateItem(DataCollectionObject object)Deprecated.longcreateTable(DataCollectionObject object)Deprecated.voiddeleteObject(long itemId)Delete data collection object.protected voidfinalize()DataCollectionObjectfindItem(long id)Find data collection object by ID.DataCollectionObjectfindItem(long id, Class<? extends DataCollectionObject> classFilter)Find data collection object by ID.DataCollectionObject[]getItems()Get list of data collection itemslonggetNodeId()protected NXCSessiongetSession()ObjectgetUserData()voidmodifyObject(long dcObjectId)Modify data collection object.longmodifyObject(DataCollectionObject dco)Modify data collection object.voidmoveObjects(long destNodeId, long[] items)Move data collection objects.voidopen(DataCollectionConfigurationChangeListener changeListener)Open data collection configuration.voidrefreshDataCollectionList()Force refresh DCI listvoidsetObjectStatus(long[] items, int status)Set status of data collection objects.voidsetUserData(Object userData)
-
-
-
Constructor Detail
-
DataCollectionConfiguration
public DataCollectionConfiguration(NXCSession session, long nodeId)
Create empty data collection configuration.- Parameters:
session- The NXCSessionnodeId- The node ID
-
-
Method Detail
-
open
public void open(DataCollectionConfigurationChangeListener changeListener) throws IOException, NXCException
Open data collection configuration.- Parameters:
changeListener- change listener- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
refreshDataCollectionList
public void refreshDataCollectionList() throws IOException, NXCExceptionForce refresh DCI list- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
close
public void close() throws IOException, NXCExceptionClose data collection configuration.- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
getItems
public DataCollectionObject[] getItems()
Get list of data collection items- Returns:
- List of data collection items
-
findItem
public DataCollectionObject findItem(long id)
Find data collection object by ID.- Parameters:
id- DCI ID- Returns:
- Data collection item or null if item with given ID does not exist
-
findItem
public DataCollectionObject findItem(long id, Class<? extends DataCollectionObject> classFilter)
Find data collection object by ID.- Parameters:
id- data collection object IDclassFilter- class filter for found object- Returns:
- Data collection item or null if item with given ID does not exist
-
createItem
@Deprecated public long createItem(DataCollectionObject object) throws IOException, NXCException
Deprecated.Create new data collection item. This method is deprecated - new code should call modifyObject().- Parameters:
object- The DataCollectionObject to create- Returns:
- Identifier assigned to created item
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
createTable
@Deprecated public long createTable(DataCollectionObject object) throws IOException, NXCException
Deprecated.Create new data collection table. This method is deprecated - new code should call modifyObject().- Parameters:
object- The DataCollectionObject to create- Returns:
- Identifier assigned to created item
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
modifyObject
public void modifyObject(long dcObjectId) throws IOException, NXCExceptionModify data collection object.- Parameters:
dcObjectId- Data collection object identifier- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
modifyObject
public long modifyObject(DataCollectionObject dco) throws IOException, NXCException
Modify data collection object.- Parameters:
dco- Data collection object- Returns:
- Identifier assigned to created item
- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
copyObjects
public void copyObjects(long destNodeId, long[] items) throws IOException, NXCExceptionCopy data collection objects.- Parameters:
destNodeId- Destination node IDitems- List of data collection items to copy- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
moveObjects
public void moveObjects(long destNodeId, long[] items) throws IOException, NXCExceptionMove data collection objects.- Parameters:
destNodeId- Destination node IDitems- List of data collection items to move- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
clearCollectedData
public void clearCollectedData(long itemId) throws IOException, NXCExceptionClear collected data for given DCI.- Parameters:
itemId- Data collection item ID- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
setObjectStatus
public void setObjectStatus(long[] items, int status) throws IOException, NXCExceptionSet status of data collection objects.- Parameters:
items- Data collection items' identifiersstatus- New status- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
deleteObject
public void deleteObject(long itemId) throws IOException, NXCExceptionDelete data collection object.- Parameters:
itemId- Data collection item identifier- Throws:
IOException- if socket I/O error occursNXCException- if NetXMS server returns an error or operation was timed out
-
finalize
protected void finalize() throws Throwable
-
getNodeId
public long getNodeId()
- Returns:
- the nodeId
-
getUserData
public Object getUserData()
- Returns:
- the userData
-
setUserData
public void setUserData(Object userData)
- Parameters:
userData- the userData to set
-
getSession
protected final NXCSession getSession()
- Returns:
- the session
-
-