1
+ package impl
2
+
3
+ import com.sap.gateway.ip.core.customdev.util.Message
4
+
5
+ class MessageImpl implements Message {
6
+ Map properties = [:]
7
+ Map headers = [:]
8
+ def body = " "
9
+
10
+ void setAttachmentHeader (java.lang.String a , java.lang.String b , org.apache.camel.Attachment c ) {
11
+ throw new RuntimeException ()
12
+ }
13
+
14
+ long getBodySize () {
15
+ -1
16
+ }
17
+
18
+ void setAttachmentHeader (java.lang.String a , java.lang.String b , com.sap.gateway.ip.core.customdev.util.AttachmentWrapper c ) {
19
+ throw new RuntimeException ()
20
+ }
21
+
22
+ void addAttachmentHeader (java.lang.String a , java.lang.String b , com.sap.gateway.ip.core.customdev.util.AttachmentWrapper c ) {
23
+ throw new RuntimeException ()
24
+ }
25
+
26
+ void setAttachmentWrapperObjects (java.util.Map a ) {
27
+ throw new RuntimeException ()
28
+ }
29
+
30
+ java.lang.Object getHeader (java.lang.String a , java.lang.Class c ) {
31
+ throw new RuntimeException ()
32
+ }
33
+
34
+ long getAttachmentsSize () {
35
+ throw new RuntimeException ()
36
+ }
37
+
38
+ java.lang.String getAttachmentHeader (java.lang.String a , org.apache.camel.Attachment b ) {
39
+ throw new RuntimeException ()
40
+ }
41
+
42
+ void addAttachmentObject (java.lang.String a , org.apache.camel.Attachment b ) {
43
+ throw new RuntimeException ()
44
+ }
45
+
46
+ void setHeader (java.lang.String a , java.lang.Object b ) {
47
+ throw new RuntimeException ()
48
+ }
49
+
50
+ void removeAttachmentHeader (java.lang.String a , org.apache.camel.Attachment b ) {
51
+ throw new RuntimeException ()
52
+ }
53
+
54
+ void removeAttachmentHeader (java.lang.String a , com.sap.gateway.ip.core.customdev.util.AttachmentWrapper b ) {
55
+ throw new RuntimeException ()
56
+ }
57
+
58
+ void addAttachmentObject (java.lang.String a , com.sap.gateway.ip.core.customdev.util.AttachmentWrapper b ) {
59
+ throw new RuntimeException ()
60
+ }
61
+
62
+ java.util.Map getAttachmentObjects () {
63
+ throw new RuntimeException ()
64
+ }
65
+
66
+ java.util.Map getAttachmentWrapperObjects () {
67
+ throw new RuntimeException ()
68
+ }
69
+
70
+ void addAttachmentHeader (java.lang.String a , java.lang.String b , org.apache.camel.Attachment c ) {
71
+ throw new RuntimeException ()
72
+ }
73
+
74
+ java.lang.String getAttachmentHeader (java.lang.String a , com.sap.gateway.ip.core.customdev.util.AttachmentWrapper b ) {
75
+ throw new RuntimeException ()
76
+ }
77
+
78
+ void setAttachmentObjects (java.util.Map a ) {
79
+ throw new RuntimeException ()
80
+ }
81
+
82
+ java.util.Map getAttachments () {
83
+ throw new RuntimeException ()
84
+ }
85
+
86
+ java.lang.Object getBody (java.lang.Class clazz ) {
87
+ if (clazz == java.io.InputStream . class) {
88
+ InputStream stream = new ByteArrayInputStream (this . body. getBytes(" UTF-8" ));
89
+ return stream
90
+ } else if (clazz == java.lang.String . class) {
91
+ return body
92
+ } else {
93
+ throw new RuntimeException (" Unsupported class " + clazz)
94
+ }
95
+ }
96
+
97
+ void setAttachments (java.util.Map a ) {
98
+ throw new RuntimeException ()
99
+ }
100
+
101
+ @Override
102
+ String toString () {
103
+ def result = " MessageImpl\n "
104
+ result + = " Properties\n "
105
+ properties. each {
106
+ result + = " - ${ it.key} -> ${ it.value} \n "
107
+ }
108
+ result + = " Headers\n "
109
+ headers. each {
110
+ result + = " - ${ it.key} -> ${ it.value} \n "
111
+ }
112
+ result + = " >>> Body\n "
113
+ result + = " ${ body} \n "
114
+ result + = " <<< Body\n "
115
+ }
116
+ }
0 commit comments