1 /*
2 * #%L
3 * Bitrepository Integrity Client
4 *
5 * $Id$
6 * $HeadURL$
7 * %%
8 * Copyright (C) 2010 - 2011 The State and University Library, The Royal Library and The State Archives, Denmark
9 * %%
10 * This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU Lesser General Public License as
12 * published by the Free Software Foundation, either version 2.1 of the
13 * License, or (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Lesser Public License for more details.
19 *
20 * You should have received a copy of the GNU General Lesser Public
21 * License along with this program. If not, see
22 * <http://www.gnu.org/licenses/lgpl-2.1.html>.
23 * #L%
24 */
25 package org.bitrepository.service.workflow;
26
27
28 /**
29 * Interface for defining a SchedulableJob.
30 * A SchedulableJob performs a given task for the respective service.
31 */
32 public interface SchedulableJob {
33 /** The default state when the workflow is not running.*/
34 String NOT_RUNNING = "The job is currently not running.";
35
36 /**
37 * Start the SchedulableJob.
38 */
39 void start();
40
41 /**
42 * @return A human readable text telling the current state of the SchedulableJob.
43 */
44 String currentState();
45
46 /**
47 * @return Provides a human readable description of the SchedulableJob.
48 */
49 String getDescription();
50
51 /**
52 * @return Provides an ID to identify the SchedulableJob on
53 */
54 JobID getJobID();
55
56 /**
57 * Initializes a SchedulableJob with a context and a collection to run the SchedulableJob on.
58 */
59 void initialise(WorkflowContext context, String collectionID);
60 }