Package io.dialob.executor.model
Class DialobSession
- java.lang.Object
-
- io.dialob.executor.model.DialobSession
-
- All Implemented Interfaces:
ItemStates,Serializable
public class DialobSession extends Object implements ItemStates, Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static ImmutableItemRefQUESTIONNAIRE_REF
-
Constructor Summary
Constructors Constructor Description DialobSession(String tenantId, String id, String revision, String language, List<ItemState> items, List<ItemState> prototypes, List<ValueSetState> valueSets, List<ErrorState> errors, List<ErrorState> errorPrototypes, Date completed, Date opened, Date lastAnswer)
-
Method Summary
-
-
-
Field Detail
-
QUESTIONNAIRE_REF
public static final ImmutableItemRef QUESTIONNAIRE_REF
-
-
Method Detail
-
writeTo
public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException- Throws:
IOException
-
readFrom
public static DialobSession readFrom(com.google.protobuf.CodedInputStream input) throws IOException
- Throws:
IOException
-
withId
public DialobSession withId(String id)
-
getId
public String getId()
-
getTenantId
public String getTenantId()
-
getRootItem
@Nonnull public ItemState getRootItem()
-
accept
public void accept(DialobSessionVisitor visitor)
-
applyUpdate
public void applyUpdate(@Nonnull EvalContext evalContext, @Nonnull Command<?> command)- Parameters:
evalContext- execution contextcommand- object to execute within context
-
createScopedEvalContext
public EvalContext createScopedEvalContext(@Nonnull EvalContext evalContext, ItemId itemId)
-
createScope
public EvalContext createScope(@Nonnull EvalContext evalContext, ItemId itemId)
-
updated
protected void updated()
-
findErrorState
public ErrorState findErrorState(ErrorId id)
-
getErrorState
public Optional<ErrorState> getErrorState(ItemId itemId, String code)
-
getRevision
public String getRevision()
-
getLastUpdate
@Nonnull public Instant getLastUpdate()
-
getCompleted
@Nullable public Instant getCompleted()
-
getOpened
@Nullable public Instant getOpened()
-
getLastAnswer
@Nullable public Instant getLastAnswer()
-
isCompleted
public boolean isCompleted()
-
complete
public boolean complete()
-
getLanguage
public String getLanguage()
-
setLanguage
public void setLanguage(String language)
-
getItemStates
@Nonnull public Map<ItemId,ItemState> getItemStates()
- Specified by:
getItemStatesin interfaceItemStates
-
getValueSetStates
@Nonnull public Map<ValueSetId,ValueSetState> getValueSetStates()
- Specified by:
getValueSetStatesin interfaceItemStates
-
getErrorStates
@Nonnull public Map<ErrorId,ErrorState> getErrorStates()
- Specified by:
getErrorStatesin interfaceItemStates
-
getValueSetState
@Nonnull public Optional<ValueSetState> getValueSetState(ValueSetId id)
-
findErrorPrototypes
@Nonnull public Stream<ErrorState> findErrorPrototypes(ItemId itemId)
-
generateUpdateId
public String generateUpdateId()
-
-