@@ -47,7 +47,10 @@ public class ZencoderJob {
47
47
48
48
private List <ZencoderOutput > outputs = new ArrayList <ZencoderOutput >();
49
49
50
- public ZencoderJob (String inputPath ) {
50
+ private List <ZencoderNotification > notifications = new ArrayList <ZencoderNotification >();
51
+
52
+
53
+ public ZencoderJob (String inputPath ) {
51
54
this .inputPath = inputPath ;
52
55
}
53
56
@@ -97,6 +100,20 @@ public Document createXML() throws ParserConfigurationException {
97
100
privateNode .setTextContent ((this .isPrivate ? "1" : "0" ));
98
101
root .appendChild (privateNode );
99
102
103
+ // job notifications
104
+ // API Note: Job-level notifications are supported only since API V2
105
+ if (this .notifications .size () != 0 ) {
106
+ Element notifis = document .createElement ("notifications" );
107
+ notifis .setAttribute ("type" , "array" );
108
+ root .appendChild (notifis );
109
+ for (ZencoderNotification item : this .notifications ) {
110
+ Element notif = item .createXML (document );
111
+ if (notif != null ) {
112
+ notifis .appendChild (notif );
113
+ }
114
+ }
115
+ }
116
+
100
117
if (outputs .size () == 0 )
101
118
return document ;
102
119
@@ -150,7 +167,7 @@ public boolean isTest() {
150
167
return isTest ;
151
168
}
152
169
153
- public void setJobId (int id ) {
170
+ public void setJobId (int id ) {
154
171
JobId = id ;
155
172
}
156
173
@@ -173,4 +190,12 @@ public void setTest(boolean isTest) {
173
190
public void setPrivate (boolean isPrivate ) {
174
191
this .isPrivate = isPrivate ;
175
192
}
193
+
194
+ public void addNotification (ZencoderNotification item ) {
195
+ this .notifications .add (item );
196
+ }
197
+
198
+ public void deleteNotification (ZencoderNotification item ) {
199
+ this .notifications .remove (item );
200
+ }
176
201
}
0 commit comments