execute() is called.
Named similarly to Scope because they both define a self-contained unit of values, but this
scope is specific to a command rather than being a global scope.
| Modifier and Type | Class and Description |
|---|---|
| private class | CommandScope.
Adapts the command-scoped arguments into the overall ValueProvider system |
| private static class | CommandScope.
This class is a wrapper around OutputStreams, and makes them impossible for callers to close. |
| Modifier and Type | Field and Description |
|---|---|
| private final SortedMap | |
| private final CommandDefinition | |
| private final String | completeConfigPrefix
Config key including the command name. |
| private final Map | |
| public static final Pattern | |
| private static final String | |
| private OutputStream | |
| private final String | shortConfigPrefix
Config key without the command name. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public CommandScope | addArgumentValue(String argument, Object value)
Adds the given key/value pair to the stored argument data. |
| public <T> CommandScope | addArgumentValue(CommandArgumentDefinition<T> argument, T value)
Adds the given key/value pair to the stored argument data. |
| private void | |
| private <T> ConfigurationDefinition | |
| public CommandResults | |
| public <T> T | getArgumentValue(CommandArgumentDefinition<T> argument)
Convenience method for |
| public CommandDefinition | |
| private String | Returns: the full command step name definition delimited by spaces or an empty string if there are no defined command namesthe command step to get the name of commandStep)Returns a string of the entire defined command names, joined together with spaces |
| public String | Returns: the complete configuration prefix for the command in this scopeReturns the complete configuration prefix (without a trailing period) for the command in this scope. |
| public <T> ConfiguredValue | getConfiguredValue(CommandArgumentDefinition<T> argument)
Returns the detailed information about how an argument is set. |
| private static String | |
| public <T> Object | getDependency(Class<T> clazz)
Retrieves the registered dependency object provided by this class identifier |
| private void | |
| public CommandScope | |
| public CommandScope | |
| public void |
| argumentValues | back to summary |
|---|---|
| private final SortedMap<String, Object> argumentValues | |
| commandDefinition | back to summary |
|---|---|
| private final CommandDefinition commandDefinition | |
| completeConfigPrefix | back to summary |
|---|---|
| private final String completeConfigPrefix Config key including the command name. Example `liquibase.command.update` | |
| dependencies | back to summary |
|---|---|
| private final Map<Class<?>, Object> dependencies | |
| NO_PREFIX_PATTERN | back to summary |
|---|---|
| public static final Pattern NO_PREFIX_PATTERN | |
| NO_PREFIX_REGEX | back to summary |
|---|---|
| private static final String NO_PREFIX_REGEX | |
| outputStream | back to summary |
|---|---|
| private OutputStream outputStream | |
| shortConfigPrefix | back to summary |
|---|---|
| private final String shortConfigPrefix Config key without the command name. Example `liquibase.command` | |
| CommandScope | back to summary |
|---|---|
| public CommandScope(String... commandName) throws CommandExecutionException Creates a new scope for the given command. | |
| addArgumentValue | back to summary |
|---|---|
| public CommandScope addArgumentValue(String argument, Object value) Adds the given key/value pair to the stored argument data.
| |
| addArgumentValue | back to summary |
|---|---|
| public <T> CommandScope addArgumentValue(CommandArgumentDefinition<T> argument, T value) Adds the given key/value pair to the stored argument data. | |
| addOutputFileToMdc | back to summary |
|---|---|
| private void addOutputFileToMdc() throws Exception | |
| createConfigurationDefinition | back to summary |
|---|---|
| private <T> ConfigurationDefinition | |
| execute | back to summary |
|---|---|
| public CommandResults execute() throws CommandExecutionException Executes the command in this scope, and returns the results. | |
| getArgumentValue | back to summary |
|---|---|
| public <T> T getArgumentValue(CommandArgumentDefinition<T> argument) Convenience method for | |
| getCommand | back to summary |
|---|---|
| public CommandDefinition getCommand() Returns the | |
| getCommandStepName | back to summary |
|---|---|
| private String getCommandStepName(CommandStep commandStep) Returns a string of the entire defined command names, joined together with spaces
| |
| getCompleteConfigPrefix | back to summary |
|---|---|
| public String getCompleteConfigPrefix() Returns the complete configuration prefix (without a trailing period) for the command in this scope.
| |
| getConfiguredValue | back to summary |
|---|---|
| public <T> ConfiguredValue Returns the detailed information about how an argument is set.
| |
| getDatabaseInfo | back to summary |
|---|---|
| private static String getDatabaseInfo(Database database) | |
| getDependency | back to summary |
|---|---|
| public <T> Object getDependency(Class<T> clazz) Retrieves the registered dependency object provided by this class identifier | |
| logPrimaryExceptionToMdc | back to summary |
|---|---|
| private void logPrimaryExceptionToMdc(Throwable exception, String source) | |
| provideDependency | back to summary |
|---|---|
| public CommandScope provideDependency(Class<?> clazz, Object value) Assign a value to a given provided dependency. So if a CommandStep provides class X, at
Means that this class will LockService.class using object lock | |
| setOutput | back to summary |
|---|---|
| public CommandScope setOutput(OutputStream outputStream) Sets the output stream for this command. The command output sent to this stream should not include status/progress type output, only the actual output itself. Think "what would be piped out", not "what the user is told about what is happening". | |
| validate | back to summary |
|---|---|
| public void validate() throws CommandValidationException | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| protected Map | |
| public int | getPrecedence()
Implements liquibase. Returns the precedence of values returned by this provider. |
| protected String | |
| protected boolean | keyMatches(String
the configuration key requested wantedKey, String the key stored in the map storedKey)Overrides liquibase. Used by |
| CommandScopeValueProvider | back to summary |
|---|---|
| private CommandScopeValueProvider() | |
| getMap | back to summary |
|---|---|
| protected Map Implements abstract liquibase.
| |
| getPrecedence | back to summary |
|---|---|
| public int getPrecedence() Implements liquibase. Doc from liquibase. Returns the precedence of values returned by this provider. Higher a provider with higher precedence overrides values from lower precedence providers.
| |
| getSourceDescription | back to summary |
|---|---|
| protected String getSourceDescription() Implements abstract liquibase.
| |
| keyMatches | back to summary |
|---|---|
| protected boolean keyMatches(String wantedKey, String storedKey) Overrides liquibase. Doc from liquibase. Used by | |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides java. Implements java. This method does not actually close the underlying stream, but rather only flushes it. |
| public void | write(byte[]
the data. b, int the start offset in the data. off, int the number of bytes to write. len)Overrides java. Writes |
| UnclosableOutputStream | back to summary |
|---|---|
| public UnclosableOutputStream(OutputStream out) | |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. This method does not actually close the underlying stream, but rather only flushes it. Callers should not be closing the stream they are given.
| |
| write | back to summary |
|---|---|
| public void write(byte[] b, int off, int len) throws IOException Overrides java. Doc from java. Writes
| |