Class InternalClientQuestionServiceImpl
java.lang.Object
ch.tocco.nice2.web.core.impl.clientquestion.InternalClientQuestionServiceImpl
- All Implemented Interfaces:
ClientQuestionService,InternalClientQuestionService
@Component
public class InternalClientQuestionServiceImpl
extends Object
implements InternalClientQuestionService
-
Nested Class Summary
Nested classes/interfaces inherited from interface ch.tocco.nice2.web.core.api.clientquestion.InternalClientQuestionService
InternalClientQuestionService.AnswerSupplier -
Constructor Summary
ConstructorsConstructorDescriptionInternalClientQuestionServiceImpl(org.slf4j.Logger log, ClientType clientType) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd incoming answers.<R extends ClientAnswer>
voidaddAnswers(R[] answers) Add incoming answers.<T extends ClientAnswer>
TaskQuestion(ClientQuestion<T> question) Asynchronously ask a question to the client user.voidvoidsetDefaultAnswers(List<DefaultClientAnswerContribution> contributions) withAnswersForQuestion(PredefinedAnswers predefinedAnswers) Set predefined answers within the thread which is used to call the invoker.
-
Constructor Details
-
InternalClientQuestionServiceImpl
-
-
Method Details
-
askQuestion
Description copied from interface:ClientQuestionServiceAsynchronously ask a question to the client user. This method can be called from any context, where we might are in a remote call. * In case the user has not yet answered the question (in the GUI) this method will throw an (unchecked) exception (ClientQuestionException) and the current remote call will not be handled right now. After an answer has been given, the remote call will be reexecuted. * In case the user has already answered the question (in the GUI) this method will return aClientAnswerobject containing information about the clients answer.- Specified by:
askQuestionin interfaceClientQuestionService- Type Parameters:
T- generic type for the expected answer- Parameters:
question- a question to be asked the user- Returns:
- the user's answer
-
withAnswersForQuestion
Description copied from interface:ClientQuestionServiceSet predefined answers within the thread which is used to call the invoker.- Specified by:
withAnswersForQuestionin interfaceClientQuestionService- Parameters:
predefinedAnswers- The predefined answers for certain client questions.- Returns:
- the invoker to call within the desired thread.
-
addAnswers
Description copied from interface:InternalClientQuestionServiceAdd incoming answers.- Specified by:
addAnswersin interfaceInternalClientQuestionService- See Also:
-
addAnswers
Description copied from interface:InternalClientQuestionServiceAdd incoming answers.- Specified by:
addAnswersin interfaceInternalClientQuestionService- Parameters:
answers- Map of question ids and answer suppliers (answer suppliers allow to create the answer lazily depending on the expected answer type).- See Also:
-
enterRemoteMethod
public void enterRemoteMethod()- Specified by:
enterRemoteMethodin interfaceInternalClientQuestionService
-
getQuestion
- Specified by:
getQuestionin interfaceInternalClientQuestionService
-
setDefaultAnswers
-