1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package com.commsen.jwebthumb;
21
22 import java.util.LinkedList;
23 import java.util.List;
24
25 import org.simpleframework.xml.ElementList;
26
27 /***
28 * This class represents the payload of webthumb's 'status' API call. See <a
29 * href="http://webthumb.bluga.net/apidoc#status">http://webthumb.bluga.net/apidoc#status</a> for
30 * details
31 *
32 * @author <a href="mailto:MilenDyankov@gmail.com">Milen Dyankov</a>
33 * @since 0.3
34 */
35 public class WebThumbStatusRequest {
36
37 @ElementList(required = false, inline = true, entry = "url")
38 private List<String> urls = null;
39
40 @ElementList(required = false, inline = true, entry = "job")
41 private List<String> jobs = null;
42
43
44 /***
45 * Adds new URL to the request list
46 *
47 * @param url the URL to add
48 */
49 public void addUrl(String url) {
50 if (url == null) throw new IllegalArgumentException("url can not be null");
51 if (urls == null) urls = new LinkedList<String>();
52 urls.add(url);
53 }
54
55
56 /***
57 * Adds new job id to the request list
58 *
59 * @param url the job id to add
60 */
61 public void addJob(String job) {
62 if (job == null) throw new IllegalArgumentException("job can not be null");
63 if (jobs == null) jobs = new LinkedList<String>();
64 jobs.add(job);
65 }
66 }