27
27
28
28
import de .bitzeche .video .transcoding .zencoder .util .XmlUtility ;
29
29
30
+ import java .util .Map ;
31
+
30
32
public class ZencoderNotification {
31
33
32
34
private String notificationString ;
33
35
private String format ;
36
+ private Map <String , String > headers ;
34
37
35
38
public ZencoderNotification (String notificationDestination ) {
36
39
this .notificationString = notificationDestination ;
@@ -45,6 +48,16 @@ public Element createXML(Document document) {
45
48
root .appendChild (nfNode );
46
49
}
47
50
51
+ if (this .headers != null ) {
52
+ Node headersNode = document .createElement ("headers" );
53
+ root .appendChild (headersNode );
54
+ for (Map .Entry <String , String > headerEntry : headers .entrySet ()) {
55
+ Node header = document .createElement (headerEntry .getKey ());
56
+ header .setTextContent (headerEntry .getValue ());
57
+ headersNode .appendChild (header );
58
+ }
59
+ }
60
+
48
61
Node urlNode = document .createElement ("url" );
49
62
urlNode .setTextContent (this .notificationString );
50
63
root .appendChild (urlNode );
@@ -60,6 +73,14 @@ public void setFormat(String format) {
60
73
this .format = format ;
61
74
}
62
75
76
+ public void setHeaders (Map <String , String > headers ) {
77
+ this .headers = headers ;
78
+ }
79
+
80
+ public Map <String , String > getHeaders () {
81
+ return headers ;
82
+ }
83
+
63
84
public String toString () {
64
85
Element elem ;
65
86
Document document ;
@@ -84,5 +105,4 @@ public String toString() {
84
105
}
85
106
return this .getClass ().getSimpleName ();
86
107
}
87
-
88
108
}
0 commit comments