From 5d4cf6a5217046e555c4b99d684a308f30ac63ae Mon Sep 17 00:00:00 2001 From: coduz Date: Thu, 12 Mar 2020 17:00:10 +0100 Subject: [PATCH] Added javadoc Signed-off-by: coduz --- .../liquibase/KapuaLiquibaseClient.java | 37 +++++++++++++++++-- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/commons/src/main/java/org/eclipse/kapua/commons/liquibase/KapuaLiquibaseClient.java b/commons/src/main/java/org/eclipse/kapua/commons/liquibase/KapuaLiquibaseClient.java index 52a2c1838d8..a6af9950a3b 100644 --- a/commons/src/main/java/org/eclipse/kapua/commons/liquibase/KapuaLiquibaseClient.java +++ b/commons/src/main/java/org/eclipse/kapua/commons/liquibase/KapuaLiquibaseClient.java @@ -44,6 +44,13 @@ import java.util.Set; import java.util.regex.Pattern; +/** + * Client that execute {@link Liquibase} scripts. + *

+ * 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); @@ -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; @@ -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"))) {