aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/resources/clds/camel/routes/policy-flows.xml
blob: ce24b27ce1c7879f7454c83929b79c833d4979ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
<routes xmlns="http://camel.apache.org/schema/spring">
		<route id="verify-one-policy">
				<from uri="direct:verify-one-policy"/>
				<setProperty propertyName="raiseHttpExceptionFlag">
						<simple resultType="java.lang.Boolean">false</simple>
				</setProperty>
				<to uri="direct:get-policy"/>
				<when>
						<simple> ${header.CamelHttpResponseCode} != 200 </simple>
						<setProperty propertyName="policyFound">
								<simple resultType="java.lang.Boolean">false</simple>
						</setProperty>
						<log loggingLevel="WARN"
								message="At least one policy has not been found on policy engine: ${exchangeProperty[policyName]}"/>
				</when>
				<setProperty propertyName="raiseHttpExceptionFlag">
						<simple resultType="java.lang.Boolean">false</simple>
				</setProperty>
				<to uri="direct:get-deployment-policy"/>
				<when>
						<simple> ${header.CamelHttpResponseCode} != 200 </simple>
						<setProperty propertyName="policyDeployed">
								<simple resultType="java.lang.Boolean">false</simple>
						</setProperty>
						<log loggingLevel="WARN"
								message="At least one policy has not been deployed on policy engine: ${exchangeProperty[policyName]}"/>
				</when>
				<setProperty propertyName="newPolicyState">
						<simple>${exchangeProperty[policyComponent].computeState(*)}</simple>
				</setProperty>
		</route>

		<route id="get-policy">
				<from uri="direct:get-policy"/>
				<doTry>
						<log loggingLevel="INFO"
								message="Getting Policy: ${exchangeProperty[policyName]}"/>
						<to
								uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Get Policy')"/>
						<setHeader headerName="CamelHttpMethod">
								<constant>GET</constant>
						</setHeader>
						<setHeader headerName="X-ONAP-RequestID">
								<simple>${exchangeProperty[X-ONAP-RequestID]}
								</simple>
						</setHeader>
						<setHeader headerName="X-ONAP-InvocationID">
								<simple>${exchangeProperty[X-ONAP-InvocationID]}
								</simple>
						</setHeader>
						<setHeader headerName="X-ONAP-PartnerName">
								<simple>${exchangeProperty[X-ONAP-PartnerName]}
								</simple>
						</setHeader>
						<log loggingLevel="INFO"
								message="Endpoint to get policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[policyType]}/versions/1.0.0/policies/${exchangeProperty[policyName]}/versions/${exchangeProperty[policyVersion]}"></log>
						<toD
								uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[policyType]}/versions/1.0.0/policies/${exchangeProperty[policyName]}/versions/${exchangeProperty[policyVersion]}?bridgeEndpoint=true&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;authMethod=Basic&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true"/>
						<doFinally>
								<to uri="direct:reset-raise-http-exception-flag"/>
								<to
										uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/>
								<setProperty propertyName="logMessage">
										<simple>${exchangeProperty[policyName]} GET
												Policy status
										</simple>
								</setProperty>
								<setProperty propertyName="logComponent">
										<simple>POLICY</simple>
								</setProperty>
								<to uri="direct:dump-loop-log-http-response"/>
						</doFinally>
				</doTry>
		</route>

		<route id="get-deployment-policy">
				<from uri="direct:get-deployment-policy"/>
				<doTry>
						<log loggingLevel="INFO"
								message="Getting the policy deployment in PDP: ${exchangeProperty[policyName]}"/>
						<to
								uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Getting the policy deployment in PDP')"/>
						<setHeader headerName="CamelHttpMethod">
								<constant>GET</constant>
						</setHeader>
						<setHeader headerName="X-ONAP-RequestID">
								<simple>${exchangeProperty[X-ONAP-RequestID]}
								</simple>
						</setHeader>
						<setHeader headerName="X-ONAP-InvocationID">
								<simple>${exchangeProperty[X-ONAP-InvocationID]}
								</simple>
						</setHeader>
						<setHeader headerName="X-ONAP-PartnerName">
								<simple>${exchangeProperty[X-ONAP-PartnerName]}
								</simple>
						</setHeader>
						<log loggingLevel="INFO"
								message="Endpoint to get policy deployment status: {{clamp.config.policy.pap.url}}/policy/pap/v1/policies/deployed/${exchangeProperty[policyName]}/1.0.0"></log>
						<toD
								uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/policies/deployed/${exchangeProperty[policyName]}/1.0.0?bridgeEndpoint=true&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;authMethod=Basic&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true"/>
						<doFinally>
								<to uri="direct:reset-raise-http-exception-flag"/>
								<to
										uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/>
								<setProperty propertyName="logMessage">
										<simple>${exchangeProperty[policyName]} GET Policy deployment
												status
										</simple>
								</setProperty>
								<setProperty propertyName="logComponent">
										<simple>POLICY</simple>
								</setProperty>
								<to uri="direct:dump-loop-log-http-response"/>
						</doFinally>
				</doTry>
		</route>
		<route id="get-all-policy-models">
				<from uri="direct:get-all-policy-models"/>
				<doTry>
						<log loggingLevel="INFO" message="Getting all the policy models"/>
						<to
								uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Getting all the policy models')"/>
						<setHeader headerName="CamelHttpMethod">
								<constant>GET</constant>
						</setHeader>
						<setHeader headerName="X-ONAP-RequestID">
								<simple>${exchangeProperty[X-ONAP-RequestID]}
								</simple>
						</setHeader>
						<setHeader headerName="X-ONAP-InvocationID">
								<simple>${exchangeProperty[X-ONAP-InvocationID]}
								</simple>
						</setHeader>
						<setHeader headerName="X-ONAP-PartnerName">
								<simple>${exchangeProperty[X-ONAP-PartnerName]}
								</simple>
						</setHeader>
						<log loggingLevel="INFO"
								message="Endpoint to get all policy models: {{clamp.config.policy.pap.url}}/policy/api/v1/policytypes"></log>
						<toD
								uri="{{clamp.config.policy.pap.url}}/policy/api/v1/policytypes?bridgeEndpoint=true&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;authMethod=Basic&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true"/>
						<convertBodyTo type="java.lang.String"/>		
						<doFinally>
								<to uri="direct:reset-raise-http-exception-flag"/>
								<to
										uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/>
						</doFinally>
				</doTry>
		</route>
		<route id="get-policy-model">
				<from uri="direct:get-policy-model"/>
				<doTry>
						<log loggingLevel="INFO"
								message="Getting the policy model: ${exchangeProperty[policyModelName]}/${exchangeProperty[policyModelVersion]}"/>
						<to
								uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Getting the policy model')"/>
						<setHeader headerName="CamelHttpMethod">
								<constant>GET</constant>
						</setHeader>
						<setHeader headerName="X-ONAP-RequestID">
								<simple>${exchangeProperty[X-ONAP-RequestID]}
								</simple>
						</setHeader>
						<setHeader headerName="X-ONAP-InvocationID">
								<simple>${exchangeProperty[X-ONAP-InvocationID]}
								</simple>
						</setHeader>
						<setHeader headerName="X-ONAP-PartnerName">
								<simple>${exchangeProperty[X-ONAP-PartnerName]}
								</simple>
						</setHeader>
						<log loggingLevel="INFO"
								message="Endpoint to get policy model: {{clamp.config.policy.pap.url}}/policy/api/v1/policytypes/${exchangeProperty[policyModelName]}/versions/${exchangeProperty[policyModelVersion]}"></log>
						<toD
								uri="{{clamp.config.policy.pap.url}}/policy/api/v1/policytypes/${exchangeProperty[policyModelName]}/versions/${exchangeProperty[policyModelVersion]}?bridgeEndpoint=true&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;authMethod=Basic&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true"/>
					    <convertBodyTo type="java.lang.String"/>
						<doFinally>
								<to uri="direct:reset-raise-http-exception-flag"/>
								<to
										uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/>
						</doFinally>
				</doTry>
		</route>
		<route id="create-micro-service-policy">
				<from uri="direct:create-micro-service-policy"/>
				<doTry>
						<log loggingLevel="INFO"
								message="Creating Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}"/>
						<to
								uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Create Micro Service Policy')"/>
						<setBody>
								<simple>${exchangeProperty[microServicePolicy].createPolicyPayload()}
								</simple>
						</setBody>
						<setHeader headerName="CamelHttpMethod">
								<constant>POST</constant>
						</setHeader>
						<setHeader headerName="Content-Type">
								<constant>application/json</constant>
						</setHeader>
						<setHeader headerName="X-ONAP-RequestID">
								<simple>${exchangeProperty[X-ONAP-RequestID]}
								</simple>
						</setHeader>
						<setHeader headerName="X-ONAP-InvocationID">
								<simple>${exchangeProperty[X-ONAP-InvocationID]}
								</simple>
						</setHeader>
						<setHeader headerName="X-ONAP-PartnerName">
								<simple>${exchangeProperty[X-ONAP-PartnerName]}
								</simple>
						</setHeader>
						<log loggingLevel="INFO"
								message="Endpoint to create microservice policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies"></log>
						<toD
								uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true"/>
						<doFinally>
								<to uri="direct:reset-raise-http-exception-flag"/>
								<to
										uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/>
								<setProperty propertyName="logMessage">
										<simple>${exchangeProperty[microServicePolicy].getName()} creation
												status
										</simple>
								</setProperty>
								<setProperty propertyName="logComponent">
										<simple>POLICY</simple>
								</setProperty>
								<to uri="direct:dump-loop-log-http-response"/>
						</doFinally>
				</doTry>
		</route>

		<route id="delete-micro-service-policy">
				<from uri="direct:delete-micro-service-policy"/>
				<doTry>
						<log loggingLevel="INFO"
								message="Deleting Micro Service Policy: ${exchangeProperty[microServicePolicy].getName()}"/>
						<to
								uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Delete Micro Service Policy')"/>
						<setBody>
								<constant>null</constant>
						</setBody>
						<setHeader headerName="CamelHttpMethod">
								<constant>DELETE</constant>
						</setHeader>
						<setHeader headerName="X-ONAP-RequestID">
								<simple>${exchangeProperty[X-ONAP-RequestID]}
								</simple>
						</setHeader>
						<setHeader headerName="X-ONAP-InvocationID">
								<simple>${exchangeProperty[X-ONAP-InvocationID]}
								</simple>
						</setHeader>
						<setHeader headerName="X-ONAP-PartnerName">
								<simple>${exchangeProperty[X-ONAP-PartnerName]}
								</simple>
						</setHeader>
						<log loggingLevel="INFO"
								message="Endpoint to delete microservice policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies/${exchangeProperty[microServicePolicy].getName()}/versions/1.0.0"></log>
						<toD
								uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies/${exchangeProperty[microServicePolicy].getName()}/versions/1.0.0?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true"/>

						<doFinally>
								<to uri="direct:reset-raise-http-exception-flag"/>
								<to
										uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/>
								<setProperty propertyName="logMessage">
										<simple>${exchangeProperty[microServicePolicy].getName()} removal
												status
										</simple>
								</setProperty>
								<setProperty propertyName="logComponent">
										<simple>POLICY</simple>
								</setProperty>
								<to uri="direct:dump-loop-log-http-response"/>
						</doFinally>
				</doTry>
		</route>

		<route id="create-operational-policy">
				<from uri="direct:create-operational-policy"/>
				<doTry>
						<log loggingLevel="INFO"
								message="Creating Operational Policy: ${exchangeProperty[operationalPolicy].getName()}"/>
						<to
								uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Create Operational Policy')"/>
						<setBody>
								<simple>${exchangeProperty[operationalPolicy].createPolicyPayload()}
								</simple>
						</setBody>
						<setHeader headerName="CamelHttpMethod">
								<constant>POST</constant>
						</setHeader>
						<setHeader headerName="Content-Type">
								<constant>application/json</constant>
						</setHeader>
						<setHeader headerName="X-ONAP-RequestID">
								<simple>${exchangeProperty[X-ONAP-RequestID]}
								</simple>
						</setHeader>
						<setHeader headerName="X-ONAP-InvocationID">
								<simple>${exchangeProperty[X-ONAP-InvocationID]}
								</simple>
						</setHeader>
						<setHeader headerName="X-ONAP-PartnerName">
								<simple>${exchangeProperty[X-ONAP-PartnerName]}
								</simple>
						</setHeader>
						<log loggingLevel="INFO"
								message="Endpoint to create operational policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies"></log>
						<toD
								uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true"/>
						<doFinally>
								<to uri="direct:reset-raise-http-exception-flag"/>
								<to
										uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/>
								<setProperty propertyName="logMessage">
										<simple>${exchangeProperty[operationalPolicy].getName()} creation
												status
										</simple>
								</setProperty>
								<setProperty propertyName="logComponent">
										<simple>POLICY</simple>
								</setProperty>
								<to uri="direct:dump-loop-log-http-response"/>
						</doFinally>
				</doTry>
		</route>

		<route id="delete-operational-policy">
				<from uri="direct:delete-operational-policy"/>
				<doTry>
						<log loggingLevel="INFO"
								message="Deleting Operational Policy: ${exchangeProperty[operationalPolicy].getName()}"/>
						<to
								uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Delete Operational Policy')"/>
						<setBody>
								<constant>null</constant>
						</setBody>
						<setHeader headerName="CamelHttpMethod">
								<constant>DELETE</constant>
						</setHeader>
						<setHeader headerName="X-ONAP-RequestID">
								<simple>${exchangeProperty[X-ONAP-RequestID]}
								</simple>
						</setHeader>
						<setHeader headerName="X-ONAP-InvocationID">
								<simple>${exchangeProperty[X-ONAP-InvocationID]}
								</simple>
						</setHeader>
						<setHeader headerName="X-ONAP-PartnerName">
								<simple>${exchangeProperty[X-ONAP-PartnerName]}
								</simple>
						</setHeader>
						<log loggingLevel="INFO"
								message="Endpoint to delete operational policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies/${exchangeProperty[operationalPolicy].getName()}/versions/1"></log>
						<toD
								uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies/${exchangeProperty[operationalPolicy].getName()}/versions/1?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true"/>
						<doFinally>
								<to uri="direct:reset-raise-http-exception-flag"/>
								<to
										uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/>
								<setProperty propertyName="logMessage">
										<simple>${exchangeProperty[operationalPolicy].getName()} removal
												status
										</simple>
								</setProperty>
								<setProperty propertyName="logComponent">
										<simple>POLICY</simple>
								</setProperty>
								<to uri="direct:dump-loop-log-http-response"/>
						</doFinally>
				</doTry>
		</route>

		<route id="create-guard-policy">
				<from uri="direct:create-guard-policy"/>
				<doTry>
						<log loggingLevel="INFO"
								message="Creating Guard Policy: ${exchangeProperty[guardPolicy].getKey()}"/>
						<to
								uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Create Guard Policy')"/>
						<setBody>
								<simple>${exchangeProperty[guardPolicy].getValue()}
								</simple>
						</setBody>
						<setHeader headerName="CamelHttpMethod">
								<constant>POST</constant>
						</setHeader>
						<setHeader headerName="Content-Type">
								<constant>application/json</constant>
						</setHeader>
						<setHeader headerName="X-ONAP-RequestID">
								<simple>${exchangeProperty[X-ONAP-RequestID]}
								</simple>
						</setHeader>
						<setHeader headerName="X-ONAP-InvocationID">
								<simple>${exchangeProperty[X-ONAP-InvocationID]}
								</simple>
						</setHeader>
						<setHeader headerName="X-ONAP-PartnerName">
								<simple>${exchangeProperty[X-ONAP-PartnerName]}
								</simple>
						</setHeader>
						<log loggingLevel="INFO"
								message="Endpoint to create guard policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Guard/versions/1.0.0/policies"></log>
						<toD
								uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Guard/versions/1.0.0/policies?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true"/>
						<doFinally>
								<to uri="direct:reset-raise-http-exception-flag"/>
								<to
										uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/>
								<setProperty propertyName="logMessage">
										<simple>${exchangeProperty[guardPolicy].getKey()} creation status
										</simple>
								</setProperty>
								<setProperty propertyName="logComponent">
										<simple>POLICY</simple>
								</setProperty>
								<to uri="direct:dump-loop-log-http-response"/>
						</doFinally>
				</doTry>
		</route>

		<route id="delete-guard-policy">
				<from uri="direct:delete-guard-policy"/>
				<doTry>
						<log loggingLevel="INFO"
								message="Deleting Guard Policy: ${exchangeProperty[guardPolicy].getKey()}"/>
						<to
								uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Delete Guard Policy')"/>
						<setBody>
								<constant>null</constant>
						</setBody>
						<setHeader headerName="CamelHttpMethod">
								<constant>DELETE</constant>
						</setHeader>
						<setHeader headerName="X-ONAP-RequestID">
								<simple>${exchangeProperty[X-ONAP-RequestID]}
								</simple>
						</setHeader>
						<setHeader headerName="X-ONAP-InvocationID">
								<simple>${exchangeProperty[X-ONAP-InvocationID]}
								</simple>
						</setHeader>
						<setHeader headerName="X-ONAP-PartnerName">
								<simple>${exchangeProperty[X-ONAP-PartnerName]}
								</simple>
						</setHeader>
						<log loggingLevel="INFO"
								message="Endpoint to delete guard policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Guard/versions/1.0.0/policies/${exchangeProperty[guardPolicy].getKey()}/versions/1"></log>
						<toD
								uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Guard/versions/1.0.0/policies/${exchangeProperty[guardPolicy].getKey()}/versions/1?bridgeEndpoint=true&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true"/>

						<doFinally>
								<to uri="direct:reset-raise-http-exception-flag"/>
								<to
										uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/>
								<setProperty propertyName="logMessage">
										<simple>${exchangeProperty[guardPolicy].getKey()} removal status
										</simple>
								</setProperty>
								<setProperty propertyName="logComponent">
										<simple>POLICY</simple>
								</setProperty>
								<to uri="direct:dump-loop-log-http-response"/>
						</doFinally>
				</doTry>
		</route>

		<route id="add-all-to-active-pdp-group">
				<from uri="direct:add-all-to-active-pdp-group"/>
				<doTry>
						<log loggingLevel="INFO"
								message="Adding loop policies to PDP Group: ${exchangeProperty[loopObject].getName()}"/>
						<to
								uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Add policies to PDP group')"/>
						<setBody>
								<simple>${exchangeProperty[loopObject].getComponent("POLICY").createPoliciesPayloadPdpGroup(exchangeProperty[loopObject])}
								</simple>
						</setBody>
						<setHeader headerName="CamelHttpMethod">
								<constant>POST</constant>
						</setHeader>
						<setHeader headerName="Content-Type">
								<constant>application/json</constant>
						</setHeader>
						<setHeader headerName="X-ONAP-RequestID">
								<simple>${exchangeProperty[X-ONAP-RequestID]}
								</simple>
						</setHeader>
						<setHeader headerName="X-ONAP-InvocationID">
								<simple>${exchangeProperty[X-ONAP-InvocationID]}
								</simple>
						</setHeader>
						<setHeader headerName="X-ONAP-PartnerName">
								<simple>${exchangeProperty[X-ONAP-PartnerName]}
								</simple>
						</setHeader>
						<log loggingLevel="INFO"
								message="Endpoint to add policies to PDP Group: {{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/policies"></log>
						<toD
								uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/policies?bridgeEndpoint=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;useSystemProperties=true&amp;authUsername={{clamp.config.policy.pap.userName}}&amp;authPassword={{clamp.config.policy.pap.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true"/>

						<doFinally>
								<to uri="direct:reset-raise-http-exception-flag"/>
								<to
										uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/>
								<setProperty propertyName="logMessage">
										<simple>PDP Group push ALL status</simple>
								</setProperty>
								<setProperty propertyName="logComponent">
										<simple>POLICY</simple>
								</setProperty>
								<to uri="direct:dump-loop-log-http-response"/>
						</doFinally>
				</doTry>
		</route>

		<route id="remove-all-policy-from-active-pdp-group">
				<from uri="direct:remove-all-policy-from-active-pdp-group"/>
				<doTry>
						<log loggingLevel="INFO"
								message="Removing policies from active PDP group for loop: ${exchangeProperty[loopObject].getName()}"/>
						<to
								uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Removing policies PDP group')"/>
						<split>
								<simple>${exchangeProperty[loopObject].getComponent("POLICY").listPolicyNamesPdpGroup(exchangeProperty[loopObject])}
								</simple>
								<setProperty propertyName="policyName">
										<simple>${body}</simple>
								</setProperty>
								<setBody>
										<constant>null</constant>
								</setBody>
								<setHeader headerName="CamelHttpMethod">
										<constant>DELETE</constant>
								</setHeader>
								<setHeader headerName="X-ONAP-RequestID">
										<simple>${exchangeProperty[X-ONAP-RequestID]}
										</simple>
								</setHeader>
								<setHeader headerName="X-ONAP-InvocationID">
										<simple>${exchangeProperty[X-ONAP-InvocationID]}
										</simple>
								</setHeader>
								<setHeader headerName="X-ONAP-PartnerName">
										<simple>${exchangeProperty[X-ONAP-PartnerName]}
										</simple>
								</setHeader>
								<log loggingLevel="INFO"
										message="Endpoint to delete policy from PDP Group: {{clamp.config.policy.pap.url}}/pdps/policies/${exchangeProperty[policyName]}/versions/1.0.0"></log>
								<toD
										uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/policies/${exchangeProperty[policyName]}/versions/1.0.0?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;authUsername={{clamp.config.policy.pap.userName}}&amp;authPassword={{clamp.config.policy.pap.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=20000&amp;authenticationPreemptive=true&amp;connectionClose=true"/>
								<setProperty propertyName="logMessage">
										<simple>${exchangeProperty[policyName]} PDP Group removal status
										</simple>
								</setProperty>
								<setProperty propertyName="logComponent">
										<simple>POLICY</simple>
								</setProperty>
								<to uri="direct:dump-loop-log-http-response"/>
						</split>
						<doCatch>
								<exception>java.lang.Exception</exception>
								<handled>
										<constant>false</constant>
								</handled>
								<setProperty propertyName="logMessage">
										<simple>PDP Group removal, Error reported: ${exception}</simple>
								</setProperty>
								<setProperty propertyName="logComponent">
										<simple>POLICY</simple>
								</setProperty>
								<to uri="direct:dump-loop-log-http-response"/>
						</doCatch>
						<doFinally>
								<to uri="direct:reset-raise-http-exception-flag"/>
								<to
										uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/>
						</doFinally>
				</doTry>
		</route>
</routes>