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
ConstructorDescriptionInternalClientQuestionServiceImpl
(org.slf4j.Logger log, ClientType clientType) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add 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.void
void
setDefaultAnswers
(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:ClientQuestionService
Asynchronously 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 aClientAnswer
object containing information about the clients answer.- Specified by:
askQuestion
in 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:ClientQuestionService
Set predefined answers within the thread which is used to call the invoker.- Specified by:
withAnswersForQuestion
in interfaceClientQuestionService
- Parameters:
predefinedAnswers
- The predefined answers for certain client questions.- Returns:
- the invoker to call within the desired thread.
-
addAnswers
Description copied from interface:InternalClientQuestionService
Add incoming answers.- Specified by:
addAnswers
in interfaceInternalClientQuestionService
- See Also:
-
addAnswers
Description copied from interface:InternalClientQuestionService
Add incoming answers.- Specified by:
addAnswers
in 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:
enterRemoteMethod
in interfaceInternalClientQuestionService
-
getQuestion
- Specified by:
getQuestion
in interfaceInternalClientQuestionService
-
setDefaultAnswers
-