Skip to content

Commit

Permalink
Added javadoc
Browse files Browse the repository at this point in the history
Signed-off-by: coduz <alberto.codutti@eurotech.com>
  • Loading branch information
Coduz committed Mar 13, 2020
1 parent 0c8abac commit 5d4cf6a
Showing 1 changed file with 33 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@
import java.util.Set;
import java.util.regex.Pattern;

/**
* Client that execute {@link Liquibase} scripts.
* <p>
* It looks available scripts in {@code .xml} or {@code .sql} in the classpath.
*
* @since 1.0.0
*/
public class KapuaLiquibaseClient {

private static final Logger LOG = LoggerFactory.getLogger(KapuaLiquibaseClient.class);
Expand All @@ -58,6 +65,27 @@ public class KapuaLiquibaseClient {
private final String schema;
private final boolean runTimestampsFix;

/**
* Constructor.
*
* @param jdbcUrl The JDBC connection string.
* @param username The username to connect to to the database.
* @param password The password to connect to to the database.
* @since 1.0.0
*/
public KapuaLiquibaseClient(String jdbcUrl, String username, String password) {
this(jdbcUrl, username, password, null);
}

/**
* Constructor.
*
* @param jdbcUrl The JDBC connection string.
* @param username The username to connect to to the database.
* @param password The password to connect to to the database.
* @param schema The schema name.
* @since 1.0.0
*/
public KapuaLiquibaseClient(String jdbcUrl, String username, String password, String schema) {
this.jdbcUrl = jdbcUrl;
this.username = username;
Expand All @@ -76,10 +104,11 @@ public KapuaLiquibaseClient(String jdbcUrl, String username, String password, St
LOG.info("Apply timestamp fix: {}", runTimestampsFix);
}

public KapuaLiquibaseClient(String jdbcUrl, String username, String password) {
this(jdbcUrl, username, password, null);
}

/**
* Starts the looking and execution of the Liquibase Scripts.
*
* @since 1.0.0
*/
public void update() {
try {
if (Boolean.parseBoolean(System.getProperty("LIQUIBASE_ENABLED", "true")) || Boolean.parseBoolean(System.getenv("LIQUIBASE_ENABLED"))) {
Expand Down

0 comments on commit 5d4cf6a

Please sign in to comment.