@@ -93,7 +93,7 @@ public void setBackendServerPort(int backendServerPort) {
93
93
}
94
94
95
95
public String getEIBackendSubscriptionAddress () {
96
- return "http://" + getBackendServerHost () + ":" + getBackendServerPort ();
96
+ return "http://" + this . getBackendServerHost () + ":" + this . getBackendServerPort ();
97
97
}
98
98
99
99
@@ -113,15 +113,15 @@ public ResponseEntity<String> getRequests(Model model, HttpServletRequest reques
113
113
HttpClient client = HttpClients .createDefault ();
114
114
HttpGet eiRequest = new HttpGet (newRequestUrl );
115
115
116
- String JsonContent = "" ;
116
+ String jsonContent = "" ;
117
117
HttpResponse eiResponse = null ;
118
118
try {
119
119
eiResponse = client .execute (eiRequest );
120
120
121
121
InputStream inStream = eiResponse .getEntity ().getContent ();
122
122
BufferedReader bufReader = new BufferedReader (new InputStreamReader (inStream , "UTF-8" ));
123
123
for (String line = bufReader .readLine (); line != null ; line = bufReader .readLine ()) {
124
- JsonContent += line ;
124
+ jsonContent += line ;
125
125
}
126
126
bufReader .close ();
127
127
inStream .close ();
@@ -130,17 +130,18 @@ public ResponseEntity<String> getRequests(Model model, HttpServletRequest reques
130
130
LOG .error ("Forward Request Errors: " + e );
131
131
}
132
132
133
- LOG .debug ("Http Status Code: " + eiResponse .getStatusLine ().getStatusCode ());
134
- LOG .debug ("Recevied JsonContent:\n " + JsonContent );
133
+ LOG .info ("EI Http Reponse Status Code: " + eiResponse .getStatusLine ().getStatusCode () +
134
+ "\n EI Recevied jsonContent:\n " + jsonContent +
135
+ "\n Forwarding response back to EI Frontend WebUI." );
135
136
136
- if (JsonContent .isEmpty ()) {
137
- JsonContent ="[]" ;
137
+ if (jsonContent .isEmpty ()) {
138
+ jsonContent ="[]" ;
138
139
}
139
140
140
141
HttpHeaders headers = new HttpHeaders ();
141
142
headers .setContentType (MediaType .APPLICATION_JSON );
142
143
143
- ResponseEntity <String > responseEntity = new ResponseEntity <>(JsonContent ,
144
+ ResponseEntity <String > responseEntity = new ResponseEntity <>(jsonContent ,
144
145
headers ,
145
146
HttpStatus .valueOf (eiResponse .getStatusLine ().getStatusCode ()));
146
147
return responseEntity ;
@@ -161,20 +162,20 @@ public ResponseEntity<String> postRequests(Model model, HttpServletRequest reque
161
162
LOG .info ("Got HTTP Request with method POST.\n UrlSuffix: " + eiBackendAddressSuffix +
162
163
"\n Forwarding Request to EI Backend with url: " + newRequestUrl );
163
164
164
- String inputReqJsonContent = "" ;
165
+ String inputReqjsonContent = "" ;
165
166
try {
166
167
BufferedReader inputBufReader = new BufferedReader (request .getReader ());
167
168
for (String line = inputBufReader .readLine (); line != null ; line = inputBufReader .readLine ()) {
168
- inputReqJsonContent += line ;
169
+ inputReqjsonContent += line ;
169
170
}
170
171
inputBufReader .close ();
171
172
}
172
173
catch (IOException e ) {
173
174
LOG .error ("Forward Request Errors: " + e );
174
175
}
175
176
176
- LOG .debug ("Input Request JSON Content to be forwarded:\n " + inputReqJsonContent );
177
- HttpEntity inputReqJsonEntity = new ByteArrayEntity (inputReqJsonContent .getBytes ());
177
+ LOG .debug ("Input Request JSON Content to be forwarded:\n " + inputReqjsonContent );
178
+ HttpEntity inputReqJsonEntity = new ByteArrayEntity (inputReqjsonContent .getBytes ());
178
179
179
180
180
181
HttpClient client = HttpClients .createDefault ();
@@ -183,15 +184,15 @@ public ResponseEntity<String> postRequests(Model model, HttpServletRequest reque
183
184
eiRequest .setHeader ("Content-type" , "application/json" );
184
185
185
186
186
- String JsonContent = "" ;
187
+ String jsonContent = "" ;
187
188
HttpResponse eiResponse = null ;
188
189
try {
189
190
eiResponse = client .execute (eiRequest );
190
191
191
192
InputStream inStream = eiResponse .getEntity ().getContent ();
192
193
BufferedReader bufReader = new BufferedReader (new InputStreamReader (inStream , "UTF-8" ));
193
194
for (String line = bufReader .readLine (); line != null ; line = bufReader .readLine ()) {
194
- JsonContent += line ;
195
+ jsonContent += line ;
195
196
}
196
197
bufReader .close ();
197
198
inStream .close ();
@@ -200,17 +201,18 @@ public ResponseEntity<String> postRequests(Model model, HttpServletRequest reque
200
201
LOG .error ("Forward Request Errors: " + e );
201
202
}
202
203
203
- LOG .debug ("Http Status Code: " + eiResponse .getStatusLine ().getStatusCode ());
204
- LOG .debug ("Recevied JsonContent: \n " + JsonContent );
204
+ LOG .info ("EI Http Reponse Status Code: " + eiResponse .getStatusLine ().getStatusCode () +
205
+ "\n EI Recevied jsonContent:\n " + jsonContent +
206
+ "\n Forwarding response back to EI Frontend WebUI." );
205
207
206
- if (JsonContent .isEmpty ()) {
207
- JsonContent ="[]" ;
208
+ if (jsonContent .isEmpty ()) {
209
+ jsonContent ="[]" ;
208
210
}
209
211
210
212
211
213
HttpHeaders headers = new HttpHeaders ();
212
214
headers .setContentType (MediaType .APPLICATION_JSON );
213
- ResponseEntity <String > responseEntity = new ResponseEntity <>(JsonContent ,
215
+ ResponseEntity <String > responseEntity = new ResponseEntity <>(jsonContent ,
214
216
headers ,
215
217
HttpStatus .valueOf (eiResponse .getStatusLine ().getStatusCode ()));
216
218
return responseEntity ;
@@ -229,20 +231,20 @@ public ResponseEntity<String> putRequests(Model model, HttpServletRequest reques
229
231
LOG .info ("Got HTTP Request with method PUT.\n UrlSuffix: " + eiBackendAddressSuffix +
230
232
"\n Forwarding Request to EI Backend with url: " + newRequestUrl );
231
233
232
- String inputReqJsonContent = "" ;
234
+ String inputReqjsonContent = "" ;
233
235
try {
234
236
BufferedReader inputBufReader = new BufferedReader (request .getReader ());
235
237
for (String line = inputBufReader .readLine (); line != null ; line = inputBufReader .readLine ()) {
236
- inputReqJsonContent += line ;
238
+ inputReqjsonContent += line ;
237
239
}
238
240
inputBufReader .close ();
239
241
}
240
242
catch (IOException e ) {
241
243
LOG .error ("Forward Request Errors: " + e );
242
244
}
243
245
244
- LOG .debug ("Input Request JSON Content to be forwarded:\n " + inputReqJsonContent );
245
- HttpEntity inputReqJsonEntity = new ByteArrayEntity (inputReqJsonContent .getBytes ());
246
+ LOG .debug ("Input Request JSON Content to be forwarded:\n " + inputReqjsonContent );
247
+ HttpEntity inputReqJsonEntity = new ByteArrayEntity (inputReqjsonContent .getBytes ());
246
248
247
249
248
250
HttpClient client = HttpClients .createDefault ();
@@ -251,15 +253,15 @@ public ResponseEntity<String> putRequests(Model model, HttpServletRequest reques
251
253
eiRequest .setHeader ("Content-type" , "application/json" );
252
254
253
255
254
- String JsonContent = "" ;
256
+ String jsonContent = "" ;
255
257
HttpResponse eiResponse = null ;
256
258
try {
257
259
eiResponse = client .execute (eiRequest );
258
260
259
261
InputStream inStream = eiResponse .getEntity ().getContent ();
260
262
BufferedReader bufReader = new BufferedReader (new InputStreamReader (inStream , "UTF-8" ));
261
263
for (String line = bufReader .readLine (); line != null ; line = bufReader .readLine ()) {
262
- JsonContent += line ;
264
+ jsonContent += line ;
263
265
}
264
266
bufReader .close ();
265
267
inStream .close ();
@@ -268,17 +270,18 @@ public ResponseEntity<String> putRequests(Model model, HttpServletRequest reques
268
270
LOG .error ("Forward Request Errors: " + e );
269
271
}
270
272
271
- LOG .debug ("Http Status Code: " + eiResponse .getStatusLine ().getStatusCode ());
272
- LOG .debug ("Recevied JsonContent:\n " + JsonContent );
273
+ LOG .info ("EI Http Reponse Status Code: " + eiResponse .getStatusLine ().getStatusCode () +
274
+ "\n EI Recevied jsonContent:\n " + jsonContent +
275
+ "\n Forwarding response back to EI Frontend WebUI." );
273
276
274
- if (JsonContent .isEmpty ()) {
275
- JsonContent ="[]" ;
277
+ if (jsonContent .isEmpty ()) {
278
+ jsonContent ="[]" ;
276
279
}
277
280
278
281
HttpHeaders headers = new HttpHeaders ();
279
282
headers .setContentType (MediaType .APPLICATION_JSON );
280
283
281
- ResponseEntity <String > responseEntity = new ResponseEntity <String >(JsonContent ,
284
+ ResponseEntity <String > responseEntity = new ResponseEntity <String >(jsonContent ,
282
285
headers ,
283
286
HttpStatus .valueOf (eiResponse .getStatusLine ().getStatusCode ()));
284
287
@@ -301,15 +304,15 @@ public ResponseEntity<String> deleteRequests(Model model, HttpServletRequest req
301
304
HttpClient client = HttpClients .createDefault ();
302
305
HttpDelete eiRequest = new HttpDelete (newRequestUrl );
303
306
304
- String JsonContent = "" ;
307
+ String jsonContent = "" ;
305
308
HttpResponse eiResponse = null ;
306
309
try {
307
310
eiResponse = client .execute (eiRequest );
308
311
309
312
InputStream inStream = eiResponse .getEntity ().getContent ();
310
313
BufferedReader bufReader = new BufferedReader (new InputStreamReader (inStream , "UTF-8" ));
311
314
for (String line = bufReader .readLine (); line != null ; line = bufReader .readLine ()) {
312
- JsonContent += line ;
315
+ jsonContent += line ;
313
316
}
314
317
bufReader .close ();
315
318
inStream .close ();
@@ -318,17 +321,18 @@ public ResponseEntity<String> deleteRequests(Model model, HttpServletRequest req
318
321
LOG .error ("Forward Request Errors: " + e );
319
322
}
320
323
321
- LOG .debug ("Http Status Code: " + eiResponse .getStatusLine ().getStatusCode ());
322
- LOG .debug ("Recevied JsonContent:\n " + JsonContent );
324
+ LOG .info ("EI Http Reponse Status Code: " + eiResponse .getStatusLine ().getStatusCode () +
325
+ "\n EI Recevied jsonContent:\n " + jsonContent +
326
+ "\n Forwarding response back to EI Frontend WebUI." );
323
327
324
- if (JsonContent .isEmpty ()) {
325
- JsonContent ="[]" ;
328
+ if (jsonContent .isEmpty ()) {
329
+ jsonContent ="[]" ;
326
330
}
327
331
328
332
HttpHeaders headers = new HttpHeaders ();
329
333
headers .setContentType (MediaType .APPLICATION_JSON );
330
334
331
- ResponseEntity <String > responseEntity = new ResponseEntity <>(JsonContent ,
335
+ ResponseEntity <String > responseEntity = new ResponseEntity <>(jsonContent ,
332
336
headers ,
333
337
HttpStatus .valueOf (eiResponse .getStatusLine ().getStatusCode ()));
334
338
return responseEntity ;
0 commit comments