Subversion Repositories XServices

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
70 brianR 1
/*
2
 *   Copyright 2011 Brian Rosenberger (Brutex Network)
3
 *
4
 *   Licensed under the Apache License, Version 2.0 (the "License");
5
 *   you may not use this file except in compliance with the License.
6
 *   You may obtain a copy of the License at
7
 *
8
 *       http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 *   Unless required by applicable law or agreed to in writing, software
11
 *   distributed under the License is distributed on an "AS IS" BASIS,
12
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 *   See the License for the specific language governing permissions and
14
 *   limitations under the License.
15
 */
16
 
17
package net.brutex.xservices.ws;
18
 
19
import java.util.List;
20
 
21
import javax.jws.WebMethod;
22
import javax.jws.WebParam;
23
import javax.jws.WebService;
24
import javax.xml.bind.annotation.XmlElement;
25
 
26
import net.brutex.xservices.types.ScheduledJob;
87 brianR 27
import net.brutex.xservices.types.SchedulerStatisticsType;
70 brianR 28
import net.brutex.xservices.util.BrutexNamespaces;
29
 
30
import org.apache.cxf.annotations.WSDLDocumentation;
31
 
32
/**
33
 * Job management services.
34
 * @author Brian Rosenberger
35
 * @since 0.5.0
36
 *
37
 */
38
@WebService(targetNamespace = BrutexNamespaces.WS_XSERVICES)
39
public interface JobService {
40
 
41
	public static final String SERVICE_NAME = "JobService";
42
	final String OPERATION_GETJOBLIST = "getJobs";
43
	final String OPERATION_SCHEDULEJOB = "scheduleJob";
44
	final String OPERATION_GETJOB = "getJob";
45
	final String OPERATION_DELETEJOB = "deleteJob";
87 brianR 46
	final String OPERATION_GETSTATISTICS = "getStatistics";
70 brianR 47
	final String PARAM_JOB = "job";
48
 
49
 
50
	/**
51
	 * Get a full list of all scheduled jobs.
52
	 *
53
	 * @return List of scheduled jobs
54
	 * @throws XServicesFault
55
	 */
56
	@WebMethod(operationName=OPERATION_GETJOBLIST)
57
	@WSDLDocumentation(value="Get list of scheduled jobs")
58
	public abstract List<ScheduledJob> getJobList() throws XServicesFault;
59
 
60
	/**
61
	 * Add a job to the scheduler.
62
	 *
63
	 * @param job
64
	 * @return The unique identifier of the job.
65
	 * @throws XServicesFault
66
	 */
67
	@WebMethod(operationName=OPERATION_SCHEDULEJOB)
68
	@WSDLDocumentation(value="Schedule a job")
69
	public abstract String scheduleJob(
70
			@WebParam(name=PARAM_JOB) @XmlElement(required=true) ScheduledJob job)
71
			throws XServicesFault;
72
 
73
	/**
74
	 * Get a job by id.
75
	 *
76
	 * @param uuid
77
	 * @return Job details
78
	 * @throws XServicesFault
79
	 */
80
	@WebMethod(operationName=OPERATION_GETJOB)
81
	@WSDLDocumentation(value="Get a job by id")
82
	public abstract ScheduledJob getJob(
83
			@WebParam(name="id") @XmlElement(required=true) String uuid) throws XServicesFault;
84
 
85
	/**
86
	 * Delete a job from scheduler.
87
	 *
88
	 * @param uuid Id of the job that should be deleted
89
	 * @throws XServicesFault
90
	 */
91
	@WebMethod(operationName=OPERATION_DELETEJOB)
92
	@WSDLDocumentation(value="Delete a scheduled job.")
93
	public abstract void deleteJob(
94
			@WebParam(name="id") @XmlElement(required=true) String uuid) throws XServicesFault;
95
 
87 brianR 96
	/**
97
	 * Get statisctis about the scheduler
98
	 * @throws XServicesFault
99
	 */
100
	@WebMethod(operationName=OPERATION_GETSTATISTICS)
101
	@WSDLDocumentation(value="Get scheduler statistics")
102
	public abstract SchedulerStatisticsType getStatistics() throws XServicesFault;
70 brianR 103
 
104
}