All Downloads are FREE. Search and download functionalities are using the official Maven repository.

liquibase.command.AbstractCommand Maven / Gradle / Ivy

There is a newer version: 3.6.2.5.inovus
Show newest version
package liquibase.command;

import liquibase.servicelocator.PrioritizedService;

public abstract class AbstractCommand implements LiquibaseCommand {

    @Override
    public int getPriority(String commandName) {
        if ((commandName != null) && commandName.equalsIgnoreCase(getName())) {
            return PrioritizedService.PRIORITY_DEFAULT;
        } else {
            return -1;
        }
    }

    public final T execute() throws CommandExecutionException {
        this.validate();
        try {
            return this.run();
        } catch (Exception e) {
            if (e instanceof CommandExecutionException) {
                throw (CommandExecutionException) e;
            } else {
                throw new CommandExecutionException(e);
            }
        }
    }

    protected abstract T run() throws Exception;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy