Determe, Sebastien (sd378r) | 7c08374 | 2018-02-14 15:31:55 +0100 | [diff] [blame] | 1 | <routes xmlns="http://camel.apache.org/schema/spring"> |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 2 | <route id="submit"> |
| 3 | <from uri="direct:processSubmit" /> |
| 4 | <choice> |
| 5 | <when> |
| 6 | <simple> ${exchangeProperty.actionCd} == 'SUBMIT' || |
| 7 | ${exchangeProperty.actionCd} == 'RESUBMIT' |
| 8 | </simple> |
| 9 | <to |
| 10 | uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'INITIATED')" /> |
| 11 | <to uri="bean:org.onap.clamp.clds.client.TcaPolicyDelegate" /> |
| 12 | <to uri="bean:org.onap.clamp.clds.client.HolmesPolicyDelegate" /> |
| 13 | <delay> |
| 14 | <constant>30000</constant> |
| 15 | </delay> |
| 16 | <to |
| 17 | uri="bean:org.onap.clamp.clds.client.OperationalPolicyDelegate" /> |
| 18 | <to uri="bean:org.onap.clamp.clds.client.GuardPolicyDelegate" /> |
| 19 | <to |
| 20 | uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'COMPLETED')" /> |
| 21 | </when> |
| 22 | <when> |
| 23 | <simple> ${exchangeProperty.actionCd} == 'DELETE'</simple> |
| 24 | <to |
| 25 | uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'INITIATED')" /> |
| 26 | <to uri="bean:org.onap.clamp.clds.client.TcaPolicyDeleteDelegate" /> |
| 27 | <to |
| 28 | uri="bean:org.onap.clamp.clds.client.HolmesPolicyDeleteDelegate" /> |
| 29 | <delay> |
| 30 | <constant>30000</constant> |
| 31 | </delay> |
| 32 | <to |
| 33 | uri="bean:org.onap.clamp.clds.client.OperationalPolicyDeleteDelegate" /> |
| 34 | <to |
| 35 | uri="bean:org.onap.clamp.clds.client.GuardPolicyDeleteDelegate" /> |
| 36 | <to uri="bean:org.onap.clamp.clds.client.ModelDeleteDelegate" /> |
| 37 | <to |
| 38 | uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'COMPLETED')" /> |
| 39 | </when> |
| 40 | <when> |
| 41 | <simple> ${exchangeProperty.actionCd} == 'UPDATE'</simple> |
| 42 | <to |
| 43 | uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'INITIATED')" /> |
| 44 | <to uri="bean:org.onap.clamp.clds.client.TcaPolicyDelegate" /> |
| 45 | <to uri="bean:org.onap.clamp.clds.client.HolmesPolicyDelegate" /> |
| 46 | <delay> |
| 47 | <constant>30000</constant> |
| 48 | </delay> |
| 49 | <to |
| 50 | uri="bean:org.onap.clamp.clds.client.OperationalPolicyDelegate" /> |
| 51 | <to uri="bean:org.onap.clamp.clds.client.GuardPolicyDelegate" /> |
| 52 | <to |
| 53 | uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'COMPLETED')" /> |
| 54 | </when> |
| 55 | <when> |
| 56 | <simple> ${exchangeProperty.actionCd} == 'STOP'</simple> |
| 57 | <to |
| 58 | uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'INITIATED')" /> |
| 59 | <to |
| 60 | uri="bean:org.onap.clamp.clds.client.OperationalPolicyDeleteDelegate" /> |
| 61 | <to |
| 62 | uri="bean:org.onap.clamp.clds.client.GuardPolicyDeleteDelegate" /> |
| 63 | <to |
| 64 | uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'COMPLETED')" /> |
| 65 | </when> |
| 66 | <when> |
| 67 | <simple> ${exchangeProperty.actionCd} == 'RESTART'</simple> |
| 68 | <to |
| 69 | uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'INITIATED')" /> |
| 70 | <to uri="bean:org.onap.clamp.clds.client.GuardPolicyDelegate" /> |
| 71 | <to |
| 72 | uri="bean:org.onap.clamp.clds.client.OperationalPolicyDelegate" /> |
| 73 | <to |
| 74 | uri="bean:org.onap.clamp.clds.client.CldsEventDelegate?method=addEvent(*,'COMPLETED')" /> |
| 75 | </when> |
| 76 | </choice> |
| 77 | </route> |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 78 | |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame^] | 79 | <route id="load-loop"> |
| 80 | <from uri="direct:load-loop" /> |
| 81 | <setHeader headerName="LoopObject"> |
| 82 | <method |
| 83 | ref="org.onap.clamp.loop.LoopService" |
| 84 | method="getLoop" /> |
| 85 | </setHeader> |
| 86 | |
| 87 | <when> |
| 88 | <simple>${header.LoopObject} == null</simple> |
| 89 | <setHeader headerName="CamelHttpResponseCode"> |
| 90 | <constant>404</constant> |
| 91 | </setHeader> |
| 92 | <log |
| 93 | loggingLevel="WARNING" |
| 94 | message="Loop not found in database: ${body}" /> |
| 95 | <stop /> |
| 96 | </when> |
| 97 | |
| 98 | </route> |
| 99 | |
| 100 | <route id="create-micro-service-policy"> |
| 101 | <from uri="direct:create-micro-service-policy" /> |
| 102 | <log |
| 103 | loggingLevel="INFO" |
| 104 | message="Creating Micro Service Policy: ${header.microServicePolicy.getName()}" /> |
| 105 | <setBody> |
| 106 | <simple>${header.microServicePolicy.createPolicyPayload()} |
| 107 | </simple> |
| 108 | </setBody> |
| 109 | <setHeader headerName="CamelHttpMethod"> |
| 110 | <constant>POST</constant> |
| 111 | </setHeader> |
| 112 | <setHeader headerName="Content-Type"> |
| 113 | <constant>application/json</constant> |
| 114 | </setHeader> |
| 115 | <setHeader headerName="CamelHttpUri"> |
| 116 | <simple>{{clamp.config.policy.url}}/policyTypes/${header.microServicePolicy.getModelType()}/versions/1.0.0/policies |
| 117 | </simple> |
| 118 | </setHeader> |
| 119 | <log |
| 120 | loggingLevel="INFO" |
| 121 | message="Policy Endpoint for microservice: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> |
| 122 | <toD |
| 123 | uri="http4://policyhost:8085?throwExceptionOnFailure=${header.HttpQueryExceptionFlag}" /> |
| 124 | </route> |
| 125 | <route id="delete-micro-service-policy"> |
| 126 | <from uri="direct:delete-micro-service-policy" /> |
| 127 | <log |
| 128 | loggingLevel="INFO" |
| 129 | message="Deleting Micro Service Policy: ${header.microServicePolicy.getName()}" /> |
| 130 | <setBody> |
| 131 | <constant>null</constant> |
| 132 | </setBody> |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 133 | <setHeader headerName="CamelHttpMethod"> |
| 134 | <constant>DELETE</constant> |
| 135 | </setHeader> |
| 136 | <setHeader headerName="CamelHttpUri"> |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame^] | 137 | <simple>{{clamp.config.policy.url}}/policyTypes/${header.microServicePolicy.getModelType()}/versions/1.0.0/policies/${header.microServicePolicy.getName()} |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 138 | </simple> |
| 139 | </setHeader> |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 140 | <log |
| 141 | loggingLevel="INFO" |
| 142 | message="Policy Endpoint for microservice: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> |
| 143 | <toD |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame^] | 144 | uri="http4://policyhost:8085?throwExceptionOnFailure=${header.HttpQueryExceptionFlag}&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false" /> |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 145 | </route> |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 146 | |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame^] | 147 | <route id="create-operational-policy"> |
| 148 | <from uri="direct:create-operational-policy" /> |
| 149 | <log |
| 150 | loggingLevel="INFO" |
| 151 | message="Creating Operational Policy: ${header.operationalPolicy.getName()}" /> |
| 152 | <setBody> |
| 153 | <simple>${header.operationalPolicy.createPolicyPayload()} |
| 154 | </simple> |
| 155 | </setBody> |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 156 | <setHeader headerName="CamelHttpMethod"> |
| 157 | <constant>POST</constant> |
| 158 | </setHeader> |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame^] | 159 | <setHeader headerName="Content-Type"> |
| 160 | <constant>application/json</constant> |
| 161 | </setHeader> |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 162 | <setHeader headerName="CamelHttpUri"> |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame^] | 163 | <simple>{{clamp.config.policy.url}}/policyTypes/onap.policies.controloop.operational/versions/1.0.0/policies |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 164 | </simple> |
| 165 | </setHeader> |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 166 | <log |
| 167 | loggingLevel="INFO" |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame^] | 168 | message="Policy Endpoint for operational ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 169 | <toD |
sebdet | 919ef9d | 2019-04-08 18:32:26 +0200 | [diff] [blame^] | 170 | uri="http4://policyhost:8085?throwExceptionOnFailure=${header.HttpQueryExceptionFlag}" /> |
| 171 | </route> |
| 172 | <route id="delete-operational-policy"> |
| 173 | <from uri="direct:delete-operational-policy" /> |
| 174 | <log |
| 175 | loggingLevel="INFO" |
| 176 | message="Deleting Operational Policy: ${header.operationalPolicy.getName()}" /> |
| 177 | <setBody> |
| 178 | <constant>null</constant> |
| 179 | </setBody> |
| 180 | <setHeader headerName="CamelHttpMethod"> |
| 181 | <constant>DELETE</constant> |
| 182 | </setHeader> |
| 183 | <setHeader headerName="CamelHttpUri"> |
| 184 | <simple>{{clamp.config.policy.url}}/policyTypes/onap.policies.controloop.operational/versions/1.0.0/policies/${header.operationalPolicy.getName()} |
| 185 | </simple> |
| 186 | </setHeader> |
| 187 | <log |
| 188 | loggingLevel="INFO" |
| 189 | message="Policy Endpoint for operational: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> |
| 190 | <toD |
| 191 | uri="http4://policyhost:8085?throwExceptionOnFailure=${header.HttpQueryExceptionFlag}&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false" /> |
| 192 | |
| 193 | </route> |
| 194 | |
| 195 | <route id="create-guard-policy"> |
| 196 | <from uri="direct:create-guard-policy" /> |
| 197 | <log |
| 198 | loggingLevel="INFO" |
| 199 | message="Creating Guard Policy: ${header.guardPolicy.getKey()}" /> |
| 200 | <setBody> |
| 201 | <simple>${header.guardPolicy.getValue()} |
| 202 | </simple> |
| 203 | </setBody> |
| 204 | <setHeader headerName="CamelHttpMethod"> |
| 205 | <constant>POST</constant> |
| 206 | </setHeader> |
| 207 | <setHeader headerName="Content-Type"> |
| 208 | <constant>application/json</constant> |
| 209 | </setHeader> |
| 210 | <setHeader headerName="CamelHttpUri"> |
| 211 | <simple>{{clamp.config.policy.url}}/policyTypes/onap.policies.controlloop.Guard/versions/1.0.0/policies |
| 212 | </simple> |
| 213 | </setHeader> |
| 214 | <log |
| 215 | loggingLevel="INFO" |
| 216 | message="Policy Endpoint for operational ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> |
| 217 | <toD |
| 218 | uri="http4://policyhost:8085?throwExceptionOnFailure=${header.HttpQueryExceptionFlag}" /> |
| 219 | </route> |
| 220 | <route id="delete-guard-policy"> |
| 221 | <from uri="direct:delete-guard-policy" /> |
| 222 | <log |
| 223 | loggingLevel="INFO" |
| 224 | message="Deleting Guard Policy: ${header.guardPolicy.getKey()}" /> |
| 225 | <setBody> |
| 226 | <constant>null</constant> |
| 227 | </setBody> |
| 228 | <setHeader headerName="CamelHttpMethod"> |
| 229 | <constant>DELETE</constant> |
| 230 | </setHeader> |
| 231 | <setHeader headerName="CamelHttpUri"> |
| 232 | <simple>{{clamp.config.policy.url}}/policyTypes/onap.policies.controlloop.Guard/versions/1.0.0/policies/${header.guardPolicy.getKey()} |
| 233 | </simple> |
| 234 | </setHeader> |
| 235 | <log |
| 236 | loggingLevel="INFO" |
| 237 | message="Policy Endpoint for operational: ${header.CamelHttpMethod} ${header.CamelHttpUri}"></log> |
| 238 | <toD |
| 239 | uri="http4://policyhost:8085?throwExceptionOnFailure=${header.HttpQueryExceptionFlag}&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false" /> |
sebdet | dfa86ca | 2019-04-05 15:15:31 +0200 | [diff] [blame] | 240 | </route> |
Determe, Sebastien (sd378r) | 7c08374 | 2018-02-14 15:31:55 +0100 | [diff] [blame] | 241 | |
| 242 | </routes> |