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/04 12:32:01 UTC
svn commit: r1683506 - in
/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler:
interfaces/ jobs/ notifications/ system/
Author: kwright
Date: Thu Jun 4 10:32:00 2015
New Revision: 1683506
URL: http://svn.apache.org/r1683506
Log:
Rework INotificationConnector API again, to eliminate 'open' API methods and tie down what the connector actually does. Part of CONNECTORS-1208.
Modified:
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IJobManager.java
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/INotificationConnector.java
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/notifications/BaseNotificationConnector.java
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/JobResetThread.java
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IJobManager.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IJobManager.java?rev=1683506&r1=1683505&r2=1683506&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IJobManager.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IJobManager.java Thu Jun 4 10:32:00 2015
@@ -53,6 +53,13 @@ public interface IJobManager
public static final int DOCSTATUS_WAITINGFOREVER = 8;
public static final int DOCSTATUS_HOPCOUNTEXCEEDED = 9;
+ // Job stop reasons
+ public static final int STOP_ERRORABORT = 0;
+ public static final int STOP_MANUALABORT = 1;
+ public static final int STOP_MANUALPAUSE = 2;
+ public static final int STOP_SCHEDULEPAUSE = 3;
+ public static final int STOP_RESTART = 4;
+
/** Install the job manager's tables.
*/
public void install()
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/INotificationConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/INotificationConnector.java?rev=1683506&r1=1683505&r2=1683506&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/INotificationConnector.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/INotificationConnector.java Thu Jun 4 10:32:00 2015
@@ -48,13 +48,6 @@ 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
@@ -66,11 +59,34 @@ public interface INotificationConnector
public boolean requestInfo(Configuration output, String command)
throws ManifoldCFException;
- /** Notify of job stop
+ /** Notify of job stop due to error abort.
*@param spec is the notification specification.
- *@param stopReason is the reason for the stop.
*/
- public void notifyOfJobStop(Specification spec, int stopReason)
+ public void notifyOfJobStopErrorAbort(Specification spec)
+ throws ManifoldCFException, ServiceInterruption;
+
+ /** Notify of job stop due to manual abort.
+ *@param spec is the notification specification.
+ */
+ public void notifyOfJobStopManualAbort(Specification spec)
+ throws ManifoldCFException, ServiceInterruption;
+
+ /** Notify of job stop due to manual pause.
+ *@param spec is the notification specification.
+ */
+ public void notifyOfJobStopManualPause(Specification spec)
+ throws ManifoldCFException, ServiceInterruption;
+
+ /** Notify of job stop due to schedule pause.
+ *@param spec is the notification specification.
+ */
+ public void notifyOfJobStopSchedulePause(Specification spec)
+ throws ManifoldCFException, ServiceInterruption;
+
+ /** Notify of job stop due to restart.
+ *@param spec is the notification specification.
+ */
+ public void notifyOfJobStopRestart(Specification spec)
throws ManifoldCFException, ServiceInterruption;
/** Notify of job end
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java?rev=1683506&r1=1683505&r2=1683506&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java Thu Jun 4 10:32:00 2015
@@ -8288,18 +8288,18 @@ public class JobManager implements IJobM
{
case Jobs.STATUS_ABORTING:
case Jobs.STATUS_ABORTINGSHUTTINGDOWN:
- return noErrorText?INotificationConnector.STOP_MANUALABORT:INotificationConnector.STOP_ERRORABORT;
+ return noErrorText?STOP_MANUALABORT:STOP_ERRORABORT;
case Jobs.STATUS_ABORTINGFORRESTART:
case Jobs.STATUS_ABORTINGFORRESTARTMINIMAL:
- return INotificationConnector.STOP_RESTART;
+ return STOP_RESTART;
case Jobs.STATUS_PAUSING:
case Jobs.STATUS_PAUSINGSEEDING:
case Jobs.STATUS_PAUSINGWAITING:
case Jobs.STATUS_PAUSINGWAITINGSEEDING:
- return INotificationConnector.STOP_MANUALPAUSE;
+ return STOP_MANUALPAUSE;
case Jobs.STATUS_ACTIVEWAITING:
case Jobs.STATUS_ACTIVEWAITINGSEEDING:
- return INotificationConnector.STOP_SCHEDULEPAUSE;
+ return STOP_SCHEDULEPAUSE;
default:
throw new RuntimeException("Unexpected job status: "+jobStatus);
}
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/notifications/BaseNotificationConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/notifications/BaseNotificationConnector.java?rev=1683506&r1=1683505&r2=1683506&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/notifications/BaseNotificationConnector.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/notifications/BaseNotificationConnector.java Thu Jun 4 10:32:00 2015
@@ -64,11 +64,51 @@ public abstract class BaseNotificationCo
return false;
}
- /** Notify of job stop
+ /** Notify of job stop due to error abort.
*@param spec is the notification specification.
- *@param stopReason is the reason for the stop.
*/
- public void notifyOfJobStop(Specification spec, int stopReason)
+ @Override
+ public void notifyOfJobStopErrorAbort(Specification spec)
+ throws ManifoldCFException, ServiceInterruption
+ {
+ notifyOfJobStop(spec);
+ }
+
+ /** Notify of job stop due to manual abort.
+ *@param spec is the notification specification.
+ */
+ @Override
+ public void notifyOfJobStopManualAbort(Specification spec)
+ throws ManifoldCFException, ServiceInterruption
+ {
+ notifyOfJobStop(spec);
+ }
+
+ /** Notify of job stop due to manual pause.
+ *@param spec is the notification specification.
+ */
+ @Override
+ public void notifyOfJobStopManualPause(Specification spec)
+ throws ManifoldCFException, ServiceInterruption
+ {
+ notifyOfJobStop(spec);
+ }
+
+ /** Notify of job stop due to schedule pause.
+ *@param spec is the notification specification.
+ */
+ @Override
+ public void notifyOfJobStopSchedulePause(Specification spec)
+ throws ManifoldCFException, ServiceInterruption
+ {
+ notifyOfJobStop(spec);
+ }
+
+ /** Notify of job stop due to restart.
+ *@param spec is the notification specification.
+ */
+ @Override
+ public void notifyOfJobStopRestart(Specification spec)
throws ManifoldCFException, ServiceInterruption
{
notifyOfJobStop(spec);
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/JobResetThread.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/JobResetThread.java?rev=1683506&r1=1683505&r2=1683506&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/JobResetThread.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/JobResetThread.java Thu Jun 4 10:32:00 2015
@@ -199,7 +199,26 @@ public class JobResetThread extends Thre
{
try
{
- connector.notifyOfJobStop(jobDescription.getNotificationSpecification(j),notificationType);
+ switch (notificationType)
+ {
+ case IJobManager.STOP_ERRORABORT:
+ connector.notifyOfJobStopErrorAbort(jobDescription.getNotificationSpecification(j));
+ break;
+ case IJobManager.STOP_MANUALABORT:
+ connector.notifyOfJobStopManualAbort(jobDescription.getNotificationSpecification(j));
+ break;
+ case IJobManager.STOP_MANUALPAUSE:
+ connector.notifyOfJobStopManualPause(jobDescription.getNotificationSpecification(j));
+ break;
+ case IJobManager.STOP_SCHEDULEPAUSE:
+ connector.notifyOfJobStopSchedulePause(jobDescription.getNotificationSpecification(j));
+ break;
+ case IJobManager.STOP_RESTART:
+ connector.notifyOfJobStopRestart(jobDescription.getNotificationSpecification(j));
+ break;
+ default:
+ throw new RuntimeException("Unhandled notification type: "+notificationType);
+ }
}
finally
{