Package com.variant.server.spi
Interface Session
public interface Session
User session.
- Since:
- 0.7
-
Method Summary
Modifier and TypeMethodDescriptionThis session's attributes as a mutable map.Variant server's current runtime configuration.getId()
This session's ID.This session's owner ID, if proved.The experiment schema, associated with this session.The most recent state request, which may be still in progress or already committed or failed.This session's creation timestamp.The set of experiments traversed by this session so far.The collection of states, traversed by this session so far, and their respective visit counts.void
triggerEvent
(TraceEvent event) Trigger a custom trace event.
-
Method Details
-
getId
String getId()This session's ID.
- Returns:
- Session ID.
- Since:
- 0.7
-
getOwnerId
This session's owner ID, if proved.
- Returns:
- Owner ID.
- Since:
- 1.0
-
getTimestamp
Instant getTimestamp()This session's creation timestamp.
- Returns:
- Creation timestamp.
- Since:
- 0.7
-
getTraversedStates
The collection of states, traversed by this session so far, and their respective visit counts. For each state S, the visit count in incremented by one whenever all the following conditions are met:
- The session is targeted for the state S
- There exists an experiment E, which a) is instrumented on state S, b) is not OFF, and c) this session is qualified for.
- Returns:
- A map, whose entries are keyed by
State
and values are Integer visit counts in that state. - Since:
- 0.7
-
getSchema
Schema getSchema()The experiment schema, associated with this session.- Returns:
- An object of type
Schema
- Since:
- 0.9
-
getConfiguration
Configuration getConfiguration()Variant server's current runtime configuration.- Returns:
- An object of type
Configuration
. Cannot be null. - Since:
- 0.9
-
triggerEvent
Trigger a custom trace event. The caller supplies an implementation of theTraceEvent
interface. -
getTraversedExperiments
Set<Experiment> getTraversedExperiments()The set of experiments traversed by this session so far. A experiment V is traversed by a session when the session is targeted for a state, which a) is instrumented by V, b) V is not OFF, and c) this session is qualified for V.
- Returns:
- A set of
Experiment
objects. - Since:
- 0.7
-
getStateRequest
Optional<StateRequest> getStateRequest()The most recent state request, which may be still in progress or already committed or failed.
- Returns:
- An
Optional
ofStateRequest
, containing the most recent state request, or empty if this session has not yet been targeted for a state. - Since:
- 0.7
-
getAttributes
This session's attributes as a mutable map.
- Returns:
- A mutable
Map
. - Since:
- 0.7
-