Skip to content
Snippets Groups Projects
Commit 7fe9843d authored by brinn's avatar brinn
Browse files

reformat: adapt comments to of 100 characters per line

SVN: 5421
parent cfb6998d
No related branches found
No related tags found
No related merge requests found
Showing
with 62 additions and 43 deletions
......@@ -73,7 +73,8 @@ public class DBMigrationEngine
/**
* Creates an instance for the specified DAO factory and SQL script provider.
*
* @param shouldCreateFromScratch If <code>true</code> the database should be dropped and created from scratch.
* @param shouldCreateFromScratch If <code>true</code> the database should be dropped and
* created from scratch.
*/
public DBMigrationEngine(IDAOFactory daoFactory, ISqlScriptProvider scriptProvider,
boolean shouldCreateFromScratch)
......@@ -89,7 +90,8 @@ public class DBMigrationEngine
* Create or migrate database to the specified version.
*
* @throws ConfigurationFailureException If creation/migration fails due to a missing script
* @throws EnvironmentFailureException If creation/migration fails due to an inconsistent database.
* @throws EnvironmentFailureException If creation/migration fails due to an inconsistent
* database.
*/
public void migrateTo(String version)
{
......
......@@ -32,7 +32,8 @@ import org.apache.commons.lang.StringUtils;
import ch.systemsx.cisd.common.utilities.FileUtilities;
/**
* A class that formats the SQL schema scripts. The output will have a canonical form that is easy to compare.
* A class that formats the SQL schema scripts. The output will have a canonical form that is easy
* to compare.
*
* @author Bernd Rinn
*/
......
......@@ -38,7 +38,8 @@ public final class DBUtilities
}
/**
* Checks whether given <code>DataAccessException</code> is caused by a "database does not exist" exception.
* Checks whether given <code>DataAccessException</code> is caused by a "database does not
* exist" exception.
* <p>
* This is database specific.
* </p>
......@@ -50,7 +51,8 @@ public final class DBUtilities
}
/**
* Checks whether given <code>DataAccessException</code> is caused by a "duplicate object" exception.
* Checks whether given <code>DataAccessException</code> is caused by a "duplicate object"
* exception.
* <p>
* This is database specific.
* </p>
......
......@@ -143,9 +143,10 @@ public enum DatabaseEngine
}
/**
* @param urlHostPartOrNull The host part of the URL, or <code>null</code>, if the default host part should be
* used.
* @param databaseName The name of the database (may be ignored for the admin URL, depending on the database engine)
* @param urlHostPartOrNull The host part of the URL, or <code>null</code>, if the default
* host part should be used.
* @param databaseName The name of the database (may be ignored for the admin URL, depending on
* the database engine)
* @return The admin URL of the db.
*/
public final String getAdminURL(String urlHostPartOrNull, String databaseName)
......@@ -162,8 +163,8 @@ public enum DatabaseEngine
}
/**
* @param urlHostPartOrNull The host part of the URL, or <code>null</code>, if the default host part should be
* used.
* @param urlHostPartOrNull The host part of the URL, or <code>null</code>, if the default
* host part should be used.
* @param databaseName The name of the database.
* @return The URL of the db.
*/
......
......@@ -36,8 +36,8 @@ public interface IDatabaseAdminDAO
public String getDatabaseURL();
/**
* Creates the owner/user of the database. Implementation should handle the case of already existing owner/user
* gracefully.
* Creates the owner/user of the database. Implementation should handle the case of already
* existing owner/user gracefully.
*/
public void createOwner();
......
......@@ -27,7 +27,8 @@ import ch.systemsx.cisd.common.db.ISqlScriptExecutionLogger;
public interface IDatabaseVersionLogDAO extends ISqlScriptExecutionLogger
{
/**
* Returns <code>true</code> if the database instance with database version log can be connected.
* Returns <code>true</code> if the database instance with database version log can be
* connected.
*/
public boolean canConnectToDatabase();
......
......@@ -19,12 +19,14 @@ package ch.systemsx.cisd.dbmigration;
import java.io.File;
/**
* Classes that implement this interface encapsulate mass uploading of tabular files to the database. The files to be
* processed by implementations of this class are supposed to be <code>csv</code> files that can be uploaded to
* exactly one table. They need to follow the naming convention
* <code><i>&lt;orderSpecifier&gt;</i>=<i>&lt;tableName&gt;</i>.&lt;file type&gt;</code>. Here the order specifier
* ensures that the dependency is right while the table name is the name of the table to upload the data to. The file
* type has to be <code>csv</code> (Comma veparated values) or <code>tsv</code> (TAB separated values).
* Classes that implement this interface encapsulate mass uploading of tabular files to the
* database. The files to be processed by implementations of this class are supposed to be
* <code>csv</code> files that can be uploaded to exactly one table. They need to follow the
* naming convention
* <code><i>&lt;orderSpecifier&gt;</i>=<i>&lt;tableName&gt;</i>.&lt;file type&gt;</code>. Here
* the order specifier ensures that the dependency is right while the table name is the name of the
* table to upload the data to. The file type has to be <code>csv</code> (Comma veparated values)
* or <code>tsv</code> (TAB separated values).
*
* @author Bernd Rinn
*/
......@@ -35,7 +37,8 @@ public interface IMassUploader
* Upload the data from file <var>massUploadFile</var> to the database.
*
* @param massUploadFiles Files to upload to the database, following the naming convention
* <code>orderSpecifier=tableName.csv</code> or <code>orderSpecifier=tableName.tsv</code>.
* <code>orderSpecifier=tableName.csv</code> or
* <code>orderSpecifier=tableName.tsv</code>.
*/
public void performMassUpload(File[] massUploadFiles);
......
......@@ -29,8 +29,9 @@ import ch.systemsx.cisd.common.Script;
public interface ISqlScriptProvider
{
/**
* Returns <code>true</code> if this script provider is suitable for a dump restore of the given <var>version</var>
* of the database, and <code>false</code>, if it is suitable for a regular setup.
* Returns <code>true</code> if this script provider is suitable for a dump restore of the
* given <var>version</var> of the database, and <code>false</code>, if it is suitable for a
* regular setup.
*/
public boolean isDumpRestore(String version);
......
......@@ -114,8 +114,8 @@ public class LogEntry
}
/**
* Sets runStatus based its string representation. If the argument does not match one of the valid constants.
* {@link RunStatus#UNKNOWN} will be used.
* Sets runStatus based its string representation. If the argument does not match one of the
* valid constants. {@link RunStatus#UNKNOWN} will be used.
*/
public void setRunStatus(String runStatusAsString)
{
......
......@@ -28,9 +28,9 @@ import ch.systemsx.cisd.common.logging.LogFactory;
import ch.systemsx.cisd.common.utilities.FileUtilities;
/**
* Implementation of {@link ISqlScriptProvider} based on files in classpath or working directory. This provider tries
* first to load a resource. If this isn't successful the provider tries to look for files relative to the working
* directory.
* Implementation of {@link ISqlScriptProvider} based on files in classpath or working directory.
* This provider tries first to load a resource. If this isn't successful the provider tries to look
* for files relative to the working directory.
*
* @author Franz-Josef Elmer
*/
......@@ -48,12 +48,12 @@ public class SqlScriptProvider implements ISqlScriptProvider
private final String specificScriptFolder;
/**
* Creates an instance for the specified script folders. They are either resource folders or folders relative to the
* working directory.
* Creates an instance for the specified script folders. They are either resource folders or
* folders relative to the working directory.
*
* @param schemaScriptRootFolder Root folder of schema, migration and data scripts.
* @param databaseEngineCode The code of the database engine. Used to find the db engine specific schema script
* folder.
* @param databaseEngineCode The code of the database engine. Used to find the db engine
* specific schema script folder.
*/
public SqlScriptProvider(String schemaScriptRootFolder, String databaseEngineCode)
{
......@@ -62,7 +62,8 @@ public class SqlScriptProvider implements ISqlScriptProvider
}
/**
* Returns <code>true</code> if a &lt;finish script&gt; is found and <code>false</code> otherwise.
* Returns <code>true</code> if a &lt;finish script&gt; is found and <code>false</code>
* otherwise.
*/
public boolean isDumpRestore(String version)
{
......@@ -100,7 +101,8 @@ public class SqlScriptProvider implements ISqlScriptProvider
}
/**
* Returns the script containing all functions for the specified version. The name of the script is expected to be
* Returns the script containing all functions for the specified version. The name of the script
* is expected to be
*
* <pre>
* &lt;data script folder&gt;/&lt;version&gt;/function-&lt;version&gt;.sql
......@@ -124,7 +126,8 @@ public class SqlScriptProvider implements ISqlScriptProvider
}
/**
* Returns the migration script for the specified versions. The name of the script is expected to be
* Returns the migration script for the specified versions. The name of the script is expected
* to be
*
* <pre>
* &lt;schema script folder&gt;/migration/migration-&lt;fromVersion&gt;-&lt;toVersion&gt;.sql
......
......@@ -118,7 +118,8 @@ public class H2AdminDAO extends SimpleJdbcDaoSupport implements IDatabaseAdminDA
public void createDatabase()
{
// Creation of databases happens "on the fly" with H2, we only need to create the database_version_logs table
// Creation of databases happens "on the fly" with H2, we only need to create the
// database_version_logs table
createDatabaseVersionLogsTable();
}
......
......@@ -29,8 +29,8 @@ public class H2StoredProcedures
{
/**
* Renames the sequence <var>oldName</var> into <var>newName</var> ensuring the <code>NEXTVAL()</code> will
* return the right value.
* Renames the sequence <var>oldName</var> into <var>newName</var> ensuring the
* <code>NEXTVAL()</code> will return the right value.
*
* @return The next value the sequence will deliver.
*/
......
......@@ -40,9 +40,11 @@ import javax.swing.JFileChooser;
import org.apache.commons.io.IOUtils;
/**
* Helper application which creates 'mass upload' files to be used to setup the database from a PostgreSQL dump.
* Helper application which creates 'mass upload' files to be used to setup the database from a
* PostgreSQL dump.
* <p>
* <b>Important:</b> When creating the dump file with <code>pg_dump</code> use the option <b>--no-owner</b>.
* <b>Important:</b> When creating the dump file with <code>pg_dump</code> use the option
* <b>--no-owner</b>.
* <p>
* Note, that this is a stand alone class which only uses J2EE library classes.
*
......@@ -88,8 +90,8 @@ public class DumpPreparator
/**
* Creates all files necessary to setup a database from the specified PostgreSQL dump file.
*
* @param destination Destination folder in which the folder with the files will be created. The folder will be
* named after the database version extracted from the dump.
* @param destination Destination folder in which the folder with the files will be created. The
* folder will be named after the database version extracted from the dump.
*/
public static void createUploadFiles(File dumpFile, File destination) throws IOException
{
......
......@@ -150,7 +150,8 @@ public class SqlScriptProviderTest
assertEquals("code: schema", script.getCode().trim());
}
// Note: we make it dependent on testGetSchemaScript(), because we delete the specific schema script
// Note: we make it dependent on testGetSchemaScript(), because we delete the specific schema
// script
// in this test case and thus testGetSchemaScript() would fail if run after this test case.
@Test(dependsOnMethods = "testGetSchemaScript")
public void testGetGenericSchemaScript()
......
......@@ -27,7 +27,8 @@ public class H2TestStoredProcedures
{
/**
* Compares <var>expected</var> with <var>actual</var> and throws an exception if they are not equal.
* Compares <var>expected</var> with <var>actual</var> and throws an exception if they are not
* equal.
*
* @return 0.
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment