incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1029937 - /incubator/lcf/trunk/modules/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
Date Tue, 02 Nov 2010 01:48:48 GMT
Author: kwright
Date: Tue Nov  2 01:48:48 2010
New Revision: 1029937

URL: http://svn.apache.org/viewvc?rev=1029937&view=rev
Log:
Fix for CONNECTORS-123

Modified:
    incubator/lcf/trunk/modules/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java

Modified: incubator/lcf/trunk/modules/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java?rev=1029937&r1=1029936&r2=1029937&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
(original)
+++ incubator/lcf/trunk/modules/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
Tue Nov  2 01:48:48 2010
@@ -5756,58 +5756,58 @@ public class JobManager implements IJobM
       .append(")")
       .append(" THEN 'Inactive'")
       .append(" WHEN ")
-      .append("(").append("t0.").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_PENDING)))
+      .append("t0.").append(jobQueue.checkTimeField).append("<=").append(currentTime.toString())
+      .append(" AND (t0.").append(jobQueue.checkActionField).append(" IS NULL OR t0.").append(jobQueue.checkActionField).append("=").append(database.quoteSQLString(jobQueue.actionToString(jobQueue.ACTION_RESCAN))).append(")")
+      .append(" AND (").append("t0.").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_PENDING)))
       .append(" OR ").append("t0.").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_PENDINGPURGATORY)))
       .append(")")
-      .append(" AND t0.").append(jobQueue.checkTimeField).append("<=").append(currentTime.toString())
-      .append(" AND (t0.").append(jobQueue.checkActionField).append(" IS NULL OR t0.").append(jobQueue.checkActionField).append("=").append(database.quoteSQLString(jobQueue.actionToString(jobQueue.ACTION_RESCAN))).append(")")
       .append(" THEN 'Ready for processing'")
       .append(" WHEN ")
-      .append("(").append("t0.").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_PENDING)))
+      .append("t0.").append(jobQueue.checkTimeField).append("<=").append(currentTime.toString())
+      .append(" AND t0.").append(jobQueue.checkActionField).append("=").append(database.quoteSQLString(jobQueue.actionToString(jobQueue.ACTION_REMOVE)))
+      .append(" AND (").append("t0.").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_PENDING)))
       .append(" OR ").append("t0.").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_PENDINGPURGATORY)))
       .append(")")
-      .append(" AND t0.").append(jobQueue.checkTimeField).append("<=").append(currentTime.toString())
-      .append(" AND t0.").append(jobQueue.checkActionField).append("=").append(database.quoteSQLString(jobQueue.actionToString(jobQueue.ACTION_REMOVE)))
       .append(" THEN 'Ready for expiration'")
       .append(" WHEN ")
-      .append("(").append("t0.").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_PENDING)))
+      .append("t0.").append(jobQueue.checkTimeField).append(">").append(currentTime.toString())
+      .append(" AND (t0.").append(jobQueue.checkActionField).append(" IS NULL OR t0.").append(jobQueue.checkActionField).append("=").append(database.quoteSQLString(jobQueue.actionToString(jobQueue.ACTION_RESCAN))).append(")")
+      .append(" AND (").append("t0.").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_PENDING)))
       .append(" OR ").append("t0.").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_PENDINGPURGATORY)))
       .append(")")
-      .append(" AND t0.").append(jobQueue.checkTimeField).append(">").append(currentTime.toString())
-      .append(" AND (t0.").append(jobQueue.checkActionField).append(" IS NULL OR t0.").append(jobQueue.checkActionField).append("=").append(database.quoteSQLString(jobQueue.actionToString(jobQueue.ACTION_RESCAN))).append(")")
       .append(" THEN 'Waiting for processing'")
       .append(" WHEN ")
-      .append("(").append("t0.").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_PENDING)))
+      .append("t0.").append(jobQueue.checkTimeField).append(">").append(currentTime.toString())
+      .append(" AND t0.").append(jobQueue.checkActionField).append("=").append(database.quoteSQLString(jobQueue.actionToString(jobQueue.ACTION_REMOVE)))
+      .append(" AND (").append("t0.").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_PENDING)))
       .append(" OR ").append("t0.").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_PENDINGPURGATORY)))
       .append(")")
-      .append(" AND t0.").append(jobQueue.checkTimeField).append(">").append(currentTime.toString())
-      .append(" AND t0.").append(jobQueue.checkActionField).append("=").append(database.quoteSQLString(jobQueue.actionToString(jobQueue.ACTION_REMOVE)))
       .append(" THEN 'Waiting for expiration'")
       .append(" WHEN ")
-      .append("(").append("t0.").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_PENDING)))
+      .append("t0.").append(jobQueue.checkTimeField).append(" IS NULL")
+      .append(" AND (").append("t0.").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_PENDING)))
       .append(" OR ").append("t0.").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_PENDINGPURGATORY)))
       .append(")")
-      .append(" AND t0.").append(jobQueue.checkTimeField).append(" IS NULL")
       .append(" THEN 'Waiting forever'")
       .append(" WHEN ").append("t0.").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_BEINGDELETED)))
       .append(" THEN 'Deleting'")
       .append(" WHEN ")
-      .append("(").append("t0.").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_ACTIVE)))
+      .append("(t0.").append(jobQueue.checkActionField).append(" IS NULL OR t0.").append(jobQueue.checkActionField).append("=").append(database.quoteSQLString(jobQueue.actionToString(jobQueue.ACTION_RESCAN))).append(")")
+      .append(" AND (").append("t0.").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_ACTIVE)))
       .append(" OR ").append("t0.").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCAN)))
       .append(" OR ").append("t0.").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_ACTIVEPURGATORY)))
       .append(" OR ").append("t0.").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCANPURGATORY)))
       .append(")")
-      .append(" AND (t0.").append(jobQueue.checkActionField).append(" IS NULL OR t0.").append(jobQueue.checkActionField).append("=").append(database.quoteSQLString(jobQueue.actionToString(jobQueue.ACTION_RESCAN))).append(")")
       .append(" THEN 'Processing'")
       .append(" WHEN ")
-      .append("(").append("t0.").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_ACTIVE)))
+      .append("t0.").append(jobQueue.checkActionField).append("=").append(database.quoteSQLString(jobQueue.actionToString(jobQueue.ACTION_REMOVE)))
+      .append(" AND (").append("t0.").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_ACTIVE)))
       .append(" OR ").append("t0.").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCAN)))
       .append(" OR ").append("t0.").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_ACTIVEPURGATORY)))
       .append(" OR ").append("t0.").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCANPURGATORY)))
       .append(")")
-      .append(" AND t0.").append(jobQueue.checkActionField).append("=").append(database.quoteSQLString(jobQueue.actionToString(jobQueue.ACTION_REMOVE)))
       .append(" THEN 'Expiring'")
-      .append(" ELSE 'Unknown'")
+      .append(" ELSE 'Unknown ' || t0.").append(jobQueue.statusField).append(" || t0.").append(jobQueue.checkActionField)
       .append(" END AS status,")
       .append("t0.").append(jobQueue.checkTimeField).append(" AS scheduled,")
       .append("CASE")
@@ -5863,23 +5863,23 @@ public class JobManager implements IJobM
       .append(" AS inactive,")
       .append("CASE")
       .append(" WHEN ")
-      .append("(").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_ACTIVE)))
+      .append("(").append(jobQueue.checkActionField).append(" IS NULL OR ").append(jobQueue.checkActionField).append("=").append(database.quoteSQLString(jobQueue.actionToString(jobQueue.ACTION_RESCAN))).append(")")
+      .append(" AND (").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_ACTIVE)))
       .append(" OR ").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCAN)))
       .append(" OR ").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_ACTIVEPURGATORY)))
       .append(" OR ").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCANPURGATORY)))
       .append(")")
-      .append(" AND (").append(jobQueue.checkActionField).append(" IS NULL OR ").append(jobQueue.checkActionField).append("=").append(database.quoteSQLString(jobQueue.actionToString(jobQueue.ACTION_RESCAN))).append(")")
       .append(" THEN 1 ELSE 0")
       .append(" END")
       .append(" as processing,")
       .append("CASE")
       .append(" WHEN ")
-      .append("(").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_ACTIVE)))
+      .append(jobQueue.checkActionField).append("=").append(database.quoteSQLString(jobQueue.actionToString(jobQueue.ACTION_REMOVE)))
+      .append(" AND (").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_ACTIVE)))
       .append(" OR ").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCAN)))
       .append(" OR ").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_ACTIVEPURGATORY)))
       .append(" OR ").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_ACTIVENEEDRESCANPURGATORY)))
       .append(")")
-      .append(" AND ").append(jobQueue.checkActionField).append("=").append(database.quoteSQLString(jobQueue.actionToString(jobQueue.ACTION_REMOVE)))
       .append(" THEN 1 ELSE 0")
       .append(" END")
       .append(" as expiring,")
@@ -5891,50 +5891,50 @@ public class JobManager implements IJobM
       .append(" as deleting,")
       .append("CASE")
       .append(" WHEN ")
-      .append("(").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_PENDING)))
+      .append(jobQueue.checkTimeField).append("<=").append(currentTime.toString())
+      .append(" AND (").append(jobQueue.checkActionField).append(" IS NULL OR ").append(jobQueue.checkActionField).append("=").append(database.quoteSQLString(jobQueue.actionToString(jobQueue.ACTION_RESCAN))).append(")")
+      .append(" AND (").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_PENDING)))
       .append(" OR ").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_PENDINGPURGATORY)))
       .append(")")
-      .append(" AND ").append(jobQueue.checkTimeField).append("<=").append(currentTime.toString())
-      .append(" AND (").append(jobQueue.checkActionField).append(" IS NULL OR ").append(jobQueue.checkActionField).append("=").append(database.quoteSQLString(jobQueue.actionToString(jobQueue.ACTION_RESCAN))).append(")")
       .append(" THEN 1 ELSE 0")
       .append(" END")
       .append(" as processready,")
       .append("CASE")
       .append(" WHEN ")
-      .append("(").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_PENDING)))
+      .append(jobQueue.checkTimeField).append("<=").append(currentTime.toString())
+      .append(" AND ").append(jobQueue.checkActionField).append("=").append(database.quoteSQLString(jobQueue.actionToString(jobQueue.ACTION_REMOVE)))
+      .append(" AND (").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_PENDING)))
       .append(" OR ").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_PENDINGPURGATORY)))
       .append(")")
-      .append(" AND ").append(jobQueue.checkTimeField).append("<=").append(currentTime.toString())
-      .append(" AND ").append(jobQueue.checkActionField).append("=").append(database.quoteSQLString(jobQueue.actionToString(jobQueue.ACTION_REMOVE)))
       .append(" THEN 1 ELSE 0")
       .append(" END")
       .append(" as expireready,")
       .append("CASE")
       .append(" WHEN ")
-      .append("(").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_PENDING)))
+      .append(jobQueue.checkTimeField).append(">").append(currentTime.toString())
+      .append(" AND (").append(jobQueue.checkActionField).append(" IS NULL OR ").append(jobQueue.checkActionField).append("=").append(database.quoteSQLString(jobQueue.actionToString(jobQueue.ACTION_RESCAN))).append(")")
+      .append(" AND (").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_PENDING)))
       .append(" OR ").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_PENDINGPURGATORY)))
       .append(")")
-      .append(" AND ").append(jobQueue.checkTimeField).append(">").append(currentTime.toString())
-      .append(" AND (").append(jobQueue.checkActionField).append(" IS NULL OR ").append(jobQueue.checkActionField).append("=").append(database.quoteSQLString(jobQueue.actionToString(jobQueue.ACTION_RESCAN))).append(")")
       .append(" THEN 1 ELSE 0")
       .append(" END")
       .append(" as processwaiting,")
       .append("CASE")
       .append(" WHEN ")
-      .append("(").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_PENDING)))
+      .append(jobQueue.checkTimeField).append(">").append(currentTime.toString())
+      .append(" AND ").append(jobQueue.checkActionField).append("=").append(database.quoteSQLString(jobQueue.actionToString(jobQueue.ACTION_REMOVE)))
+      .append(" AND (").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_PENDING)))
       .append(" OR ").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_PENDINGPURGATORY)))
       .append(")")
-      .append(" AND ").append(jobQueue.checkTimeField).append(">").append(currentTime.toString())
-      .append(" AND ").append(jobQueue.checkActionField).append("=").append(database.quoteSQLString(jobQueue.actionToString(jobQueue.ACTION_REMOVE)))
       .append(" THEN 1 ELSE 0")
       .append(" END")
       .append(" as expirewaiting,")
       .append("CASE")
       .append(" WHEN ")
-      .append("(").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_PENDING)))
+      .append(jobQueue.checkTimeField).append(" IS NULL")
+      .append(" AND (").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_PENDING)))
       .append(" OR ").append(jobQueue.statusField).append("=").append(database.quoteSQLString(jobQueue.statusToString(jobQueue.STATUS_PENDINGPURGATORY)))
       .append(")")
-      .append(" AND ").append(jobQueue.checkTimeField).append(" IS NULL")
       .append(" THEN 1 ELSE 0")
       .append(" END")
       .append(" as waitingforever");



Mime
View raw message