Class DataServiceContext

java.lang.Object
org.knime.core.webui.data.DataServiceContext

public final class DataServiceContext extends Object
A DataServiceContext allows to report warning messages during a data service invocation or assembly of initial data. These warning messages can then be obtained by the RpcDataService or InitialDataService and passed to the frontend for display along a valid result. Furthermore, it allows one to created BufferedDataTables within the context of the underlying node.
Author:
Marc Bux, KNIME GmbH, Berlin, Germany, Martin Horn, KNIME GmbH, Konstanz, Germany
  • Method Details

    • get

      public static DataServiceContext get()
      Returns:
      the DataServiceContext for the current thread, potentially creating a new one in the process.
    • addWarningMessage

      public void addWarningMessage(String warningMessage)
      Adds another warning message to the list of warning messages.
      Parameters:
      warningMessage - a warning message
    • getWarningMessages

      public String[] getWarningMessages()
      Returns:
      a list of warnings that occurred while invoking the data service
    • clearWarningMessages

      public void clearWarningMessages()
      Removes all the previously set warning message.
    • getExecutionContext

      public org.knime.core.node.ExecutionContext getExecutionContext()
      Returns:
      the execution context
      Throws:
      IllegalStateException - if there is no execution context available
    • getInputSpecs

      public org.knime.core.node.port.PortObjectSpec[] getInputSpecs()
      Returns:
      the input specs excluding the flow variable port