Package liquibase.ui
Class CompositeUIService
- java.lang.Object
-
- liquibase.AbstractExtensibleObject
-
- liquibase.ui.CompositeUIService
-
- All Implemented Interfaces:
Cloneable,ExtensibleObject,Plugin,UIService
@Beta public class CompositeUIService extends AbstractExtensibleObject implements UIService
Used for handling multiple UI output services.
-
-
Field Summary
Fields Modifier and Type Field Description UIServiceinputServiceList<UIService>outputServices-
Fields inherited from interface liquibase.plugin.Plugin
PRIORITY_DATABASE, PRIORITY_DEFAULT, PRIORITY_NOT_APPLICABLE, PRIORITY_SPECIALIZED
-
-
Constructor Summary
Constructors Constructor Description CompositeUIService(UIService inputService, Collection<UIService> outputServices)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangetAllowPrompt()Return current setting of allow prompt flagList<UIService>getOutputServices()intgetPriority()<T> Tprompt(String prompt, T valueIfNoEntry, InputHandler<T> inputHandler, Class<T> type)Prompt the user with the message and wait for a response.
If this UIService implementation does not support user prompts, return the default value.
If inputHandler is null,DefaultInputHandlerwill be used.
If inputHandler throws anIllegalArgumentException, the user will be given the chance to re-enter the value.
If the inputHandler returns true forInputHandler.shouldAllowEmptyInput()and the user enters an empty value when prompted, or hits "enter", the valueIfNoEntry will be returned.voidsendErrorMessage(String message)Send an "error" message to the user.voidsendErrorMessage(String message, Throwable exception)Send an "error" message to the user along with a stacktrace.voidsendMessage(String message)Send a "normal" message to the user.voidsetAllowPrompt(boolean allowPrompt)Method to set flag indicating whether prompting is allowed-
Methods inherited from class liquibase.AbstractExtensibleObject
clone, describe, equals, get, get, get, getAttributes, getFieldValue, getObjectMetaData, getValuePath, has, hashCode, set, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface liquibase.ExtensibleObject
clone, describe, get, get, getAttributes, getObjectMetaData, getValuePath, has, set
-
-
-
-
Constructor Detail
-
CompositeUIService
public CompositeUIService(UIService inputService, Collection<UIService> outputServices)
-
-
Method Detail
-
getPriority
public int getPriority()
- Specified by:
getPriorityin interfaceUIService
-
sendMessage
public void sendMessage(String message)
Description copied from interface:UIServiceSend a "normal" message to the user.- Specified by:
sendMessagein interfaceUIService
-
sendErrorMessage
public void sendErrorMessage(String message)
Description copied from interface:UIServiceSend an "error" message to the user.- Specified by:
sendErrorMessagein interfaceUIService
-
sendErrorMessage
public void sendErrorMessage(String message, Throwable exception)
Description copied from interface:UIServiceSend an "error" message to the user along with a stacktrace.- Specified by:
sendErrorMessagein interfaceUIService
-
prompt
public <T> T prompt(String prompt, T valueIfNoEntry, InputHandler<T> inputHandler, Class<T> type)
Description copied from interface:UIServicePrompt the user with the message and wait for a response.
If this UIService implementation does not support user prompts, return the default value.
If inputHandler is null,DefaultInputHandlerwill be used.
If inputHandler throws anIllegalArgumentException, the user will be given the chance to re-enter the value.
If the inputHandler returns true forInputHandler.shouldAllowEmptyInput()and the user enters an empty value when prompted, or hits "enter", the valueIfNoEntry will be returned. If the inputHandler returns false forInputHandler.shouldAllowEmptyInput(), the user will be reprompted until they enter a non-empty value, which will then be returned.
-
setAllowPrompt
public void setAllowPrompt(boolean allowPrompt) throws IllegalArgumentExceptionDescription copied from interface:UIServiceMethod to set flag indicating whether prompting is allowed- Specified by:
setAllowPromptin interfaceUIService- Parameters:
allowPrompt- New flag value- Throws:
IllegalArgumentException- If parameter is not allowed
-
getAllowPrompt
public boolean getAllowPrompt()
Description copied from interface:UIServiceReturn current setting of allow prompt flag- Specified by:
getAllowPromptin interfaceUIService- Returns:
- boolean
-
-