org.eclipse.january.dataset

## Interface IDatasetConnector

- All Superinterfaces:
    IDynamicShape, IFileConnection

      public interface IDatasetConnector
      extends IFileConnection, IDynamicShape

  A dataset connector contains a lazy dataset which exists in a remote location. It uses a connection to the DataServer to provide the implementation of the slicing required remotely. You may also listen to data changing in the dataset

- - ### Field Summary

    - ### Fields inherited from interface org.eclipse.january.dataset.IDynamicShape

      `UNLIMITED`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `connect()` Same as calling connect(500, TimeUnit.MILLISECOND) This will connect with the DataServer to start listening to any updates to the file should it be written in the remote file system.
    `String` | `connect(long time, TimeUnit unit)` This will connect with the DataServer to start listening to any updates to the file should it be written in the remote file system.
    `void` | `disconnect()` Stops listening to the dataset changing and disconnects from the server.
    `String` | `getDatasetName()` The dataset location/name in the file
    `boolean` | `isWritingExpected()`
    `void` | `setDatasetName(String datasetName)` The dataset location/name in the file
    `void` | `setWritingExpected(boolean expectWrite)` If set to true the DataServer will not cache the dataset.

    - ### Methods inherited from interface org.eclipse.january.dataset.IFileConnection

      `getPath, setPath`

    - ### Methods inherited from interface org.eclipse.january.dataset.IDynamicShape

      `addDataListener, fireDataListeners, getDataset, getMaxShape, refreshShape, removeDataListener, resize, setMaxShape, startUpdateChecker`

- - ### Method Detail

    - #### getDatasetName

          String getDatasetName()

      The dataset location/name in the file
      Returns:
        Dataset name

    - #### setDatasetName

          void setDatasetName(String datasetName)

      The dataset location/name in the file
      Parameters:
        `datasetName` - name

    - #### setWritingExpected

          void setWritingExpected(boolean expectWrite)

      If set to true the DataServer will not cache the dataset. If left as false: if the data server can figure out that the file is writing, it will reshape. However it cannot always determine this depending on the file and what is writing to it (SWMR can write without changing date stamp for instance) Setting this boolean ensures that a given path, never will cache on the data server. Default value is false for MJPEG streams and true for standard remote datasets.
      Parameters:
        `expectWrite` - true if server should expect more data

    - #### isWritingExpected

          boolean isWritingExpected()

      Returns:
        true if the remote dataset has been warned that writing is expected.

    - #### connect

          String connect()
                  throws DatasetException

      Same as calling connect(500, TimeUnit.MILLISECOND) This will connect with the DataServer to start listening to any updates to the file should it be written in the remote file system. When connect is called, the remote file must exist and the dataset properties are read. These properties must not change in the file while you are connected. For instance if the file is ints when you connect, it must not change data class.
      Returns:
        the name of the thread started to run the connection or null if each event is driven from the event thread of the service (for instance web sockets provide the thread and this runs the connection)
      Throws:
        `DatasetException` - when cannot connect

    - #### connect

          String connect(long time,
                         TimeUnit unit)
                  throws DatasetException

      This will connect with the DataServer to start listening to any updates to the file should it be written in the remote file system. When connect is called, the remote file must exist and the dataset properties are read. These properties must not change in the file while you are connected. For instance if the file is ints when you connect, it must not change data class.
      Parameters:
        `time` - amount to wait
        `unit` - of time
      Returns:
        the name of the thread started to run the connection or null if each event is driven from the event thread of the service (for instance web sockets provide the thread and this runs the connection)
      Throws:
        `DatasetException` - when cannot connect

    - #### disconnect

          void disconnect()
                   throws DatasetException

      Stops listening to the dataset changing and disconnects from the server. A remote dataset may be connected and disconnected multiple times.
      Throws:
        `DatasetException` - when cannot disconnect

Copyright © 2014–2022 Eclipse Foundation. All rights reserved.