Class DataCollectionConfiguration

java.lang.Object
org.netxms.client.datacollection.DataCollectionConfiguration

public class DataCollectionConfiguration extends Object
Data collection configuration for node
  • Constructor Details

    • DataCollectionConfiguration

      public DataCollectionConfiguration(NXCSession session, long ownerId)
      Create empty data collection configuration.
      Parameters:
      session - The NXCSession
      ownerId - ID of the owning object
  • Method Details

    • open

      public void open(RemoteChangeListener changeListener) throws IOException, NXCException
      Open data collection configuration.
      Parameters:
      changeListener - change listener
      Throws:
      IOException - if socket I/O error occurs
      NXCException - if NetXMS server returns an error or operation was timed out
    • refreshDataCollectionList

      public void refreshDataCollectionList() throws IOException, NXCException
      Force refresh DCI list
      Throws:
      IOException - if socket I/O error occurs
      NXCException - if NetXMS server returns an error or operation was timed out
    • close

      public void close()
      Close data collection configuration.
    • commit

      public void commit() throws IOException, NXCException
      Apply user changes
      Throws:
      IOException - if socket I/O error occurs
      NXCException - 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 ID
      classFilter - 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 occurs
      NXCException - 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 occurs
      NXCException - if NetXMS server returns an error or operation was timed out
    • modifyObject

      public void modifyObject(long dcObjectId) throws IOException, NXCException
      Modify data collection object.
      Parameters:
      dcObjectId - Data collection object identifier
      Throws:
      IOException - if socket I/O error occurs
      NXCException - 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 occurs
      NXCException - if NetXMS server returns an error or operation was timed out
    • copyObjects

      public void copyObjects(long destNodeId, long[] items) throws IOException, NXCException
      Copy data collection objects.
      Parameters:
      destNodeId - Destination node ID
      items - List of data collection items to copy
      Throws:
      IOException - if socket I/O error occurs
      NXCException - if NetXMS server returns an error or operation was timed out
    • moveObjects

      public void moveObjects(long destNodeId, long[] items) throws IOException, NXCException
      Move data collection objects.
      Parameters:
      destNodeId - Destination node ID
      items - List of data collection items to move
      Throws:
      IOException - if socket I/O error occurs
      NXCException - if NetXMS server returns an error or operation was timed out
    • clearCollectedData

      public void clearCollectedData(long itemId) throws IOException, NXCException
      Clear collected data for given DCI.
      Parameters:
      itemId - Data collection item ID
      Throws:
      IOException - if socket I/O error occurs
      NXCException - if NetXMS server returns an error or operation was timed out
    • setObjectStatus

      public void setObjectStatus(long[] items, int status) throws IOException, NXCException
      Set status of data collection objects.
      Parameters:
      items - Data collection items' identifiers
      status - New status
      Throws:
      IOException - if socket I/O error occurs
      NXCException - if NetXMS server returns an error or operation was timed out
    • deleteObject

      public void deleteObject(long itemId) throws IOException, NXCException
      Delete data collection object.
      Parameters:
      itemId - Data collection item identifier
      Throws:
      IOException - if socket I/O error occurs
      NXCException - if NetXMS server returns an error or operation was timed out
    • bulkUpdateDCIs

      public void bulkUpdateDCIs(Collection<Long> idList, Collection<? extends BulkDciUpdateElement> fields) throws IOException, NXCException
      Parameters:
      idList - List of data collection object identifiers
      fields - collection of fields to be updated
      Throws:
      IOException - if socket I/O error occurs
      NXCException - if NetXMS server returns an error or operation was timed out
    • getOwnerId

      public long getOwnerId()
      Get ID of data collection owner object
      Returns:
      ID of data collection owner object
    • getUserData

      public Object getUserData()
      Get user data previously stored with setUserData.
      Returns:
      user data
    • setUserData

      public void setUserData(Object userData)
      Set user data.
      Parameters:
      userData - new user data
    • getSession

      protected final NXCSession getSession()
      Get owning client session.
      Returns:
      owning client session
    • setLocalChangeListener

      public void setLocalChangeListener(LocalChangeListener listener)
      Set local change listener
      Parameters:
      listener - local change listener to add
    • setRemoteChangeListener

      public void setRemoteChangeListener(RemoteChangeListener listener)
      Set remote change listener
      Parameters:
      listener - remote change listener to add