Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2011-02-28 16:35:26 -0500
committerRyan D. Brooks2011-02-28 16:35:26 -0500
commit5f2c7dc480ee7ca052b9ffd9fc8cd9178703d960 (patch)
treef5d5a5f948d5017f66235ce6dad385b8d31f90b1 /plugins/org.eclipse.osee.framework.database
parente5c5143a0100f67e3ca636e810e0a45d47933898 (diff)
downloadorg.eclipse.osee-5f2c7dc480ee7ca052b9ffd9fc8cd9178703d960.tar.gz
org.eclipse.osee-5f2c7dc480ee7ca052b9ffd9fc8cd9178703d960.tar.xz
org.eclipse.osee-5f2c7dc480ee7ca052b9ffd9fc8cd9178703d960.zip
refactor: Rename OperationReporter to OperationLogger
Diffstat (limited to 'plugins/org.eclipse.osee.framework.database')
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/operation/ConsolidateArtifactVersionTxOperation.java31
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/operation/InvalidTxCurrentsAndModTypes.java14
2 files changed, 22 insertions, 23 deletions
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/operation/ConsolidateArtifactVersionTxOperation.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/operation/ConsolidateArtifactVersionTxOperation.java
index d75f431004..4fa03c262b 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/operation/ConsolidateArtifactVersionTxOperation.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/operation/ConsolidateArtifactVersionTxOperation.java
@@ -17,7 +17,7 @@ import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.enums.TxChange;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.exception.OseeStateException;
-import org.eclipse.osee.framework.core.operation.OperationReporter;
+import org.eclipse.osee.framework.core.operation.OperationLogger;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.database.core.AbstractDbTxOperation;
import org.eclipse.osee.framework.database.core.ExportImportJoinQuery;
@@ -71,13 +71,13 @@ public class ConsolidateArtifactVersionTxOperation extends AbstractDbTxOperation
private long previousNetGammaId;
private int previousBranchId;
private int previuosTransactionId;
- private final OperationReporter reporter;
+ private final OperationLogger logger;
private int updateTxsCounter;
private int deleteTxsCounter;
- public ConsolidateArtifactVersionTxOperation(IOseeDatabaseService databaseService, OperationReporter reporter) {
+ public ConsolidateArtifactVersionTxOperation(IOseeDatabaseService databaseService, OperationLogger logger) {
super(databaseService, "Consolidate Artifact Versions", Activator.PLUGIN_ID);
- this.reporter = reporter;
+ this.logger = logger;
}
private void init() throws OseeCoreException {
@@ -158,8 +158,7 @@ public class ConsolidateArtifactVersionTxOperation extends AbstractDbTxOperation
}
}
if (!knownCase) {
- reporter.report(String.format("unknown case: artifact id: %d branch_id: %d", previousArtifactId,
- previousBranchId));
+ logger.log(String.format("unknown case: artifact id: %d branch_id: %d", previousArtifactId, previousBranchId));
}
}
@@ -171,8 +170,8 @@ public class ConsolidateArtifactVersionTxOperation extends AbstractDbTxOperation
if (true) {
findArtifactMods();
- reporter.report("updateTxsCurrentModData size: " + updateTxsCurrentModData.size());
- reporter.report("addressingToDelete size: " + addressingToDelete.size());
+ logger.log("updateTxsCurrentModData size: " + updateTxsCurrentModData.size());
+ logger.log("addressingToDelete size: " + addressingToDelete.size());
getDatabaseService().runBatchUpdate(connection, prepareSql(UPDATE_TXS_MOD_CURRENT, false),
updateTxsCurrentModData);
@@ -182,9 +181,9 @@ public class ConsolidateArtifactVersionTxOperation extends AbstractDbTxOperation
}
findObsoleteGammas();
- reporter.report("gamma join size: " + gammaJoin.size());
+ logger.log("gamma join size: " + gammaJoin.size());
- reporter.report("Number of artifact version rows deleted: " + getDatabaseService().runBatchUpdate(connection,
+ logger.log("Number of artifact version rows deleted: " + getDatabaseService().runBatchUpdate(connection,
DELETE_ARTIFACT_VERSIONS, deleteArtifactVersionData));
deleteArtifactVersionData = null;
@@ -205,17 +204,17 @@ public class ConsolidateArtifactVersionTxOperation extends AbstractDbTxOperation
private void updataConflicts(String columnName) throws OseeCoreException {
int count = getDatabaseService().runPreparedUpdate(connection, String.format(UPDATE_CONFLICTS, columnName));
- reporter.report(String.format("updated %s in %d rows", columnName, count));
+ logger.log(String.format("updated %s in %d rows", columnName, count));
}
private void setBaselineTransactions() throws OseeCoreException {
int count = getDatabaseService().runPreparedUpdate(connection, SET_BASELINE_TRANSACTION);
- reporter.report(String.format("updated %d baseline transactions", count));
+ logger.log(String.format("updated %d baseline transactions", count));
}
private void populateArts() throws OseeCoreException {
int count = getDatabaseService().runPreparedUpdate(connection, POPULATE_ARTS);
- reporter.report(String.format("inserted %d rows into osee_artifact", count));
+ logger.log(String.format("inserted %d rows into osee_artifact", count));
}
private void findObsoleteGammas() throws OseeCoreException {
@@ -250,7 +249,7 @@ public class ConsolidateArtifactVersionTxOperation extends AbstractDbTxOperation
private void determineAffectedAddressingAndFix(boolean archived) throws OseeCoreException {
try {
- reporter.report("query id: " + gammaJoin.getQueryId());
+ logger.log("query id: " + gammaJoin.getQueryId());
chStmt.runPreparedQuery(10000, String.format(SELECT_ADDRESSING, archived ? "_archived" : ""),
gammaJoin.getQueryId());
@@ -316,7 +315,7 @@ public class ConsolidateArtifactVersionTxOperation extends AbstractDbTxOperation
if (addressingToDelete.size() > 99960 || force) {
deleteTxsCounter +=
getDatabaseService().runBatchUpdate(connection, prepareSql(DELETE_TXS, archived), addressingToDelete);
- reporter.report("Number of txs" + archivedStr + " rows deleted: " + deleteTxsCounter);
+ logger.log("Number of txs" + archivedStr + " rows deleted: " + deleteTxsCounter);
addressingToDelete.clear();
}
@@ -324,7 +323,7 @@ public class ConsolidateArtifactVersionTxOperation extends AbstractDbTxOperation
updateTxsCounter +=
getDatabaseService().runBatchUpdate(connection, prepareSql(UPDATE_TXS_GAMMAS, archived),
updateAddressingData);
- reporter.report("Number of txs" + archivedStr + " rows updated: " + updateTxsCounter);
+ logger.log("Number of txs" + archivedStr + " rows updated: " + updateTxsCounter);
updateAddressingData.clear();
}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/operation/InvalidTxCurrentsAndModTypes.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/operation/InvalidTxCurrentsAndModTypes.java
index f3ff895005..196a0ac820 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/operation/InvalidTxCurrentsAndModTypes.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/operation/InvalidTxCurrentsAndModTypes.java
@@ -18,7 +18,7 @@ import org.eclipse.osee.framework.core.enums.TransactionDetailsType;
import org.eclipse.osee.framework.core.enums.TxChange;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.operation.AbstractOperation;
-import org.eclipse.osee.framework.core.operation.OperationReporter;
+import org.eclipse.osee.framework.core.operation.OperationLogger;
import org.eclipse.osee.framework.database.core.ConnectionHandler;
import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.database.internal.Activator;
@@ -35,7 +35,7 @@ public class InvalidTxCurrentsAndModTypes extends AbstractOperation {
"update osee_txs%s set tx_current = ? where transaction_id = ? and gamma_id = ?";
private final List<Address> addresses = new ArrayList<Address>();
- private final OperationReporter reporter;
+ private final OperationLogger logger;
private final List<Object[]> purgeData = new ArrayList<Object[]>();
private final List<Object[]> currentData = new ArrayList<Object[]>();
@@ -44,14 +44,14 @@ public class InvalidTxCurrentsAndModTypes extends AbstractOperation {
private final boolean isFixOperationEnabled;
private final String txsTableName;
- public InvalidTxCurrentsAndModTypes(String operationName, String tableName, String columnName, OperationReporter reporter, boolean isFixOperationEnabled, boolean archived) {
+ public InvalidTxCurrentsAndModTypes(String operationName, String tableName, String columnName, OperationLogger logger, boolean isFixOperationEnabled, boolean archived) {
super(
"InvalidTxCurrentsAndModTypes " + operationName + tableName + " fix:" + isFixOperationEnabled + " archived:" + archived,
Activator.PLUGIN_ID);
this.tableName = tableName;
this.columnName = columnName;
this.isFixOperationEnabled = isFixOperationEnabled;
- this.reporter = reporter;
+ this.logger = logger;
txsTableName = archived ? "_archived" : "";
}
@@ -65,7 +65,7 @@ public class InvalidTxCurrentsAndModTypes extends AbstractOperation {
}
private void logIssue(String issue, Address address) {
- reporter.report(issue, String.valueOf(address.getBranchId()), String.valueOf(address.getItemId()),
+ logger.log(issue, String.valueOf(address.getBranchId()), String.valueOf(address.getItemId()),
String.valueOf(address.getTransactionId()), String.valueOf(address.getGammaId()),
address.getModType().toString(), address.getTxCurrent().toString());
}
@@ -160,7 +160,7 @@ public class InvalidTxCurrentsAndModTypes extends AbstractOperation {
@Override
protected void doWork(IProgressMonitor monitor) throws Exception {
- reporter.report("Starting " + getName());
+ logger.log("Starting " + getName());
checkForCancelledStatus(monitor);
@@ -197,6 +197,6 @@ public class InvalidTxCurrentsAndModTypes extends AbstractOperation {
fixIssues(monitor);
- reporter.report("Completed " + getName());
+ logger.log("Completed " + getName());
}
} \ No newline at end of file

Back to the top