Remove dead code
[clamp.git] / src / main / java / org / onap / clamp / clds / client / CldsEventDelegate.java
index dcc3189..8ae10b2 100644 (file)
@@ -18,7 +18,7 @@
  * limitations under the License.
  * ============LICENSE_END============================================
  * ===================================================================
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ *
  */
 
 package org.onap.clamp.clds.client;
@@ -27,7 +27,6 @@ import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
 
 import org.apache.camel.Exchange;
-import org.apache.camel.Handler;
 import org.onap.clamp.clds.dao.CldsDao;
 import org.onap.clamp.clds.model.CldsEvent;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -48,13 +47,18 @@ public class CldsEventDelegate {
      * Insert event using process variables.
      *
      * @param camelExchange
-     *            The Camel Exchange object containing the properties
+     *        The Camel Exchange object containing the properties
+     * @param actionState
+     *        The action state that is used instead of the one in exchange property
      */
-    @Handler
-    public void execute(Exchange camelExchange) {
+
+    public void addEvent(Exchange camelExchange, String actionState) {
         String controlName = (String) camelExchange.getProperty("controlName");
         String actionCd = (String) camelExchange.getProperty("actionCd");
-        String actionStateCd = (String) camelExchange.getProperty("actionStateCd");
+        String actionStateCd = (actionState != null) ? actionState : CldsEvent.ACTION_STATE_COMPLETED;
+        actionStateCd = ((String) camelExchange.getProperty("actionStateCd")) != null
+            ? ((String) camelExchange.getProperty("actionStateCd"))
+            : actionStateCd;
         // Flag indicate whether it is triggered by Validation Test button from
         // UI
         boolean isTest = (boolean) camelExchange.getProperty("isTest");