Interface Session

All Known Implementing Classes:
ArrayValue, Field, Node, Record, Session.SessionImpl, SingleValue, ValueNode

public interface Session
Session is the base type for objects that can contain temporary, non-persistent data in DataPipeline. Developers can use Session indirectly via Record, Field, and other Node subclasses to attach transient values to data flowing through the pipeline. Values stored in session properties are ignored by Data Pipeline's readers, writers, and operators.

Note: Session is created as an interface (with one real implementation -- Session.SessionImpl) due to Java's lack of multiple inheritance. It is not intended to be implemented by developers.

See Also:
  • Method Details

    • keySet

      Set<String> keySet()
      Returns the set of all session property keys.
      Returns:
      the set of property keys, never null
    • containsSessionProperty

      <T> boolean containsSessionProperty(Class<T> type, String name)
      Returns true if a session property exists for the given type and name combination.
      Type Parameters:
      T - the type used as part of the property key
      Parameters:
      type - the class used as part of the property key, or null to match by name only
      name - the property name, or null to match by type only
      Returns:
      true if the property exists
    • containsSessionProperty

      <T> boolean containsSessionProperty(Class<T> type)
      Returns true if a session property exists for the given type.
      Type Parameters:
      T - the type used as the property key
      Parameters:
      type - the class used as the property key
      Returns:
      true if the property exists
    • containsSessionProperty

      boolean containsSessionProperty(String name)
      Returns true if a session property exists with the given name.
      Parameters:
      name - the property name
      Returns:
      true if the property exists
    • getSessionProperty

      <T> T getSessionProperty(Class<T> type)
      Returns the session property value associated with the given type.
      Type Parameters:
      T - the expected value type
      Parameters:
      type - the class used as the property key
      Returns:
      the property value, or null if not found
    • getSessionProperty

      <T> T getSessionProperty(Class<T> type, String name)
      Returns the session property value associated with the given type and name combination.
      Type Parameters:
      T - the expected value type
      Parameters:
      type - the class used as part of the property key, or null to match by name only
      name - the property name, or null to match by type only
      Returns:
      the property value, or null if not found
    • getSessionProperty

      <T> T getSessionProperty(String name)
      Returns the session property value associated with the given name.
      Type Parameters:
      T - the expected value type
      Parameters:
      name - the property name
      Returns:
      the property value, or null if not found
    • setSessionProperty

      <T> void setSessionProperty(Class<T> type, Object value)
      Sets a session property value keyed by type.
      Type Parameters:
      T - the type used as the property key
      Parameters:
      type - the class used as the property key
      value - the value to store
    • setSessionProperty

      <T> void setSessionProperty(Class<T> type, String name, Object value)
      Sets a session property value keyed by the given type and name combination.
      Type Parameters:
      T - the type used as part of the property key
      Parameters:
      type - the class used as part of the property key, or null to match by name only
      name - the property name, or null to match by type only
      value - the value to store
    • setSessionProperty

      void setSessionProperty(String name, Object value)
      Sets a session property value keyed by name.
      Parameters:
      name - the property name
      value - the value to store
    • copySessionPropertiesFrom

      void copySessionPropertiesFrom(Session session)
      Copies all session properties from the given source session into this one.
      Parameters:
      session - the source session to copy from, may be null
    • removeSessionProperties

      void removeSessionProperties()
      Removes all session properties from this session.