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;
|
|
|
27 |
import net.brutex.xservices.util.BrutexNamespaces;
|
|
|
28 |
|
|
|
29 |
import org.apache.cxf.annotations.WSDLDocumentation;
|
|
|
30 |
|
|
|
31 |
/**
|
|
|
32 |
* Job management services.
|
|
|
33 |
* @author Brian Rosenberger
|
|
|
34 |
* @since 0.5.0
|
|
|
35 |
*
|
|
|
36 |
*/
|
|
|
37 |
@WebService(targetNamespace = BrutexNamespaces.WS_XSERVICES)
|
|
|
38 |
public interface JobService {
|
|
|
39 |
|
|
|
40 |
public static final String SERVICE_NAME = "JobService";
|
|
|
41 |
final String OPERATION_GETJOBLIST = "getJobs";
|
|
|
42 |
final String OPERATION_SCHEDULEJOB = "scheduleJob";
|
|
|
43 |
final String OPERATION_GETJOB = "getJob";
|
|
|
44 |
final String OPERATION_DELETEJOB = "deleteJob";
|
|
|
45 |
|
|
|
46 |
final String PARAM_JOB = "job";
|
|
|
47 |
|
|
|
48 |
|
|
|
49 |
/**
|
|
|
50 |
* Get a full list of all scheduled jobs.
|
|
|
51 |
*
|
|
|
52 |
* @return List of scheduled jobs
|
|
|
53 |
* @throws XServicesFault
|
|
|
54 |
*/
|
|
|
55 |
@WebMethod(operationName=OPERATION_GETJOBLIST)
|
|
|
56 |
@WSDLDocumentation(value="Get list of scheduled jobs")
|
|
|
57 |
public abstract List<ScheduledJob> getJobList() throws XServicesFault;
|
|
|
58 |
|
|
|
59 |
/**
|
|
|
60 |
* Add a job to the scheduler.
|
|
|
61 |
*
|
|
|
62 |
* @param job
|
|
|
63 |
* @return The unique identifier of the job.
|
|
|
64 |
* @throws XServicesFault
|
|
|
65 |
*/
|
|
|
66 |
@WebMethod(operationName=OPERATION_SCHEDULEJOB)
|
|
|
67 |
@WSDLDocumentation(value="Schedule a job")
|
|
|
68 |
public abstract String scheduleJob(
|
|
|
69 |
@WebParam(name=PARAM_JOB) @XmlElement(required=true) ScheduledJob job)
|
|
|
70 |
throws XServicesFault;
|
|
|
71 |
|
|
|
72 |
/**
|
|
|
73 |
* Get a job by id.
|
|
|
74 |
*
|
|
|
75 |
* @param uuid
|
|
|
76 |
* @return Job details
|
|
|
77 |
* @throws XServicesFault
|
|
|
78 |
*/
|
|
|
79 |
@WebMethod(operationName=OPERATION_GETJOB)
|
|
|
80 |
@WSDLDocumentation(value="Get a job by id")
|
|
|
81 |
public abstract ScheduledJob getJob(
|
|
|
82 |
@WebParam(name="id") @XmlElement(required=true) String uuid) throws XServicesFault;
|
|
|
83 |
|
|
|
84 |
/**
|
|
|
85 |
* Delete a job from scheduler.
|
|
|
86 |
*
|
|
|
87 |
* @param uuid Id of the job that should be deleted
|
|
|
88 |
* @throws XServicesFault
|
|
|
89 |
*/
|
|
|
90 |
@WebMethod(operationName=OPERATION_DELETEJOB)
|
|
|
91 |
@WSDLDocumentation(value="Delete a scheduled job.")
|
|
|
92 |
public abstract void deleteJob(
|
|
|
93 |
@WebParam(name="id") @XmlElement(required=true) String uuid) throws XServicesFault;
|
|
|
94 |
|
|
|
95 |
|
|
|
96 |
|
|
|
97 |
}
|