aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/src/main/resources/clds
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2021-06-29 17:13:09 +0100
committerliamfallon <liam.fallon@est.tech>2021-06-30 08:44:40 +0100
commit7d04c23c7c51738d68f325e450ac408c1ae9905f (patch)
tree12ae464bf971e3106f2ea8a3ad552293e4fd13be /runtime/src/main/resources/clds
parent77aa9bc1f763e4de8d0b46fefa211e6018303514 (diff)
Update CLAMP: checkstyle 8.43/Spring dependencies
Updates are indentation changes on annotations and rationallization of the dependencies for Spring/Springboot Generation of swagger.json, swagger.html and swagger.pdf temporarily disabled due to a missing dependency in the generation toolchain. Issue-ID: POLICY-3209 Change-Id: Iff5881df45ef54b20fa30f63e2393cc1cdbf4bfe Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'runtime/src/main/resources/clds')
-rw-r--r--runtime/src/main/resources/clds/camel/rest/clds-services.xml42
-rw-r--r--runtime/src/main/resources/clds/camel/routes/loop-flows.xml506
-rw-r--r--runtime/src/main/resources/clds/camel/routes/utils-flows.xml52
3 files changed, 300 insertions, 300 deletions
diff --git a/runtime/src/main/resources/clds/camel/rest/clds-services.xml b/runtime/src/main/resources/clds/camel/rest/clds-services.xml
index aa4c3cbee..e92b7b272 100644
--- a/runtime/src/main/resources/clds/camel/rest/clds-services.xml
+++ b/runtime/src/main/resources/clds/camel/rest/clds-services.xml
@@ -1,24 +1,24 @@
<rests xmlns="http://camel.apache.org/schema/spring">
- <rest>
- <get uri="/v1/healthcheck" produces="application/json"
- outType="org.onap.policy.clamp.clds.model.CldsHealthCheck">
- <route>
- <setBody>
- <method ref="org.onap.policy.clamp.clds.service.CldsHealthcheckService"
- method="gethealthcheck()" />
- </setBody>
- <when>
- <simple> ${body} == 'NOT-OK'</simple>
- <setHeader name="CamelHttpResponseCode">
- <constant>404</constant>
- </setHeader>
- <log loggingLevel="ERROR" message="HealthCheck failed" />
- </when>
- </route>
- </get>
+ <rest>
+ <get uri="/v1/healthcheck" produces="application/json"
+ outType="org.onap.policy.clamp.clds.model.CldsHealthCheck">
+ <route>
+ <setBody>
+ <method ref="org.onap.policy.clamp.clds.service.CldsHealthcheckService"
+ method="gethealthcheck()" />
+ </setBody>
+ <when>
+ <simple> ${body} == 'NOT-OK'</simple>
+ <setHeader name="CamelHttpResponseCode">
+ <constant>404</constant>
+ </setHeader>
+ <log loggingLevel="ERROR" message="HealthCheck failed" />
+ </when>
+ </route>
+ </get>
- <get uri="/v1/user/getUser" produces="text/plain">
- <to uri="bean:org.onap.policy.clamp.authorization.UserService?method=getUser()" />
- </get>
- </rest>
+ <get uri="/v1/user/getUser" produces="text/plain">
+ <to uri="bean:org.onap.policy.clamp.authorization.UserService?method=getUser()" />
+ </get>
+ </rest>
</rests>
diff --git a/runtime/src/main/resources/clds/camel/routes/loop-flows.xml b/runtime/src/main/resources/clds/camel/routes/loop-flows.xml
index 4a3cc84b2..85e73ed2e 100644
--- a/runtime/src/main/resources/clds/camel/routes/loop-flows.xml
+++ b/runtime/src/main/resources/clds/camel/routes/loop-flows.xml
@@ -1,256 +1,256 @@
<routes xmlns="http://camel.apache.org/schema/spring">
- <route id="load-loop">
- <from uri="direct:load-loop" />
- <setBody>
- <simple>${header.loopName}</simple>
- </setBody>
- <setProperty name="loopObject">
- <method ref="org.onap.policy.clamp.loop.LoopService" method="getLoop" />
- </setProperty>
+ <route id="load-loop">
+ <from uri="direct:load-loop" />
+ <setBody>
+ <simple>${header.loopName}</simple>
+ </setBody>
+ <setProperty name="loopObject">
+ <method ref="org.onap.policy.clamp.loop.LoopService" method="getLoop" />
+ </setProperty>
- <when>
- <simple>${exchangeProperty[loopObject]} == null</simple>
- <setHeader name="CamelHttpResponseCode">
- <constant>404</constant>
- </setHeader>
- <log loggingLevel="WARN" message="Loop not found in database: ${body}" />
- <stop />
- </when>
- </route>
- <route id="update-policy-status-for-loop">
- <from uri="direct:update-policy-status-for-loop" />
- <setProperty name="policyComponent">
- <simple>${exchangeProperty[loopObject].getComponent('POLICY')}
- </simple>
- </setProperty>
- <setProperty name="policyFound">
- <simple resultType="java.lang.Boolean">true</simple>
- </setProperty>
- <setProperty name="policyDeployed">
- <simple resultType="java.lang.Boolean">true</simple>
- </setProperty>
- <log loggingLevel="INFO"
- message="Processing all MICRO-SERVICES policies defined in loop ${exchangeProperty[loopObject].getName()}" />
- <split>
- <simple>${exchangeProperty[loopObject].getMicroServicePolicies()}
- </simple>
- <setProperty name="policyName">
- <simple>${body.getName()}</simple>
- </setProperty>
- <setProperty name="policyType">
- <simple>${body.getPolicyModel().getPolicyModelType()}</simple>
- </setProperty>
- <setProperty name="policyTypeVersion">
- <simple>${body.getPolicyModel().getVersion()}</simple>
- </setProperty>
- <setProperty name="policyPdpGroup">
- <simple>${body.getPdpGroup()}</simple>
- </setProperty>
- <setProperty name="policyVersion">
- <simple>1.0.0</simple>
- </setProperty>
- <setBody>
- <constant>null</constant>
- </setBody>
- <log loggingLevel="INFO"
- message="Processing Micro Service Policy: ${exchangeProperty[policyName]} of type ${exchangeProperty[policyType]}" />
- <to uri="direct:verify-one-policy" />
- </split>
- <log loggingLevel="INFO"
- message="Processing all OPERATIONAL policies defined in loop ${exchangeProperty[loopObject].getName()}" />
- <split>
- <simple>${exchangeProperty[loopObject].getOperationalPolicies()}
- </simple>
- <setProperty name="policyName">
- <simple>${body.getName()}</simple>
- </setProperty>
- <setProperty name="policyType">
- <simple>${body.getPolicyModel().getPolicyModelType()}</simple>
- </setProperty>
- <setProperty name="policyTypeVersion">
- <simple>${body.getPolicyModel().getVersion()}</simple>
- </setProperty>
- <setProperty name="policyVersion">
- <simple>1.0.0</simple>
- </setProperty>
- <setProperty name="policyPdpGroup">
- <simple>${body.getPdpGroup()}</simple>
- </setProperty>
- <setBody>
- <constant>null</constant>
- </setBody>
- <log loggingLevel="INFO"
- message="Processing Operational Policy: ${exchangeProperty[policyName]} of type ${exchangeProperty[policyType]}" />
- <to uri="direct:verify-one-policy" />
- </split>
- <setProperty name="policyState">
- <simple> ${exchangeProperty[policyComponent].getState()}
- </simple>
- </setProperty>
- <log loggingLevel="INFO"
- message="Policy state set to: ${exchangeProperty[policyState].getStateName()}" />
- <to
- uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLogForComponent('Policy state set to: ${exchangeProperty[policyState].getStateName()}','INFO','POLICY',${exchangeProperty[loopObject]})" />
- </route>
- <route id="update-dcae-status-for-loop">
- <from uri="direct:update-dcae-status-for-loop" />
- <log loggingLevel="INFO"
- message="Updating DCAE status for loop: ${exchangeProperty[loopObject].getName()}" />
- <choice>
- <when>
- <simple>${exchangeProperty['loopObject'].getLoopTemplate().getUniqueBlueprint()} == true
- </simple>
- <setProperty name="dcaeComponent">
- <simple>${exchangeProperty[loopObject].getComponent('DCAE')}</simple>
- </setProperty>
- <when>
- <simple>${exchangeProperty[loopObject].getDcaeDeploymentStatusUrl()} != null
- </simple>
- <setProperty name="getStatusUrl">
- <simple>${exchangeProperty[loopObject].getDcaeDeploymentStatusUrl()}</simple>
- </setProperty>
- <setProperty name="raiseHttpExceptionFlag">
- <simple resultType="java.lang.Boolean">false</simple>
- </setProperty>
- <to uri="direct:get-dcae-deployment-status" />
- <when>
- <simple> ${header.CamelHttpResponseCode} == 200 </simple>
- <convertBodyTo type="java.lang.String" />
- <setProperty name="dcaeResponse">
- <method ref="org.onap.policy.clamp.loop.components.external.DcaeComponent"
- method="convertDcaeResponse(${body})" />
- </setProperty>
- </when>
- </when>
- <setProperty name="dcaeState">
- <simple> ${exchangeProperty[dcaeComponent].computeState(*)}
- </simple>
- </setProperty>
- <log loggingLevel="INFO"
- message="DCAE state set to: ${exchangeProperty[dcaeState].getStateName()} - DCAE message: ${exchangeProperty[dcaeResponse].getError()}" />
- <to
- uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLogForComponent('DCAE state set to: ${exchangeProperty[dcaeState].getStateName()} - message: ${exchangeProperty[dcaeResponse].getError()}','INFO','DCAE',${exchangeProperty[loopObject]})" />
- </when>
- <when>
- <simple>${exchangeProperty['loopObject'].getLoopTemplate().getUniqueBlueprint()} == false
- </simple>
- <split>
- <simple>${exchangeProperty[loopObject].getMicroServicePolicies()}
- </simple>
- <setProperty name="microServicePolicy">
- <simple>${body}</simple>
- </setProperty>
- <setProperty name="dcaeComponent">
- <simple>${exchangeProperty[loopObject].getComponent('DCAE_' + ${exchangeProperty[microServicePolicy].getName()})}</simple>
- </setProperty>
- <when>
- <simple>${exchangeProperty[microServicePolicy].getDcaeDeploymentStatusUrl()} != null
- </simple>
- <setProperty name="getStatusUrl">
- <simple>${exchangeProperty[microServicePolicy].getDcaeDeploymentStatusUrl()}</simple>
- </setProperty>
- <setProperty name="raiseHttpExceptionFlag">
- <simple resultType="java.lang.Boolean">false</simple>
- </setProperty>
- <to uri="direct:get-dcae-deployment-status" />
- <when>
- <simple> ${header.CamelHttpResponseCode} == 200 </simple>
- <convertBodyTo type="java.lang.String" />
- <setProperty name="dcaeResponse">
- <method ref="org.onap.policy.clamp.loop.components.external.DcaeComponent"
- method="convertDcaeResponse(${body})" />
- </setProperty>
- </when>
- </when>
- <setProperty name="dcaeState">
- <simple> ${exchangeProperty[dcaeComponent].computeState(*)}
- </simple>
- </setProperty>
- <log loggingLevel="INFO"
- message="DCAE state set to: ${exchangeProperty[dcaeState].getStateName()} - DCAE message: ${exchangeProperty[dcaeResponse].getError()}" />
- <to
- uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLogForComponent('DCAE state set to: ${exchangeProperty[dcaeState].getStateName()} - message: ${exchangeProperty[dcaeResponse].getError()}','INFO','DCAE',${exchangeProperty[microServicePolicy]})" />
- </split>>
- </when>
- </choice>
- </route>
- <route id="direct:update-loop-state">
- <from uri="direct:update-loop-state" />
- <log loggingLevel="INFO"
- message="Updating status for loop: ${exchangeProperty[loopObject].getName()}" />
- <choice>
- <when>
- <simple>${exchangeProperty['dcaeState'].getStateName()} ==
- 'BLUEPRINT_DEPLOYED' &amp;&amp; ${exchangeProperty['policyState'].getStateName()}
- == 'NOT_SENT'
- </simple>
- <to
- uri="bean:org.onap.policy.clamp.loop.LoopService?method=updateLoopState(${exchangeProperty[loopObject]},'DESIGN')" />
- </when>
- <when>
- <simple>${exchangeProperty['dcaeState'].getStateName()} == 'IN_ERROR' ||
- ${exchangeProperty['dcaeState'].getStateName()} ==
- 'MICROSERVICE_INSTALLATION_FAILED'
- </simple>
- <to
- uri="bean:org.onap.policy.clamp.loop.LoopService?method=updateLoopState(${exchangeProperty[loopObject]},'IN_ERROR')" />
- </when>
- <when>
- <simple>${exchangeProperty['dcaeState'].getStateName()} ==
- 'MICROSERVICE_UNINSTALLATION_FAILED' ||
- ${exchangeProperty['policyState'].getStateName()} == 'IN_ERROR'
- </simple>
- <to
- uri="bean:org.onap.policy.clamp.loop.LoopService?method=updateLoopState(${exchangeProperty[loopObject]},'IN_ERROR')" />
- </when>
- <when>
- <simple>${exchangeProperty['dcaeState'].getStateName()} ==
- 'MICROSERVICE_INSTALLED_SUCCESSFULLY' &amp;&amp;
- ${exchangeProperty['policyState'].getStateName()} == 'SENT_AND_DEPLOYED'
- </simple>
- <to
- uri="bean:org.onap.policy.clamp.loop.LoopService?method=updateLoopState(${exchangeProperty[loopObject]},'RUNNING')" />
- </when>
- <when>
- <simple>${exchangeProperty['dcaeState'].getStateName()} ==
- 'MICROSERVICE_INSTALLED_SUCCESSFULLY' &amp;&amp;
- ${exchangeProperty['policyState'].getStateName()} == 'SENT'
- </simple>
- <to
- uri="bean:org.onap.policy.clamp.loop.LoopService?method=updateLoopState(${exchangeProperty[loopObject]},'STOPPED')" />
- </when>
- <when>
- <simple>${exchangeProperty['dcaeState'].getStateName()} ==
- 'BLUEPRINT_DEPLOYED' || ${exchangeProperty['dcaeState'].getStateName()} ==
- 'MICROSERVICE_UNINSTALLED_SUCCESSFULLY' &amp;&amp;
- ${exchangeProperty['policyState'].getStateName()} == 'SENT_AND_DEPLOYED'
- </simple>
- <to
- uri="bean:org.onap.policy.clamp.loop.LoopService?method=updateLoopState(${exchangeProperty[loopObject]},'SUBMITTED')" />
- </when>
- <when>
- <simple>${exchangeProperty['dcaeState'].getStateName()} ==
- 'PROCESSING_MICROSERVICE_INSTALLATION' ||
- ${exchangeProperty['dcaeState'].getStateName()} ==
- 'PROCESSING_MICROSERVICE_UNINSTALLATION' &amp;&amp;
- ${exchangeProperty['policyState'].getStateName()} == 'SENT_AND_DEPLOYED'
- </simple>
- <to
- uri="bean:org.onap.policy.clamp.loop.LoopService?method=updateLoopState(${exchangeProperty[loopObject]},'WAITING')" />
- </when>
- <when>
- <simple>${exchangeProperty['dcaeState'].getStateName()} ==
- 'MICROSERVICE_INSTALLED_SUCCESSFULLY' &amp;&amp;
- ${exchangeProperty['policyState'].getStateName()} != 'NOT_SENT'
- </simple>
- <to
- uri="bean:org.onap.policy.clamp.loop.LoopService?method=updateLoopState(${exchangeProperty[loopObject]},'DEPLOYED')" />
- </when>
- </choice>
- <log loggingLevel="INFO"
- message="New loop state is: ${exchangeProperty[loopObject].getLastComputedState().toString()}" />
- <to
- uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('New loop state is: ${exchangeProperty[loopObject].getLastComputedState().toString()}','INFO',${exchangeProperty[loopObject]})" />
+ <when>
+ <simple>${exchangeProperty[loopObject]} == null</simple>
+ <setHeader name="CamelHttpResponseCode">
+ <constant>404</constant>
+ </setHeader>
+ <log loggingLevel="WARN" message="Loop not found in database: ${body}" />
+ <stop />
+ </when>
+ </route>
+ <route id="update-policy-status-for-loop">
+ <from uri="direct:update-policy-status-for-loop" />
+ <setProperty name="policyComponent">
+ <simple>${exchangeProperty[loopObject].getComponent('POLICY')}
+ </simple>
+ </setProperty>
+ <setProperty name="policyFound">
+ <simple resultType="java.lang.Boolean">true</simple>
+ </setProperty>
+ <setProperty name="policyDeployed">
+ <simple resultType="java.lang.Boolean">true</simple>
+ </setProperty>
+ <log loggingLevel="INFO"
+ message="Processing all MICRO-SERVICES policies defined in loop ${exchangeProperty[loopObject].getName()}" />
+ <split>
+ <simple>${exchangeProperty[loopObject].getMicroServicePolicies()}
+ </simple>
+ <setProperty name="policyName">
+ <simple>${body.getName()}</simple>
+ </setProperty>
+ <setProperty name="policyType">
+ <simple>${body.getPolicyModel().getPolicyModelType()}</simple>
+ </setProperty>
+ <setProperty name="policyTypeVersion">
+ <simple>${body.getPolicyModel().getVersion()}</simple>
+ </setProperty>
+ <setProperty name="policyPdpGroup">
+ <simple>${body.getPdpGroup()}</simple>
+ </setProperty>
+ <setProperty name="policyVersion">
+ <simple>1.0.0</simple>
+ </setProperty>
+ <setBody>
+ <constant>null</constant>
+ </setBody>
+ <log loggingLevel="INFO"
+ message="Processing Micro Service Policy: ${exchangeProperty[policyName]} of type ${exchangeProperty[policyType]}" />
+ <to uri="direct:verify-one-policy" />
+ </split>
+ <log loggingLevel="INFO"
+ message="Processing all OPERATIONAL policies defined in loop ${exchangeProperty[loopObject].getName()}" />
+ <split>
+ <simple>${exchangeProperty[loopObject].getOperationalPolicies()}
+ </simple>
+ <setProperty name="policyName">
+ <simple>${body.getName()}</simple>
+ </setProperty>
+ <setProperty name="policyType">
+ <simple>${body.getPolicyModel().getPolicyModelType()}</simple>
+ </setProperty>
+ <setProperty name="policyTypeVersion">
+ <simple>${body.getPolicyModel().getVersion()}</simple>
+ </setProperty>
+ <setProperty name="policyVersion">
+ <simple>1.0.0</simple>
+ </setProperty>
+ <setProperty name="policyPdpGroup">
+ <simple>${body.getPdpGroup()}</simple>
+ </setProperty>
+ <setBody>
+ <constant>null</constant>
+ </setBody>
+ <log loggingLevel="INFO"
+ message="Processing Operational Policy: ${exchangeProperty[policyName]} of type ${exchangeProperty[policyType]}" />
+ <to uri="direct:verify-one-policy" />
+ </split>
+ <setProperty name="policyState">
+ <simple> ${exchangeProperty[policyComponent].getState()}
+ </simple>
+ </setProperty>
+ <log loggingLevel="INFO"
+ message="Policy state set to: ${exchangeProperty[policyState].getStateName()}" />
+ <to
+ uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLogForComponent('Policy state set to: ${exchangeProperty[policyState].getStateName()}','INFO','POLICY',${exchangeProperty[loopObject]})" />
+ </route>
+ <route id="update-dcae-status-for-loop">
+ <from uri="direct:update-dcae-status-for-loop" />
+ <log loggingLevel="INFO"
+ message="Updating DCAE status for loop: ${exchangeProperty[loopObject].getName()}" />
+ <choice>
+ <when>
+ <simple>${exchangeProperty['loopObject'].getLoopTemplate().getUniqueBlueprint()} == true
+ </simple>
+ <setProperty name="dcaeComponent">
+ <simple>${exchangeProperty[loopObject].getComponent('DCAE')}</simple>
+ </setProperty>
+ <when>
+ <simple>${exchangeProperty[loopObject].getDcaeDeploymentStatusUrl()} != null
+ </simple>
+ <setProperty name="getStatusUrl">
+ <simple>${exchangeProperty[loopObject].getDcaeDeploymentStatusUrl()}</simple>
+ </setProperty>
+ <setProperty name="raiseHttpExceptionFlag">
+ <simple resultType="java.lang.Boolean">false</simple>
+ </setProperty>
+ <to uri="direct:get-dcae-deployment-status" />
+ <when>
+ <simple> ${header.CamelHttpResponseCode} == 200 </simple>
+ <convertBodyTo type="java.lang.String" />
+ <setProperty name="dcaeResponse">
+ <method ref="org.onap.policy.clamp.loop.components.external.DcaeComponent"
+ method="convertDcaeResponse(${body})" />
+ </setProperty>
+ </when>
+ </when>
+ <setProperty name="dcaeState">
+ <simple> ${exchangeProperty[dcaeComponent].computeState(*)}
+ </simple>
+ </setProperty>
+ <log loggingLevel="INFO"
+ message="DCAE state set to: ${exchangeProperty[dcaeState].getStateName()} - DCAE message: ${exchangeProperty[dcaeResponse].getError()}" />
+ <to
+ uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLogForComponent('DCAE state set to: ${exchangeProperty[dcaeState].getStateName()} - message: ${exchangeProperty[dcaeResponse].getError()}','INFO','DCAE',${exchangeProperty[loopObject]})" />
+ </when>
+ <when>
+ <simple>${exchangeProperty['loopObject'].getLoopTemplate().getUniqueBlueprint()} == false
+ </simple>
+ <split>
+ <simple>${exchangeProperty[loopObject].getMicroServicePolicies()}
+ </simple>
+ <setProperty name="microServicePolicy">
+ <simple>${body}</simple>
+ </setProperty>
+ <setProperty name="dcaeComponent">
+ <simple>${exchangeProperty[loopObject].getComponent('DCAE_' + ${exchangeProperty[microServicePolicy].getName()})}</simple>
+ </setProperty>
+ <when>
+ <simple>${exchangeProperty[microServicePolicy].getDcaeDeploymentStatusUrl()} != null
+ </simple>
+ <setProperty name="getStatusUrl">
+ <simple>${exchangeProperty[microServicePolicy].getDcaeDeploymentStatusUrl()}</simple>
+ </setProperty>
+ <setProperty name="raiseHttpExceptionFlag">
+ <simple resultType="java.lang.Boolean">false</simple>
+ </setProperty>
+ <to uri="direct:get-dcae-deployment-status" />
+ <when>
+ <simple> ${header.CamelHttpResponseCode} == 200 </simple>
+ <convertBodyTo type="java.lang.String" />
+ <setProperty name="dcaeResponse">
+ <method ref="org.onap.policy.clamp.loop.components.external.DcaeComponent"
+ method="convertDcaeResponse(${body})" />
+ </setProperty>
+ </when>
+ </when>
+ <setProperty name="dcaeState">
+ <simple> ${exchangeProperty[dcaeComponent].computeState(*)}
+ </simple>
+ </setProperty>
+ <log loggingLevel="INFO"
+ message="DCAE state set to: ${exchangeProperty[dcaeState].getStateName()} - DCAE message: ${exchangeProperty[dcaeResponse].getError()}" />
+ <to
+ uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLogForComponent('DCAE state set to: ${exchangeProperty[dcaeState].getStateName()} - message: ${exchangeProperty[dcaeResponse].getError()}','INFO','DCAE',${exchangeProperty[microServicePolicy]})" />
+ </split>>
+ </when>
+ </choice>
+ </route>
+ <route id="direct:update-loop-state">
+ <from uri="direct:update-loop-state" />
+ <log loggingLevel="INFO"
+ message="Updating status for loop: ${exchangeProperty[loopObject].getName()}" />
+ <choice>
+ <when>
+ <simple>${exchangeProperty['dcaeState'].getStateName()} ==
+ 'BLUEPRINT_DEPLOYED' &amp;&amp; ${exchangeProperty['policyState'].getStateName()}
+ == 'NOT_SENT'
+ </simple>
+ <to
+ uri="bean:org.onap.policy.clamp.loop.LoopService?method=updateLoopState(${exchangeProperty[loopObject]},'DESIGN')" />
+ </when>
+ <when>
+ <simple>${exchangeProperty['dcaeState'].getStateName()} == 'IN_ERROR' ||
+ ${exchangeProperty['dcaeState'].getStateName()} ==
+ 'MICROSERVICE_INSTALLATION_FAILED'
+ </simple>
+ <to
+ uri="bean:org.onap.policy.clamp.loop.LoopService?method=updateLoopState(${exchangeProperty[loopObject]},'IN_ERROR')" />
+ </when>
+ <when>
+ <simple>${exchangeProperty['dcaeState'].getStateName()} ==
+ 'MICROSERVICE_UNINSTALLATION_FAILED' ||
+ ${exchangeProperty['policyState'].getStateName()} == 'IN_ERROR'
+ </simple>
+ <to
+ uri="bean:org.onap.policy.clamp.loop.LoopService?method=updateLoopState(${exchangeProperty[loopObject]},'IN_ERROR')" />
+ </when>
+ <when>
+ <simple>${exchangeProperty['dcaeState'].getStateName()} ==
+ 'MICROSERVICE_INSTALLED_SUCCESSFULLY' &amp;&amp;
+ ${exchangeProperty['policyState'].getStateName()} == 'SENT_AND_DEPLOYED'
+ </simple>
+ <to
+ uri="bean:org.onap.policy.clamp.loop.LoopService?method=updateLoopState(${exchangeProperty[loopObject]},'RUNNING')" />
+ </when>
+ <when>
+ <simple>${exchangeProperty['dcaeState'].getStateName()} ==
+ 'MICROSERVICE_INSTALLED_SUCCESSFULLY' &amp;&amp;
+ ${exchangeProperty['policyState'].getStateName()} == 'SENT'
+ </simple>
+ <to
+ uri="bean:org.onap.policy.clamp.loop.LoopService?method=updateLoopState(${exchangeProperty[loopObject]},'STOPPED')" />
+ </when>
+ <when>
+ <simple>${exchangeProperty['dcaeState'].getStateName()} ==
+ 'BLUEPRINT_DEPLOYED' || ${exchangeProperty['dcaeState'].getStateName()} ==
+ 'MICROSERVICE_UNINSTALLED_SUCCESSFULLY' &amp;&amp;
+ ${exchangeProperty['policyState'].getStateName()} == 'SENT_AND_DEPLOYED'
+ </simple>
+ <to
+ uri="bean:org.onap.policy.clamp.loop.LoopService?method=updateLoopState(${exchangeProperty[loopObject]},'SUBMITTED')" />
+ </when>
+ <when>
+ <simple>${exchangeProperty['dcaeState'].getStateName()} ==
+ 'PROCESSING_MICROSERVICE_INSTALLATION' ||
+ ${exchangeProperty['dcaeState'].getStateName()} ==
+ 'PROCESSING_MICROSERVICE_UNINSTALLATION' &amp;&amp;
+ ${exchangeProperty['policyState'].getStateName()} == 'SENT_AND_DEPLOYED'
+ </simple>
+ <to
+ uri="bean:org.onap.policy.clamp.loop.LoopService?method=updateLoopState(${exchangeProperty[loopObject]},'WAITING')" />
+ </when>
+ <when>
+ <simple>${exchangeProperty['dcaeState'].getStateName()} ==
+ 'MICROSERVICE_INSTALLED_SUCCESSFULLY' &amp;&amp;
+ ${exchangeProperty['policyState'].getStateName()} != 'NOT_SENT'
+ </simple>
+ <to
+ uri="bean:org.onap.policy.clamp.loop.LoopService?method=updateLoopState(${exchangeProperty[loopObject]},'DEPLOYED')" />
+ </when>
+ </choice>
+ <log loggingLevel="INFO"
+ message="New loop state is: ${exchangeProperty[loopObject].getLastComputedState().toString()}" />
+ <to
+ uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('New loop state is: ${exchangeProperty[loopObject].getLastComputedState().toString()}','INFO',${exchangeProperty[loopObject]})" />
- </route>
-</routes> \ No newline at end of file
+ </route>
+</routes>
diff --git a/runtime/src/main/resources/clds/camel/routes/utils-flows.xml b/runtime/src/main/resources/clds/camel/routes/utils-flows.xml
index 90900f842..da91335c8 100644
--- a/runtime/src/main/resources/clds/camel/routes/utils-flows.xml
+++ b/runtime/src/main/resources/clds/camel/routes/utils-flows.xml
@@ -1,28 +1,28 @@
<routes xmlns="http://camel.apache.org/schema/spring">
- <route id="reset-raise-http-exception-flag">
- <from uri="direct:reset-raise-http-exception-flag" />
- <setProperty name="raiseHttpExceptionFlag">
- <simple resultType="java.lang.Boolean">true</simple>
- </setProperty>
- </route>
+ <route id="reset-raise-http-exception-flag">
+ <from uri="direct:reset-raise-http-exception-flag" />
+ <setProperty name="raiseHttpExceptionFlag">
+ <simple resultType="java.lang.Boolean">true</simple>
+ </setProperty>
+ </route>
- <route id="dump-loop-log-http-response">
- <from uri="direct:dump-loop-log-http-response" />
- <log loggingLevel="INFO"
- message="${exchangeProperty[logMessage]} - ${header.CamelHttpResponseCode} : ${header.CamelHttpResponseText}" />
- <choice>
- <when>
- <simple>${exchangeProperty[logComponent]} == null</simple>
- <to
- uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('${exchangeProperty[logMessage]} - ${header.CamelHttpResponseCode} : ${header.CamelHttpResponseText}','INFO',${exchangeProperty[loopObject]})" />
- </when>
- <otherwise>
- <to
- uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLogForComponent('${exchangeProperty[logMessage]} - ${header.CamelHttpResponseCode} : ${header.CamelHttpResponseText}','INFO','${exchangeProperty[logComponent]}',${exchangeProperty[loopObject]})" />
- <setProperty name="logComponent">
- <constant>null</constant>
- </setProperty>
- </otherwise>
- </choice>
- </route>
-</routes> \ No newline at end of file
+ <route id="dump-loop-log-http-response">
+ <from uri="direct:dump-loop-log-http-response" />
+ <log loggingLevel="INFO"
+ message="${exchangeProperty[logMessage]} - ${header.CamelHttpResponseCode} : ${header.CamelHttpResponseText}" />
+ <choice>
+ <when>
+ <simple>${exchangeProperty[logComponent]} == null</simple>
+ <to
+ uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLog('${exchangeProperty[logMessage]} - ${header.CamelHttpResponseCode} : ${header.CamelHttpResponseText}','INFO',${exchangeProperty[loopObject]})" />
+ </when>
+ <otherwise>
+ <to
+ uri="bean:org.onap.policy.clamp.loop.log.LoopLogService?method=addLogForComponent('${exchangeProperty[logMessage]} - ${header.CamelHttpResponseCode} : ${header.CamelHttpResponseText}','INFO','${exchangeProperty[logComponent]}',${exchangeProperty[loopObject]})" />
+ <setProperty name="logComponent">
+ <constant>null</constant>
+ </setProperty>
+ </otherwise>
+ </choice>
+ </route>
+</routes>