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:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classStores session properties in a lazily created map, keyed by property name, class name, or both. -
Method Summary
Modifier and TypeMethodDescription<T> booleancontainsSessionProperty(Class<T> type) Returnstrueif a session property exists for the given type.<T> booleancontainsSessionProperty(Class<T> type, String name) Returnstrueif a session property exists for the given type and name combination.booleanReturnstrueif a session property exists with the given name.voidcopySessionPropertiesFrom(Session session) Copies all session properties from the given source session into this one.<T> TgetSessionProperty(Class<T> type) Returns the session property value associated with the given type.<T> TgetSessionProperty(Class<T> type, String name) Returns the session property value associated with the given type and name combination.<T> TgetSessionProperty(String name) Returns the session property value associated with the given name.keySet()Returns the set of all session property keys.voidRemoves all session properties from this session.<T> voidsetSessionProperty(Class<T> type, Object value) Sets a session property value keyed by type.<T> voidsetSessionProperty(Class<T> type, String name, Object value) Sets a session property value keyed by the given type and name combination.voidsetSessionProperty(String name, Object value) Sets a session property value keyed by name.
-
Method Details
-
keySet
Returns the set of all session property keys.- Returns:
- the set of property keys, never
null
-
containsSessionProperty
Returnstrueif 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, ornullto match by name onlyname- the property name, ornullto match by type only- Returns:
trueif the property exists
-
containsSessionProperty
Returnstrueif 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:
trueif the property exists
-
containsSessionProperty
Returnstrueif a session property exists with the given name.- Parameters:
name- the property name- Returns:
trueif the property exists
-
getSessionProperty
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
nullif not found
-
getSessionProperty
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, ornullto match by name onlyname- the property name, ornullto match by type only- Returns:
- the property value, or
nullif not found
-
getSessionProperty
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
nullif not found
-
setSessionProperty
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 keyvalue- the value to store
-
setSessionProperty
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, ornullto match by name onlyname- the property name, ornullto match by type onlyvalue- the value to store
-
setSessionProperty
Sets a session property value keyed by name.- Parameters:
name- the property namevalue- the value to store
-
copySessionPropertiesFrom
Copies all session properties from the given source session into this one.- Parameters:
session- the source session to copy from, may benull
-
removeSessionProperties
void removeSessionProperties()Removes all session properties from this session.
-