You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2015/06/03 03:49:55 UTC
svn commit: r1683209 - in /manifoldcf/branches/dev_1x: ./ framework/
framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/
framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/
framework/pull-agent/src/main/java/...
Author: kwright
Date: Wed Jun 3 01:49:55 2015
New Revision: 1683209
URL: http://svn.apache.org/r1683209
Log:
Pull up first part of CONNECTORS-1208 changes from trunk.
Modified:
manifoldcf/branches/dev_1x/ (props changed)
manifoldcf/branches/dev_1x/framework/ (props changed)
manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IJobManager.java
manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/INotificationConnector.java
manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/notifications/BaseNotificationConnector.java
manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/JobResetThread.java
manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/JobStartThread.java
Propchange: manifoldcf/branches/dev_1x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jun 3 01:49:55 2015
@@ -124,4 +124,4 @@
/manifoldcf/branches/CONNECTORS-981:1605049-1605773
/manifoldcf/branches/CONNECTORS-989:1611600-1612101
/manifoldcf/branches/CONNECTORS-990:1610284-1610707
-/manifoldcf/trunk:1620703,1620748,1620812,1620862,1621449,1621613,1621855,1622213,1622740,1622850,1622853-1622854,1623249,1623251,1623314,1623599,1623951,1623953-1623954,1623956,1623972,1624058,1624085,1624174,1624236,1624377,1624384,1624399,1624449,1624464,1624504,1624729-1624731,1624906,1624909-1624910,1624982,1625023,1625095,1625103,1625108,1625264,1625270,1625394,1625400,1625910,1626090,1626097,1626102,1626638-1626639,1626973,1627687,1627690,1627959,1628046,1628066,1628106,1628168,1628188,1628699,1628798,1628808,1628845,1628905,1629122,1629374-1629375,1629379,1629541,1629994,1630188,1630535,1630623,1630671,1630812,1630885,1631039,1631162,1631164,1631252,1631750,1631953,1632013,1632225,1632289,1632562,1632844,1632847,1632854,1633062-1633063,1633108,1633193,1633202,1633282,1633284,1633295,1633336,1633339,1633345,1633348,1633364,1633378,1633383,1633432,1633546,1633590,1633634,1633668,1633727,1633760,1633764,1633786,1633910,1633923,1634021,1634028,1634067,1634132,1634145,1634148,163
4155,1634188,1634202,1634264,1634373,1634530,1634688,1634850,1634857,1635103,1635116,1635421,1635438,1635478,1635481,1635484,1635490,1635809,1635939,1636146,1636167,1636180,1636207,1636215,1636232,1636334,1636519,1636570,1636684,1636940,1637011,1637310,1637350,1637364,1637373,1637378,1639259,1639593,1639600,1640018,1640101,1640199,1640204,1640208,1640314,1640319,1640749,1640772,1640805,1640888,1640925,1640941-1640942,1641222,1641328,1641557,1641559,1641629,1641633,1641724,1641754,1641911,1642163,1642255,1642318,1642531,1642650,1642658,1642673,1642716,1644197,1644399,1644538,1644920,1644931,1646317,1646397,1646403,1646408,1646640,1646947,1647574,1647585,1647608,1648686,1648976,1649201,1649203,1649529,1649605,1649628,1649794,1650351,1650722,1650741-1650742,1650745,1650747,1650911,1650954,1651332,1651539,1651907,1651921,1652071,1652974,1653175,1653899,1654651,1655205,1655261,1655264,1655377,1655411,1655618,1655914,1657346,1657443,1658004,1658036,1658121,1658155,1658188,1658463,1658476,
1660258,1660276,1661454,1665848,1666160,1666781,1666820,1668312,1669100,1669238,1669487,1669523,1669586,1669660,1670614,1670625,1670715,1671496,1672169,1672301,1672616,1672737,1673559,1673573,1673579,1673722,1675781,1675898,1676094,1676882,1676910,1678300,1678329,1678471,1678551,1679730,1679826,1681390,1681735,1682232,1682252,1682410,1682602,1682622,1682719
+/manifoldcf/trunk:1620703,1620748,1620812,1620862,1621449,1621613,1621855,1622213,1622740,1622850,1622853-1622854,1623249,1623251,1623314,1623599,1623951,1623953-1623954,1623956,1623972,1624058,1624085,1624174,1624236,1624377,1624384,1624399,1624449,1624464,1624504,1624729-1624731,1624906,1624909-1624910,1624982,1625023,1625095,1625103,1625108,1625264,1625270,1625394,1625400,1625910,1626090,1626097,1626102,1626638-1626639,1626973,1627687,1627690,1627959,1628046,1628066,1628106,1628168,1628188,1628699,1628798,1628808,1628845,1628905,1629122,1629374-1629375,1629379,1629541,1629994,1630188,1630535,1630623,1630671,1630812,1630885,1631039,1631162,1631164,1631252,1631750,1631953,1632013,1632225,1632289,1632562,1632844,1632847,1632854,1633062-1633063,1633108,1633193,1633202,1633282,1633284,1633295,1633336,1633339,1633345,1633348,1633364,1633378,1633383,1633432,1633546,1633590,1633634,1633668,1633727,1633760,1633764,1633786,1633910,1633923,1634021,1634028,1634067,1634132,1634145,1634148,163
4155,1634188,1634202,1634264,1634373,1634530,1634688,1634850,1634857,1635103,1635116,1635421,1635438,1635478,1635481,1635484,1635490,1635809,1635939,1636146,1636167,1636180,1636207,1636215,1636232,1636334,1636519,1636570,1636684,1636940,1637011,1637310,1637350,1637364,1637373,1637378,1639259,1639593,1639600,1640018,1640101,1640199,1640204,1640208,1640314,1640319,1640749,1640772,1640805,1640888,1640925,1640941-1640942,1641222,1641328,1641557,1641559,1641629,1641633,1641724,1641754,1641911,1642163,1642255,1642318,1642531,1642650,1642658,1642673,1642716,1644197,1644399,1644538,1644920,1644931,1646317,1646397,1646403,1646408,1646640,1646947,1647574,1647585,1647608,1648686,1648976,1649201,1649203,1649529,1649605,1649628,1649794,1650351,1650722,1650741-1650742,1650745,1650747,1650911,1650954,1651332,1651539,1651907,1651921,1652071,1652974,1653175,1653899,1654651,1655205,1655261,1655264,1655377,1655411,1655618,1655914,1657346,1657443,1658004,1658036,1658121,1658155,1658188,1658463,1658476,
1660258,1660276,1661454,1665848,1666160,1666781,1666820,1668312,1669100,1669238,1669487,1669523,1669586,1669660,1670614,1670625,1670715,1671496,1672169,1672301,1672616,1672737,1673559,1673573,1673579,1673722,1675781,1675898,1676094,1676882,1676910,1678300,1678329,1678471,1678551,1679730,1679826,1681390,1681735,1682232,1682252,1682410,1682602,1682622,1682719,1683208
Propchange: manifoldcf/branches/dev_1x/framework/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jun 3 01:49:55 2015
@@ -113,4 +113,4 @@
/manifoldcf/branches/CONNECTORS-989/framework:1611600-1612101
/manifoldcf/branches/CONNECTORS-990/framework:1610284-1610707
/manifoldcf/trunk:1629122
-/manifoldcf/trunk/framework:1620703,1620748,1620812,1620862,1621449,1621613,1621855,1622213,1622740,1622850,1622853-1622854,1623249,1623251,1623314,1623599,1623951,1623953-1623954,1623956,1623972,1624058,1624085,1624174,1624236,1624377,1624384,1624399,1624449,1624464,1624504,1624729-1624731,1624906,1624909-1624910,1624982,1625023,1625095,1625103,1625108,1625264,1625270,1625394,1625400,1625910,1626090,1626097,1626102,1626638-1626639,1626973,1627687,1627690,1627959,1628046,1628066,1628106,1628168,1628188,1628699,1628798,1628808,1628845,1628905,1629122,1629374-1629375,1629379,1629541,1629994,1630188,1630535,1630623,1630671,1630812,1630885,1631039,1631162,1631164,1631252,1632013,1632289,1632844,1633108,1633193,1633202,1633348,1633364,1634145,1634148,1634155,1634264,1634373,1634530,1635438,1635809,1636146,1636180,1636207,1636232,1636334,1636519,1636570,1636684,1636940,1637011,1639593,1639600,1640018,1640101,1640199,1640314,1640319,1640749,1640772,1640925,1640941,1641222,1641557,1641559,1
641724,1641911,1642163,1642255,1642318,1644197,1644399,1646317,1646397,1646403,1646640,1647574,1647585,1647608,1649605,1650351,1650911,1651332,1651539,1651921,1655377,1655411,1657346,1658004,1658036,1660258,1660276,1669487,1670614,1672616,1672737,1676094,1681390,1681735,1682232,1682252,1682410,1682719
+/manifoldcf/trunk/framework:1620703,1620748,1620812,1620862,1621449,1621613,1621855,1622213,1622740,1622850,1622853-1622854,1623249,1623251,1623314,1623599,1623951,1623953-1623954,1623956,1623972,1624058,1624085,1624174,1624236,1624377,1624384,1624399,1624449,1624464,1624504,1624729-1624731,1624906,1624909-1624910,1624982,1625023,1625095,1625103,1625108,1625264,1625270,1625394,1625400,1625910,1626090,1626097,1626102,1626638-1626639,1626973,1627687,1627690,1627959,1628046,1628066,1628106,1628168,1628188,1628699,1628798,1628808,1628845,1628905,1629122,1629374-1629375,1629379,1629541,1629994,1630188,1630535,1630623,1630671,1630812,1630885,1631039,1631162,1631164,1631252,1632013,1632289,1632844,1633108,1633193,1633202,1633348,1633364,1634145,1634148,1634155,1634264,1634373,1634530,1635438,1635809,1636146,1636180,1636207,1636232,1636334,1636519,1636570,1636684,1636940,1637011,1639593,1639600,1640018,1640101,1640199,1640314,1640319,1640749,1640772,1640925,1640941,1641222,1641557,1641559,1
641724,1641911,1642163,1642255,1642318,1644197,1644399,1646317,1646397,1646403,1646640,1647574,1647585,1647608,1649605,1650351,1650911,1651332,1651539,1651921,1655377,1655411,1657346,1658004,1658036,1660258,1660276,1669487,1670614,1672616,1672737,1676094,1681390,1681735,1682232,1682252,1682410,1682719,1683208
Modified: manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IJobManager.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IJobManager.java?rev=1683209&r1=1683208&r2=1683209&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IJobManager.java (original)
+++ manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IJobManager.java Wed Jun 3 01:49:55 2015
@@ -19,7 +19,7 @@
package org.apache.manifoldcf.crawler.interfaces;
import org.apache.manifoldcf.core.interfaces.*;
-import java.util.ArrayList;
+import java.util.List;
/** This manager deals with jobs. Each job is associated with a repository connection, and has a number
* of scheduling options: starting every n hours/days/weeks/months, on specific dates, or "continuous" (which basically
@@ -819,7 +819,7 @@ public interface IJobManager
*@param currentTime is the current time in milliseconds since epoch.
*@param unwaitList is filled in with the set of job id's that were resumed (Long's).
*/
- public void startJobs(long currentTime, ArrayList unwaitList)
+ public void startJobs(long currentTime, List<Long> unwaitList)
throws ManifoldCFException;
@@ -827,7 +827,7 @@ public interface IJobManager
*@param currentTime is the current time in milliseconds since epoch.
*@param waitList is filled in with the set of job id's that were put into a wait state (Long's).
*/
- public void waitJobs(long currentTime, ArrayList waitList)
+ public void waitJobs(long currentTime, List<Long> waitList)
throws ManifoldCFException;
/** Get the list of jobs that are ready for seeding.
@@ -1102,8 +1102,9 @@ public interface IJobManager
* and will record the jobs that have been so modified.
*@param timestamp is the current time in milliseconds since epoch.
*@param modifiedJobs is filled in with the set of IJobDescription objects that were stopped.
+ *@param stopNotificationTypes is filled in with the type of stop notification.
*/
- public void finishJobStops(long timestamp, ArrayList modifiedJobs)
+ public void finishJobStops(long timestamp, List<IJobDescription> modifiedJobs, List<Integer> stopNotificationTypes)
throws ManifoldCFException;
/** Complete the sequence that resumes jobs, either from a pause or from a scheduling window
@@ -1112,7 +1113,7 @@ public interface IJobManager
*@param timestamp is the current time in milliseconds since epoch.
*@param modifiedJobs is filled in with the set of IJobDescription objects that were resumed.
*/
- public void finishJobResumes(long timestamp, ArrayList modifiedJobs)
+ public void finishJobResumes(long timestamp, List<IJobDescription> modifiedJobs)
throws ManifoldCFException;
/** Put all eligible jobs in the "shutting down" state.
@@ -1129,7 +1130,7 @@ public interface IJobManager
*@param currentTime is the current time in milliseconds since epoch.
*@param resetJobs is filled in with the set of IJobDescription objects that were reset.
*/
- public void resetJobs(long currentTime, ArrayList resetJobs)
+ public void resetJobs(long currentTime, List<IJobDescription> resetJobs)
throws ManifoldCFException;
Modified: manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/INotificationConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/INotificationConnector.java?rev=1683209&r1=1683208&r2=1683209&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/INotificationConnector.java (original)
+++ manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/INotificationConnector.java Wed Jun 3 01:49:55 2015
@@ -48,6 +48,13 @@ public interface INotificationConnector
{
public static final String _rcsid = "@(#)$Id$";
+ // Job stop reasons
+ public final int STOP_ERRORABORT = 0;
+ public final int STOP_MANUALABORT = 1;
+ public final int STOP_MANUALPAUSE = 2;
+ public final int STOP_SCHEDULEPAUSE = 3;
+ public final int STOP_RESTART = 4;
+
/** Request arbitrary connector information.
* This method is called directly from the API in order to allow API users to perform any one of several
* connector-specific queries. These are usually used to create external UI's. The connector will be
@@ -61,8 +68,9 @@ public interface INotificationConnector
/** Notify of job stop
*@param spec is the notification specification.
+ *@param stopReason is the reason for the stop.
*/
- public void notifyOfJobStop(Specification spec)
+ public void notifyOfJobStop(Specification spec, int stopReason)
throws ManifoldCFException, ServiceInterruption;
/** Notify of job end
Modified: manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java?rev=1683209&r1=1683208&r2=1683209&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java (original)
+++ manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java Wed Jun 3 01:49:55 2015
@@ -5906,7 +5906,7 @@ public class JobManager implements IJobM
*@param unwaitList is filled in with the set of job ID objects that were resumed.
*/
@Override
- public void startJobs(long currentTime, ArrayList unwaitList)
+ public void startJobs(long currentTime, List<Long> unwaitList)
throws ManifoldCFException
{
// This method should compare the lasttime field against the current time, for all
@@ -6144,7 +6144,7 @@ public class JobManager implements IJobM
*@param waitList is filled in with the set of job ID's that were put into a wait state.
*/
@Override
- public void waitJobs(long currentTime, ArrayList waitList)
+ public void waitJobs(long currentTime, List<Long> waitList)
throws ManifoldCFException
{
// This method assesses jobs that are ACTIVE or PAUSED to see if they should be
@@ -8195,7 +8195,7 @@ public class JobManager implements IJobM
*@param modifiedJobs is filled in with the set of IJobDescription objects that were resumed.
*/
@Override
- public void finishJobResumes(long timestamp, ArrayList modifiedJobs)
+ public void finishJobResumes(long timestamp, List<IJobDescription> modifiedJobs)
throws ManifoldCFException
{
// Alternative to using a write lock here: Put this in a transaction, with a "FOR UPDATE" on the first query.
@@ -8243,9 +8243,10 @@ public class JobManager implements IJobM
* and will record the jobs that have been so modified.
*@param timestamp is the current time in milliseconds since epoch.
*@param modifiedJobs is filled in with the set of IJobDescription objects that were stopped.
+ *@param stopNotificationTypes is filled in with the type of stop notification.
*/
@Override
- public void finishJobStops(long timestamp, ArrayList modifiedJobs)
+ public void finishJobStops(long timestamp, List<IJobDescription> modifiedJobs, List<Integer> stopNotificationTypes)
throws ManifoldCFException
{
// Alternative to using a write lock here: Put this in a transaction, with a "FOR UPDATE" on the first query.
@@ -8262,7 +8263,7 @@ public class JobManager implements IJobM
StringBuilder sb = new StringBuilder("SELECT ");
ArrayList list = new ArrayList();
- sb.append(jobs.idField)
+ sb.append(jobs.idField).append(",").append(jobs.statusField).append(",").append(jobs.errorField)
.append(" FROM ").append(jobs.getTableName()).append(" WHERE ")
.append(database.buildConjunctionClause(list,new ClauseDescription[]{
new MultiClause(jobs.statusField,new Object[]{
@@ -8285,7 +8286,9 @@ public class JobManager implements IJobM
{
IResultRow row = set.getRow(i++);
Long jobID = (Long)row.getValue(jobs.idField);
-
+ int jobStatus = jobs.stringToStatus((String)row.getValue(jobs.statusField));
+ String errorText = (String)row.getValue(jobs.errorField);
+
sb = new StringBuilder("SELECT ");
list.clear();
@@ -8313,7 +8316,8 @@ public class JobManager implements IJobM
IJobDescription jobDesc = jobs.load(jobID,true);
modifiedJobs.add(jobDesc);
-
+ stopNotificationTypes.add(mapToNotificationType(jobStatus,(errorText==null || errorText.length() == 0)));
+
jobs.finishStopJob(jobID,timestamp);
Logging.jobs.info("Stopped job "+jobID);
@@ -8325,6 +8329,29 @@ public class JobManager implements IJobM
}
}
+ protected static Integer mapToNotificationType(int jobStatus, boolean noErrorText)
+ {
+ switch (jobStatus)
+ {
+ case Jobs.STATUS_ABORTING:
+ case Jobs.STATUS_ABORTINGSHUTTINGDOWN:
+ return noErrorText?INotificationConnector.STOP_MANUALABORT:INotificationConnector.STOP_ERRORABORT;
+ case Jobs.STATUS_ABORTINGFORRESTART:
+ case Jobs.STATUS_ABORTINGFORRESTARTMINIMAL:
+ return INotificationConnector.STOP_RESTART;
+ case Jobs.STATUS_PAUSING:
+ case Jobs.STATUS_PAUSINGSEEDING:
+ case Jobs.STATUS_PAUSINGWAITING:
+ case Jobs.STATUS_PAUSINGWAITINGSEEDING:
+ return INotificationConnector.STOP_MANUALPAUSE;
+ case Jobs.STATUS_ACTIVEWAITING:
+ case Jobs.STATUS_ACTIVEWAITINGSEEDING:
+ return INotificationConnector.STOP_SCHEDULEPAUSE;
+ default:
+ throw new RuntimeException("Unexpected job status: "+jobStatus);
+ }
+ }
+
protected void noDocPriorities(Long jobID)
throws ManifoldCFException
{
@@ -8380,7 +8407,7 @@ public class JobManager implements IJobM
*@param resetJobs is filled in with the set of IJobDescription objects that were reset.
*/
@Override
- public void resetJobs(long currentTime, ArrayList resetJobs)
+ public void resetJobs(long currentTime, List<IJobDescription> resetJobs)
throws ManifoldCFException
{
// Alternative to using a write lock here: Put this in a transaction, with a "FOR UPDATE" on the first query.
Modified: manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/notifications/BaseNotificationConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/notifications/BaseNotificationConnector.java?rev=1683209&r1=1683208&r2=1683209&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/notifications/BaseNotificationConnector.java (original)
+++ manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/notifications/BaseNotificationConnector.java Wed Jun 3 01:49:55 2015
@@ -64,10 +64,19 @@ public abstract class BaseNotificationCo
return false;
}
+ /** Notify of job stop
+ *@param spec is the notification specification.
+ *@param stopReason is the reason for the stop.
+ */
+ public void notifyOfJobStop(Specification spec, int stopReason)
+ throws ManifoldCFException, ServiceInterruption
+ {
+ notifyOfJobStop(spec);
+ }
+
/** Notify of job stop.
*@param spec is the notification specification.
*/
- @Override
public void notifyOfJobStop(Specification spec)
throws ManifoldCFException, ServiceInterruption
{
Modified: manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/JobResetThread.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/JobResetThread.java?rev=1683209&r1=1683208&r2=1683209&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/JobResetThread.java (original)
+++ manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/JobResetThread.java Wed Jun 3 01:49:55 2015
@@ -68,11 +68,12 @@ public class JobResetThread extends Thre
// See if there are any completed jobs
long currentTime = System.currentTimeMillis();
- ArrayList jobStops = new ArrayList();
- jobManager.finishJobStops(currentTime,jobStops);
- ArrayList jobResumes = new ArrayList();
+ List<IJobDescription> jobStops = new ArrayList<IJobDescription>();
+ List<Integer> jobStopNotifications = new ArrayList<Integer>();
+ jobManager.finishJobStops(currentTime,jobStops,jobStopNotifications);
+ List<IJobDescription> jobResumes = new ArrayList<IJobDescription>();
jobManager.finishJobResumes(currentTime,jobResumes);
- ArrayList jobCompletions = new ArrayList();
+ List<IJobDescription> jobCompletions = new ArrayList<IJobDescription>();
jobManager.resetJobs(currentTime,jobCompletions);
// If there were any job aborts, we must reprioritize all active documents, since we've done something
@@ -92,18 +93,20 @@ public class JobResetThread extends Thre
int k = 0;
while (k < jobStops.size())
{
- IJobDescription desc = (IJobDescription)jobStops.get(k++);
+ IJobDescription desc = jobStops.get(k);
+ Integer notificationType = jobStopNotifications.get(k);
connectionManager.recordHistory(desc.getConnectionName(),
null,connectionManager.ACTIVITY_JOBSTOP,null,
desc.getID().toString()+"("+desc.getDescription()+")",null,null,null);
// As a courtesy, call all the notification connections (if any)
- doStopNotifications(desc,notificationManager,notificationPool);
+ doStopNotifications(desc,notificationType,notificationManager,notificationPool);
+ k++;
}
k = 0;
while (k < jobResumes.size())
{
- IJobDescription desc = (IJobDescription)jobResumes.get(k++);
+ IJobDescription desc = jobResumes.get(k++);
connectionManager.recordHistory(desc.getConnectionName(),
null,connectionManager.ACTIVITY_JOBCONTINUE,null,
desc.getID().toString()+"("+desc.getDescription()+")",null,null,null);
@@ -112,7 +115,7 @@ public class JobResetThread extends Thre
k = 0;
while (k < jobCompletions.size())
{
- IJobDescription desc = (IJobDescription)jobCompletions.get(k++);
+ IJobDescription desc = jobCompletions.get(k++);
connectionManager.recordHistory(desc.getConnectionName(),
null,connectionManager.ACTIVITY_JOBEND,null,
desc.getID().toString()+"("+desc.getDescription()+")",null,null,null);
@@ -179,7 +182,7 @@ public class JobResetThread extends Thre
}
}
- protected static void doStopNotifications(IJobDescription jobDescription, INotificationConnectionManager notificationManager,
+ protected static void doStopNotifications(IJobDescription jobDescription, int notificationType, INotificationConnectionManager notificationManager,
INotificationConnectorPool notificationPool)
throws ManifoldCFException
{
@@ -196,7 +199,7 @@ public class JobResetThread extends Thre
{
try
{
- connector.notifyOfJobStop(jobDescription.getNotificationSpecification(j));
+ connector.notifyOfJobStop(jobDescription.getNotificationSpecification(j),notificationType);
}
finally
{
Modified: manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/JobStartThread.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/JobStartThread.java?rev=1683209&r1=1683208&r2=1683209&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/JobStartThread.java (original)
+++ manifoldcf/branches/dev_1x/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/JobStartThread.java Wed Jun 3 01:49:55 2015
@@ -68,25 +68,25 @@ public class JobStartThread extends Thre
if (Logging.threads.isDebugEnabled())
Logging.threads.debug("Job start thread - checking for jobs to start at "+new Long(currentTime).toString());
// Start any waiting jobs
- ArrayList unwaitJobs = new ArrayList();
+ List<Long> unwaitJobs = new ArrayList<Long>();
jobManager.startJobs(currentTime,unwaitJobs);
// Log these events in the event log
int k = 0;
while (k < unwaitJobs.size())
{
- Long jobID = (Long)unwaitJobs.get(k++);
+ Long jobID = unwaitJobs.get(k++);
IJobDescription desc = jobManager.load(jobID);
connectionManager.recordHistory(desc.getConnectionName(),
null,connectionManager.ACTIVITY_JOBUNWAIT,null,
desc.getID().toString()+"("+desc.getDescription()+")",null,null,null);
}
// Cause jobs out of window to stop.
- ArrayList waitJobs = new ArrayList();
+ List<Long> waitJobs = new ArrayList<Long>();
jobManager.waitJobs(currentTime,waitJobs);
k = 0;
while (k < waitJobs.size())
{
- Long jobID = (Long)waitJobs.get(k++);
+ Long jobID = waitJobs.get(k++);
IJobDescription desc = jobManager.load(jobID);
connectionManager.recordHistory(desc.getConnectionName(),
null,connectionManager.ACTIVITY_JOBWAIT,null,