Class DFDataset

java.lang.Object
nl.tue.id.datafoundry.DFDataset

public class DFDataset
extends java.lang.Object
Dataset class for all operations on an IoT or Entity dataset.
// fill in the Data Foundry server URL, just the domain (add port if needed)
DataFoundry df = new DataFoundry("server.url.com");
// create dataset access
DFDataset iot = df.dataset(2, "tokentokentokentokentoken1234567890+++");

// log to IoT dataset
iot.device("d123456789").activity("indoor_measurement").data("temperature", 34).data("door", "open").log();


// create dataset access
DFDataset entity = df.dataset(15, "tokentokentokentokentoken1234567890+++");
// create dataset item access
DFDataset item = df.dataset(15, "tokentokentokentokentoken1234567890+++").id("userX").token("nosecrets");

// access Entity dataset
// add an item
item.data("temperature", 34).data("door", "open").add();

// get an item
Map<String, Object> itemData = item.get();

// update an item
item.data("temperature", 32).update();

// delete an item
item.delete();

Author:
Mathias Funk, 2020
  • Method Summary

    Modifier and Type Method Description
    DFDataset activity​(java.lang.String activity)
    set the activity for logging to an IoT dataset
    void add()
    add an entry to an entity dataset
    java.util.List<java.util.Map<java.lang.String,​java.lang.Object>> all()
    get all entries from an entity dataset
    DFDataset data​(java.lang.String key, boolean value)
    add a piece of data (key - value) for a sending to an IoT or Entity dataset
    DFDataset data​(java.lang.String key, double value)
    add a piece of data (key - value) for a sending to an IoT or Entity dataset
    DFDataset data​(java.lang.String key, float value)
    add a piece of data (key - value) for a sending to an IoT or Entity dataset
    DFDataset data​(java.lang.String key, int value)
    add a piece of data (key - value) for a sending to an IoT or Entity dataset
    DFDataset data​(java.lang.String key, long value)
    add a piece of data (key - value) for a sending to an IoT or Entity dataset
    DFDataset data​(java.lang.String key, java.lang.Object value)
    add a piece of data (key - value) for a sending to an IoT or Entity dataset
    DFDataset data​(java.lang.String key, java.lang.String value)
    add a piece of data (key - value) for a sending to an IoT or Entity dataset
    void delete()
    delete an entry from an entity dataset
    DFDataset device​(java.lang.String deviceId)
    set the device for logging to an IoT dataset
    java.util.Map<java.lang.String,​java.lang.Object> get()
    get an entry from an entity dataset
    DFDataset id​(java.lang.String id)
    set the item ID for accessing an Entity dataset item
    void log()
    log an entry to an IoT dataset
    DFDataset token​(java.lang.String token)
    set the item token for accessing an Entity dataset item
    void update()
    update an entry in an entity dataset

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • device

      public DFDataset device​(java.lang.String deviceId)
      set the device for logging to an IoT dataset
      Parameters:
      deviceId -
      Returns:
    • activity

      public DFDataset activity​(java.lang.String activity)
      set the activity for logging to an IoT dataset
      Parameters:
      activity -
      Returns:
    • id

      public DFDataset id​(java.lang.String id)
      set the item ID for accessing an Entity dataset item
      Parameters:
      id -
      Returns:
    • token

      public DFDataset token​(java.lang.String token)
      set the item token for accessing an Entity dataset item
      Parameters:
      token -
      Returns:
    • data

      public DFDataset data​(java.lang.String key, boolean value)
      add a piece of data (key - value) for a sending to an IoT or Entity dataset
      Parameters:
      key -
      value -
      Returns:
    • data

      public DFDataset data​(java.lang.String key, int value)
      add a piece of data (key - value) for a sending to an IoT or Entity dataset
      Parameters:
      key -
      value -
      Returns:
    • data

      public DFDataset data​(java.lang.String key, long value)
      add a piece of data (key - value) for a sending to an IoT or Entity dataset
      Parameters:
      key -
      value -
      Returns:
    • data

      public DFDataset data​(java.lang.String key, float value)
      add a piece of data (key - value) for a sending to an IoT or Entity dataset
      Parameters:
      key -
      value -
      Returns:
    • data

      public DFDataset data​(java.lang.String key, double value)
      add a piece of data (key - value) for a sending to an IoT or Entity dataset
      Parameters:
      key -
      value -
      Returns:
    • data

      public DFDataset data​(java.lang.String key, java.lang.String value)
      add a piece of data (key - value) for a sending to an IoT or Entity dataset
      Parameters:
      key -
      value -
      Returns:
    • data

      public DFDataset data​(java.lang.String key, java.lang.Object value)
      add a piece of data (key - value) for a sending to an IoT or Entity dataset
      Parameters:
      key -
      value -
      Returns:
    • log

      public void log()
      log an entry to an IoT dataset
    • get

      public java.util.Map<java.lang.String,​java.lang.Object> get()
      get an entry from an entity dataset
      Returns:
    • all

      public java.util.List<java.util.Map<java.lang.String,​java.lang.Object>> all()
      get all entries from an entity dataset
      Returns:
    • add

      public void add()
      add an entry to an entity dataset
    • update

      public void update()
      update an entry in an entity dataset
    • delete

      public void delete()
      delete an entry from an entity dataset