Commit 3 for Create Optimized Sched API 23/83223/1
authorJerry Flood <jflood@att.com>
Mon, 25 Mar 2019 16:22:12 +0000 (12:22 -0400)
committerJerry Flood <jflood@att.com>
Mon, 25 Mar 2019 16:41:48 +0000 (12:41 -0400)
Multiple commits required due to commit size limitation.

Change-Id: I458d29619f98825b1a1ed645110d8e6ecad12175
Issue-ID: OPTFRA-458
Signed-off-by: Jerry Flood <jflood@att.com>
cmso-service/src/main/java/org/onap/optf/cmso/common/CmHelpers.java
cmso-service/src/main/java/org/onap/optf/cmso/common/LogMessages.java
cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/CMSOClient.java
cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/CmJob.java
cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/rs/DispatcherServiceImpl.java
cmso-service/src/main/java/org/onap/optf/cmso/filters/CMSOClientFilters.java [deleted file]

index 832acb7..c5ff7f0 100644 (file)
@@ -1,27 +1,27 @@
 /*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright © 2018 IBM.\r
- * \r
+ * Copyright Â© 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright Â© 2018 IBM.\r
+ *\r
  * Licensed under the Apache License, Version 2.0 (the "License");\r
  * you may not use this file except in compliance with the License.\r
  * You may obtain a copy of the License at\r
- * \r
+ *\r
  *         http://www.apache.org/licenses/LICENSE-2.0\r
- * \r
+ *\r
  * Unless required by applicable law or agreed to in writing, software\r
  * distributed under the License is distributed on an "AS IS" BASIS,\r
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
  * See the License for the specific language governing permissions and\r
  * limitations under the License.\r
- * \r
- * \r
+ *\r
+ *\r
  * Unless otherwise specified, all documentation contained herein is licensed\r
  * under the Creative Commons License, Attribution 4.0 Intl. (the "License");\r
  * you may not use this documentation except in compliance with the License.\r
  * You may obtain a copy of the License at\r
- * \r
+ *\r
  *         https://creativecommons.org/licenses/by/4.0/\r
- * \r
+ *\r
  * Unless required by applicable law or agreed to in writing, documentation\r
  * distributed under the License is distributed on an "AS IS" BASIS,\r
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
@@ -33,12 +33,13 @@ package org.onap.optf.cmso.common;
 \r
 import java.util.List;\r
 import org.onap.optf.cmso.model.DomainData;\r
+import org.onap.optf.cmso.model.ElementData;\r
 import org.onap.optf.cmso.model.Schedule;\r
 import org.onap.optf.cmso.service.rs.models.CmDomainDataEnum;\r
 \r
 /**\r
  * Collection of commann static helper methods for CHangeManagement\r
- * \r
+ *\r
  * @author jf9860\r
  *\r
  */\r
@@ -56,4 +57,16 @@ public class CmHelpers {
         return null;\r
     }\r
 \r
+  public static String getEventData(Schedule schedule, CmDomainDataEnum key) {\r
+      return getDomainData(schedule.getDomainData(), key);\r
+  }\r
+\r
+  public static String getElementData(List<ElementData> eventData, CmDomainDataEnum key) {\r
+      for (ElementData map : eventData) {\r
+          if (map.getName().equals(key.toString()))\r
+              return map.getValue();\r
+      }\r
+      return null;\r
+  }\r
+\r
 }\r
index efb4dd0..3fd6cc8 100644 (file)
 /*\r
- * Copyright © 2017-2019 AT&T Intellectual Property.\r
- * Modifications Copyright © 2018 IBM.\r
- * \r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- * \r
- *         http://www.apache.org/licenses/LICENSE-2.0\r
- * \r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
+ * Copyright © 2017-2019 AT&T Intellectual Property. Modifications Copyright © 2018 IBM.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except\r
+ * in compliance with the License. You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software distributed under the License\r
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express\r
+ * or implied. See the License for the specific language governing permissions and limitations under\r
+ * the License.\r
+ *\r
+ *\r
+ * Unless otherwise specified, all documentation contained herein is licensed under the Creative\r
+ * Commons License, Attribution 4.0 Intl. (the "License"); you may not use this documentation except\r
+ * in compliance with the License. You may obtain a copy of the License at\r
+ *\r
+ * https://creativecommons.org/licenses/by/4.0/\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, documentation distributed under the\r
+ * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\r
+ * express or implied. See the License for the specific language governing permissions and\r
  * limitations under the License.\r
- * \r
- * \r
- * Unless otherwise specified, all documentation contained herein is licensed\r
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");\r
- * you may not use this documentation except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- * \r
- *         https://creativecommons.org/licenses/by/4.0/\r
- * \r
- * Unless required by applicable law or agreed to in writing, documentation\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
-*/\r
+ */\r
 \r
 package org.onap.optf.cmso.common;\r
 \r
+import com.att.eelf.configuration.EELFManager;\r
+import com.att.eelf.i18n.EELFResourceManager;\r
 import java.io.IOException;\r
 import java.nio.file.Files;\r
 import java.nio.file.Paths;\r
-\r
 import javax.ws.rs.core.Response.Status;\r
-\r
 import org.apache.log4j.Level;\r
 import org.onap.observations.ObservationInterface;\r
 \r
-import com.att.eelf.configuration.EELFManager;\r
-import com.att.eelf.i18n.EELFResourceManager;\r
-\r
+/**\r
+ * The Enum LogMessages.\r
+ */\r
 public enum LogMessages implements ObservationInterface {\r
 \r
-       SEARCH_SCHEDULE_REQUEST_DETAILS("Search Schedule Request Details {0} from {1}: {2}", Status.OK, Level.INFO),\r
-       SEARCH_SCHEDULE_REQUEST("Search Schedule Request {0} from {1}: {2} : {3}", Status.OK, Level.INFO),\r
-       CREATE_SCHEDULE_REQUEST("Create Schedule Request {0} from {1}: {2} : {3}", Status.OK, Level.INFO),\r
-       DELETE_SCHEDULE_REQUEST("Delete Schedule Request {0} from {1}: {2} : {3}", Status.OK, Level.INFO),\r
-       GET_SCHEDULE_REQUEST_INFO("Get Schedule Request Info {0} from {1}: {2} : {3}", Status.OK, Level.INFO),\r
-       PROCESS_OPTIMIZER_CALLBACK("Change management optimizer callback {0} from {1}: {2} ", Status.OK, Level.INFO),\r
-       APPROVE_SCHEDULE_REQUEST("Approve Schedule Request {0} from {1}: {2} : {3}", Status.OK, Level.INFO),\r
-       SCHEDULE_ALREADY_EXISTS("Schedule already exists domain={0} schedule id={1}", Status.OK, Level.INFO),\r
-       SCHEDULE_NOT_FOUND("Schedule not found domain={0} schedule id={1}", Status.BAD_REQUEST, Level.INFO),\r
-       INVALID_ATTRIBUTE("Invalid attribute {0}={1}", Status.BAD_REQUEST, Level.INFO),\r
-       MISSING_REQUIRED_ATTRIBUTE("Missing required attribute '{0}'", Status.BAD_REQUEST, Level.INFO),\r
-       INVALID_REQUEST("The input data structure is incorrect", Status.BAD_REQUEST, Level.INFO),\r
-       REQUEST_TIMED_OUT("Request timed out.", Status.INTERNAL_SERVER_ERROR, Level.ERROR),\r
-       UNEXPECTED_EXCEPTION("Unexpected exception encountered during processing. Please contact support : {0}", Status.INTERNAL_SERVER_ERROR, Level.ERROR),\r
-       UNDEFINED_DOMAIN_DATA_ATTRIBUTE("Domain data attribute not defined domain={0} name={1} value={2}", Status.BAD_REQUEST, Level.INFO),\r
-       UNDEFINED_FILTER_ATTRIBUTE("Undefined filter attribute {0}", Status.BAD_REQUEST, Level.INFO),\r
-       INVALID_DATE_FILTER("Invalid date filter provided {0}=(1}", Status.BAD_REQUEST, Level.INFO),\r
-       OPTIMIZER_QUARTZ_JOB("Quartz scheduling of OptimizerQuartzJob: {0}", Status.OK, Level.INFO),\r
-       OPTIMIZER_EXCEPTION("Exception making client call to optimizer {0}", Status.INTERNAL_SERVER_ERROR, Level.ERROR),\r
-       OPTIMIZER_CALLBACK_STATE_ERROR("Optimizer callback on schedule in invalid state. Should be {0} but was {1}.", Status.INTERNAL_SERVER_ERROR, Level.ERROR),\r
-       CHANGE_MANAGEMENT_GROUP_NOT_FOUND("ChangeManagementGroup not found on optimizer callback scheduleId={0} groupId={1}", Status.NOT_FOUND, Level.INFO),\r
-       INCOMING_MESSAGE("Incoming message method={0} path={1}", Status.OK, Level.INFO, true, false),\r
-       INCOMING_MESSAGE_RESPONSE("Message response method={0} path={1} status={2}", Status.OK, Level.INFO, true, false),\r
-       OUTGOING_MESSAGE("Outgoing message method={0} path={1}", Status.OK, Level.INFO, true, false),\r
-       OUTGOING_MESSAGE_RETURNED("Outgoing message returned method={0} path={1} status={2}", Status.OK, Level.INFO, true, false),\r
-\r
-    // TODO: Review the status and level of the remaining enums        \r
-       UNABLE_TO_ALLOCATE_VNF_TIMESLOTS("Unable to allocate VNF timeslots with Optimizer results startTime={0}, latestStartTime={1}, totalDuration={2}, concurrency={3} nvfs={4}", Status.OK, Level.INFO),\r
-       UNABLE_TO_LOCATE_SCHEDULE_DETAIL("Unable to locate ChangeManagementSchedule for VNF. scheduleId={0}, groupId={1}, vnfName={2}", Status.OK, Level.INFO),\r
-       CM_JOB("Quartz scheduling of CmJob: {0}", Status.OK, Level.INFO),\r
-       CM_QUARTZ_JOB("Quartz scheduling of CmQuartzJob: {0}", Status.OK, Level.INFO),\r
-       NOT_PENDING_APPROVAL("Approval request received for schedule that is not in Pending Approval state: domain={0} scheduleId={1} state={3}", Status.OK, Level.INFO),\r
-       SCHEDULE_PAST_DUE("Attempt to dispatch an event that is Past due scheduleId={0}, vnf={1}, now={2}, startTime={3}", Status.OK, Level.INFO),\r
-       MSO_POLLING_MISSING_SCHEDULE("Attempt to poll MSO for request id {1} for missing ChangeManagementSchedule id={0}", Status.OK, Level.INFO),\r
-       MSO_STATUS_JOB("Polling MSO {0} for requestId={1} for id={2}", Status.OK, Level.INFO),\r
-       UNEXPECTED_RESPONSE("Unexpected response from {0} HTTP Status={1} : {2}", Status.OK, Level.INFO),\r
-       SCHEDULE_STATUS_JOB("Quartz scheduling of ScheduleStatusJob: {0}", Status.OK, Level.INFO),\r
-       CM_TICKET_NOT_APPROVED("Attempt to dispatch a change management event that has no TM Ticket approved. scheduleId={0} VNF Name={1} TM ChangeId={2} Status={3} Approval Status={4}", Status.OK, Level.INFO),\r
-       MULTIPLE_GROUPS_NOT_SUPPORTED("Multiple groups not supported on immediate requests", Status.OK, Level.INFO),\r
-       TM_CREATE_CHANGE_RECORD("TM Create Change Record:{0} : Schedule ID: {1}", Status.OK, Level.INFO),\r
-       TM_LIST("TM list:{0} : URL : {1}", Status.OK, Level.INFO),\r
-       TM_API("TM API Call: URL : {0}", Status.OK, Level.INFO),\r
-       UNABLE_TO_CREATE_CHANGE_TICKET("Unable to create change ticket in TM: Schedule ID: {0} : Reason : {1}", Status.OK, Level.INFO),\r
-       TM_UPDATE_CHECKLIST("TM Fetch Checklist:{0} : Schedule ID: {1} : Change Id : {2} : URL : {3}", Status.OK, Level.INFO),\r
-       OPTIMIZER_REQUEST("Optimi Request:{0} : Schedule ID: {1} : URL : {2}", Status.OK, Level.INFO),\r
-       TM_CLOSE_CHANGE_RECORD("TM Close Change Record:{0} : Schedule ID: {1} : Change Id : {2}", Status.OK, Level.INFO),\r
-       UNABLE_TO_CLOSE_CHANGE_TICKET("Unable to close change ticket in TM:  Schedule ID: {0} : changeid: {1} :  Reason: {2}", Status.OK, Level.INFO),\r
-       CANNOT_CANCEL_IN_PROGRESS("Cannot delete/cancel a schedule with events in progress.", Status.OK, Level.INFO),\r
-       UNABLE_TO_PARSE_SCHEDULING_INFO("Cannot parse scheduling info.", Status.OK, Level.INFO),\r
-       UNABLE_TO_LOCATE_CHANGE_RECORD("Unable to locate TM change record {2} to check status before displacth of {1} for schedulId={0}", Status.OK, Level.INFO),\r
-       INVALID_CHANGE_WINDOW("Change window end time {1} must be after start time {0}", Status.OK, Level.INFO),\r
-       NODE_LIST_CONTAINS_EMTPY_NODE("vnfDetails node list contains at least one empty node.", Status.OK, Level.INFO),\r
-       SO_API("SO Poll Request {0}", Status.OK, Level.INFO),\r
-       EXPECTED_EXCEPTION("Expected exception encountered during processing. {0}", Status.OK, Level.INFO),\r
-       TM_UPDATE_CHANGE_RECORD("TM Update Change Record:{0} : Schedule ID: {1} : Change Id : {2} : URL : {3}", Status.OK, Level.INFO),\r
-       UNABLE_TO_UPDATE_CHANGE_TICKET("Unable to update change ticket in TM: Schedule ID: {0} : changeid: {1} :  Reason: {2}", Status.OK, Level.INFO),\r
-       UNAUTHORIZED("Authorization failed.", Status.FORBIDDEN, Level.INFO),\r
-       UNAUTHENTICATED("Authentication failed.", Status.UNAUTHORIZED, Level.INFO), \r
-       UNRECOGNIZED_MSO_STATUS("Unrecognized status returned by MSO {0}", Status.INTERNAL_SERVER_ERROR, Level.ERROR),\r
-       UNABLE_TO_PARSE_MSO_RESPONSE("Unable to parse status message from MSO {0} : {1}", Status.INTERNAL_SERVER_ERROR, Level.ERROR),\r
-       ;\r
-       private final String defaultId;\r
-       private final String defaultMessage;\r
-       private final String defaultResolution;\r
-       private final String defaultAction;\r
-\r
-       private final Status status;\r
-       private final Level level;\r
-       private final Boolean audit;\r
-       private final Boolean metric;\r
-\r
-       \r
-       private LogMessages(String message, Status code, Level l)\r
-       {\r
-               defaultMessage = message;\r
-               level=l;\r
-               status = code;\r
-               this.defaultId = this.name();\r
-               this.defaultResolution = "No resolution needed";\r
-               this.defaultAction = "No action is required";\r
-               this.audit = false;\r
-               this.metric = false;\r
-       }\r
-\r
-       private LogMessages(String message, Status code, Level l, Boolean audit, Boolean metric)\r
-       {\r
-               defaultMessage = message;\r
-               level=l;\r
-               status = code;\r
-               this.audit = audit;\r
-               this.metric = metric;\r
-               this.defaultId = this.name();\r
-               this.defaultResolution = "No resolution needed";\r
-               this.defaultAction = "No action is required";\r
-       }\r
-       \r
-       private LogMessages(String message, Status code, Level l, String id, String resolution, String action)\r
-       {\r
-               level=l;\r
-               status = code;\r
-               defaultMessage = message;\r
-               this.defaultId = id;\r
-               this.defaultResolution = resolution;\r
-               this.defaultAction = action;\r
-               this.audit = false;\r
-               this.metric = false;\r
-       }\r
-       \r
-       static {\r
-               EELFResourceManager.loadMessageBundle("logmessages");\r
-       }\r
-       \r
-       public String genProperties()\r
-       {\r
-               // Use this to regenerate properties file. The desire to change messages without updating code is\r
-               // well understood, but the developer should be able to code the defaults without having to update 2 different files and \r
-               // get it wrong. \r
-               StringBuilder sb = new StringBuilder();\r
-               sb.append("# Generated from ").append(this.getClass().getName()).append("\n");\r
-               for (LogMessages lm : values())\r
-               {\r
-                       sb.append(lm.name());\r
-                       sb.append(" ").append(lm.defaultId);\r
-                       sb.append("|").append(lm.defaultMessage);\r
-                       sb.append("|").append(lm.defaultResolution);\r
-                       sb.append("|").append(lm.defaultAction);\r
-                       sb.append("\n");\r
-               }\r
-               return sb.toString();\r
-       }\r
-\r
-       \r
-       // interface methods\r
-       @Override\r
-       public Level getLevel() {return level;}\r
-       @Override\r
-       public String getMessage() {return defaultMessage;}\r
-       @Override\r
-       public Status getStatus() {return status;}\r
-       @Override\r
-       public Enum<?> getValue() {return this;}\r
-       @Override\r
-       public String getDomain() {return this.getClass().getSimpleName();}\r
-       @Override\r
-       public Boolean getAudit() { return audit; }\r
-       @Override\r
-       public Boolean getMetric() { return metric; }\r
-       \r
-       public static void main(String argv[])\r
-       {\r
-               System.out.println(LogMessages.UNEXPECTED_EXCEPTION.genProperties());\r
-               try \r
-               {\r
-                       Files.write(Paths.get("src/main/resources/logmessages.properties"), LogMessages.UNEXPECTED_EXCEPTION.genProperties().getBytes());\r
-               } \r
-               catch (IOException e) \r
-               {\r
-                       EELFManager.getInstance().getDebugLogger().debug("Failed to update properties file.", e);\r
-\r
-               }\r
-               StringBuilder sb = new StringBuilder();\r
-               sb.append("<html><body><h1>Cell Site Selection Scheduler mS Observations</h1>\n<table border=\"1\">\n<tr>");\r
-               sb.append("<td>Code</td> ");\r
-               sb.append("<td>Log Level</td> ");\r
-               sb.append("<td>Message</td> ");\r
-               sb.append("</tr>\n");\r
-               for (LogMessages m : LogMessages.values())\r
-               {\r
-                       if (m.level == Level.ERROR || m.level == Level.WARN || m.level == Level.FATAL)\r
-                       {\r
-                               sb.append("<tr>");\r
-                               sb.append("<td>").append(m.name()).append("</td> ");\r
-                               sb.append("<td>").append(m.level).append("</td> ");\r
-                               sb.append("<td>").append(m.defaultMessage).append("</td> ");\r
-                               sb.append("</tr>\n");\r
-                       }\r
-               }\r
-               try \r
-               {\r
-                       Files.write(Paths.get("logmessages.html"), sb.toString().getBytes());\r
-               } \r
-               catch (IOException e) \r
-               {\r
-                       EELFManager.getInstance().getDebugLogger().debug("Failed to update properties html file.", e);\r
-\r
-               }\r
-                               \r
-       }\r
+    SEARCH_SCHEDULE_REQUEST_DETAILS("Search Schedule Request Details {0} from {1}: {2}", Status.OK, Level.INFO),\r
+    SEARCH_SCHEDULE_REQUEST("Search Schedule Request {0} from {1}: {2} : {3}", Status.OK, Level.INFO),\r
+    CREATE_SCHEDULE_REQUEST("Create Schedule Request {0} from {1}: {2} : {3}", Status.OK, Level.INFO),\r
+    DELETE_SCHEDULE_REQUEST("Delete Schedule Request {0} from {1}: {2} : {3}", Status.OK, Level.INFO),\r
+    GET_SCHEDULE_REQUEST_INFO("Get Schedule Request Info {0} from {1}: {2} : {3}", Status.OK, Level.INFO),\r
+    PROCESS_OPTIMIZER_CALLBACK("Change management optimizer callback {0} from {1}: {2} ", Status.OK, Level.INFO),\r
+    APPROVE_SCHEDULE_REQUEST("Approve Schedule Request {0} from {1}: {2} : {3}", Status.OK, Level.INFO),\r
+    SCHEDULE_ALREADY_EXISTS("Schedule already exists domain={0} schedule id={1}", Status.OK, Level.INFO),\r
+    SCHEDULE_NOT_FOUND("Schedule not found domain={0} schedule id={1}", Status.BAD_REQUEST, Level.INFO),\r
+    INVALID_ATTRIBUTE("Invalid attribute {0}={1}", Status.BAD_REQUEST, Level.INFO),\r
+    MISSING_REQUIRED_ATTRIBUTE("Missing required attribute '{0}'", Status.BAD_REQUEST, Level.INFO),\r
+    INVALID_REQUEST("The input data structure is incorrect", Status.BAD_REQUEST, Level.INFO),\r
+    REQUEST_TIMED_OUT("Request timed out.", Status.INTERNAL_SERVER_ERROR, Level.ERROR),\r
+    UNEXPECTED_EXCEPTION("Unexpected exception encountered during processing. Please contact support : {0}",\r
+                    Status.INTERNAL_SERVER_ERROR, Level.ERROR),\r
+    UNDEFINED_DOMAIN_DATA_ATTRIBUTE("Domain data attribute not defined domain={0} name={1} value={2}",\r
+                    Status.BAD_REQUEST, Level.INFO),\r
+    UNDEFINED_FILTER_ATTRIBUTE("Undefined filter attribute {0}", Status.BAD_REQUEST, Level.INFO),\r
+    INVALID_DATE_FILTER("Invalid date filter provided {0}=(1}", Status.BAD_REQUEST, Level.INFO),\r
+    OPTIMIZER_QUARTZ_JOB("Quartz scheduling of OptimizerQuartzJob: {0}", Status.OK, Level.INFO),\r
+    OPTIMIZER_EXCEPTION("Exception making client call to optimizer {0}", Status.INTERNAL_SERVER_ERROR, Level.ERROR),\r
+    OPTIMIZER_CALLBACK_STATE_ERROR("Optimizer callback on schedule in invalid state. Should be {0} but was {1}.",\r
+                    Status.INTERNAL_SERVER_ERROR, Level.ERROR),\r
+    CHANGE_MANAGEMENT_GROUP_NOT_FOUND(\r
+                    "ChangeManagementGroup not found on optimizer callback scheduleId={0} groupId={1}",\r
+                    Status.NOT_FOUND, Level.INFO),\r
+    INCOMING_MESSAGE("Incoming message method={0} path={1}", Status.OK, Level.INFO, true, false),\r
+    INCOMING_MESSAGE_RESPONSE("Message response method={0} path={1} status={2}", Status.OK, Level.INFO, true, false),\r
+    OUTGOING_MESSAGE("Outgoing message method={0} path={1}", Status.OK, Level.INFO, true, false),\r
+    OUTGOING_MESSAGE_RETURNED("Outgoing message returned method={0} path={1} status={2}", Status.OK, Level.INFO, true,\r
+                    false),\r
+\r
+    // TODO: Review the status and level of the remaining enums\r
+    UNABLE_TO_ALLOCATE_VNF_TIMESLOTS(\r
+                    "Unable to allocate VNF timeslots with Optimizer results startTime={0},"\r
+                    + " latestStartTime={1}, totalDuration={2}, concurrency={3} nvfs={4}",\r
+                    Status.OK, Level.INFO),\r
+    UNABLE_TO_LOCATE_SCHEDULE_DETAIL(\r
+                    "Unable to locate ChangeManagementSchedule for VNF. scheduleId={0}, groupId={1}, vnfName={2}",\r
+                    Status.OK, Level.INFO),\r
+    CM_JOB("Quartz scheduling of CmJob: {0}", Status.OK, Level.INFO),\r
+    CM_QUARTZ_JOB("Quartz scheduling of CmQuartzJob: {0}", Status.OK, Level.INFO),\r
+    NOT_PENDING_APPROVAL(\r
+                    "Approval request received for schedule that is not in Pending Approval state:"\r
+                    + " domain={0} scheduleId={1} state={3}",\r
+                    Status.OK, Level.INFO),\r
+    SCHEDULE_PAST_DUE("Attempt to dispatch an event that is Past due scheduleId={0}, vnf={1}, now={2}, startTime={3}",\r
+                    Status.OK, Level.INFO),\r
+    MSO_POLLING_MISSING_SCHEDULE("Attempt to poll MSO for request id {1} for missing ChangeManagementSchedule id={0}",\r
+                    Status.OK, Level.INFO),\r
+    MSO_STATUS_JOB("Polling MSO {0} for requestId={1} for id={2}", Status.OK, Level.INFO),\r
+    UNEXPECTED_RESPONSE("Unexpected response from {0} HTTP Status={1} : {2}", Status.OK, Level.INFO),\r
+    SCHEDULE_STATUS_JOB("Quartz scheduling of ScheduleStatusJob: {0}", Status.OK, Level.INFO),\r
+    CM_TICKET_NOT_APPROVED(\r
+                    "Attempt to dispatch a change management event that has no TM Ticket approved."\r
+                    + "scheduleId={0} VNF Name={1} TM ChangeId={2} Status={3} Approval Status={4}",\r
+                    Status.OK, Level.INFO),\r
+    MULTIPLE_GROUPS_NOT_SUPPORTED("Multiple groups not supported on immediate requests", Status.OK, Level.INFO),\r
+    TM_CREATE_CHANGE_RECORD("TM Create Change Record:{0} : Schedule ID: {1}", Status.OK, Level.INFO),\r
+    TM_LIST("TM list:{0} : URL : {1}", Status.OK, Level.INFO),\r
+    TM_API("TM API Call: URL : {0}", Status.OK, Level.INFO),\r
+    UNABLE_TO_CREATE_CHANGE_TICKET("Unable to create change ticket in TM: Schedule ID: {0} : Reason : {1}", Status.OK,\r
+                    Level.INFO),\r
+    TM_UPDATE_CHECKLIST("TM Fetch Checklist:{0} : Schedule ID: {1} : Change Id : {2} : URL : {3}", Status.OK,\r
+                    Level.INFO),\r
+    OPTIMIZER_REQUEST("Optimi Request:{0} : Schedule ID: {1} : URL : {2}", Status.OK, Level.INFO),\r
+    TM_CLOSE_CHANGE_RECORD("TM Close Change Record:{0} : Schedule ID: {1} : Change Id : {2}", Status.OK, Level.INFO),\r
+    UNABLE_TO_CLOSE_CHANGE_TICKET(\r
+                    "Unable to close change ticket in TM:  Schedule ID: {0} : changeid: {1} :  Reason: {2}", Status.OK,\r
+                    Level.INFO),\r
+    CANNOT_CANCEL_IN_PROGRESS("Cannot delete/cancel a schedule with events in progress.", Status.OK, Level.INFO),\r
+    UNABLE_TO_PARSE_SCHEDULING_INFO("Cannot parse scheduling info.", Status.OK, Level.INFO),\r
+    UNABLE_TO_LOCATE_CHANGE_RECORD(\r
+                    "Unable to locate TM change record {2} to check status before displacth of {1} for schedulId={0}",\r
+                    Status.OK, Level.INFO),\r
+    INVALID_CHANGE_WINDOW("Change window end time {1} must be after start time {0}", Status.OK, Level.INFO),\r
+    NODE_LIST_CONTAINS_EMTPY_NODE("vnfDetails node list contains at least one empty node.", Status.OK, Level.INFO),\r
+    SO_API("SO Poll Request {0}", Status.OK, Level.INFO),\r
+    EXPECTED_EXCEPTION("Expected exception encountered during processing. {0}", Status.OK, Level.INFO),\r
+    TM_UPDATE_CHANGE_RECORD("TM Update Change Record:{0} : Schedule ID: {1} : Change Id : {2} : URL : {3}", Status.OK,\r
+                    Level.INFO),\r
+    UNABLE_TO_UPDATE_CHANGE_TICKET(\r
+                    "Unable to update change ticket in TM: Schedule ID: {0} : changeid: {1} :  Reason: {2}", Status.OK,\r
+                    Level.INFO),\r
+    UNAUTHORIZED("Authorization failed.", Status.FORBIDDEN, Level.INFO),\r
+    UNAUTHENTICATED("Authentication failed.", Status.UNAUTHORIZED, Level.INFO),\r
+    UNRECOGNIZED_MSO_STATUS("Unrecognized status returned by MSO {0}", Status.INTERNAL_SERVER_ERROR, Level.ERROR),\r
+    UNABLE_TO_PARSE_MSO_RESPONSE("Unable to parse status message from MSO {0} : {1}", Status.INTERNAL_SERVER_ERROR,\r
+                    Level.ERROR),\r
+    MISSING_VALID_GROUP_FOR_ELEMENT("Element {0} returned by optimizer has invalid group id",\r
+                    Status.INTERNAL_SERVER_ERROR, Level.ERROR),;\r
+    private final String defaultId;\r
+    private final String defaultMessage;\r
+    private final String defaultResolution;\r
+    private final String defaultAction;\r
+\r
+    private final Status status;\r
+    private final Level level;\r
+    private final Boolean audit;\r
+    private final Boolean metric;\r
+\r
+\r
+    private LogMessages(String message, Status code, Level lev) {\r
+        defaultMessage         = message;\r
+        level                  = lev;\r
+        status                 = code;\r
+        this.defaultId         = this.name();\r
+        this.defaultResolution = "No resolution needed";\r
+        this.defaultAction     = "No action is required";\r
+        this.audit             = false;\r
+        this.metric            = false;\r
+    }\r
+\r
+    private LogMessages(String message, Status code, Level lev, Boolean audit, Boolean metric) {\r
+        defaultMessage         = message;\r
+        level                  = lev;\r
+        status                 = code;\r
+        this.audit             = audit;\r
+        this.metric            = metric;\r
+        this.defaultId         = this.name();\r
+        this.defaultResolution = "No resolution needed";\r
+        this.defaultAction     = "No action is required";\r
+    }\r
+\r
+    private LogMessages(String message, Status code, Level lev, String id, String resolution, String action) {\r
+        level                  = lev;\r
+        status                 = code;\r
+        defaultMessage         = message;\r
+        this.defaultId         = id;\r
+        this.defaultResolution = resolution;\r
+        this.defaultAction     = action;\r
+        this.audit             = false;\r
+        this.metric            = false;\r
+    }\r
+\r
+    static {\r
+        EELFResourceManager.loadMessageBundle("logmessages");\r
+    }\r
+\r
+    /**\r
+     * Gen properties.\r
+     *\r
+     * @return the string\r
+     */\r
+    public String genProperties() {\r
+        // Use this to regenerate properties file. The desire to change messages without updating code is\r
+        // well understood, but the developer should be able to code the defaults without having to update 2\r
+        // different files and\r
+        // get it wrong.\r
+        StringBuilder sb = new StringBuilder();\r
+        sb.append("# Generated from ").append(this.getClass().getName()).append("\n");\r
+        for (LogMessages lm : values()) {\r
+            sb.append(lm.name());\r
+            sb.append(" ").append(lm.defaultId);\r
+            sb.append("|").append(lm.defaultMessage);\r
+            sb.append("|").append(lm.defaultResolution);\r
+            sb.append("|").append(lm.defaultAction);\r
+            sb.append("\n");\r
+        }\r
+        return sb.toString();\r
+    }\r
+\r
+\r
+    /**\r
+     * Gets the level.\r
+     *\r
+     * @return the level\r
+     */\r
+    // interface methods\r
+    @Override\r
+    public Level getLevel() {\r
+        return level;\r
+    }\r
+\r
+    /**\r
+     * Gets the message.\r
+     *\r
+     * @return the message\r
+     */\r
+    @Override\r
+    public String getMessage() {\r
+        return defaultMessage;\r
+    }\r
+\r
+    /**\r
+     * Gets the status.\r
+     *\r
+     * @return the status\r
+     */\r
+    @Override\r
+    public Status getStatus() {\r
+        return status;\r
+    }\r
+\r
+    /**\r
+     * Gets the value.\r
+     *\r
+     * @return the value\r
+     */\r
+    @Override\r
+    public Enum<?> getValue() {\r
+        return this;\r
+    }\r
+\r
+    /**\r
+     * Gets the domain.\r
+     *\r
+     * @return the domain\r
+     */\r
+    @Override\r
+    public String getDomain() {\r
+        return this.getClass().getSimpleName();\r
+    }\r
+\r
+    /**\r
+     * Gets the audit.\r
+     *\r
+     * @return the audit\r
+     */\r
+    @Override\r
+    public Boolean getAudit() {\r
+        return audit;\r
+    }\r
+\r
+    /**\r
+     * Gets the metric.\r
+     *\r
+     * @return the metric\r
+     */\r
+    @Override\r
+    public Boolean getMetric() {\r
+        return metric;\r
+    }\r
+\r
+    /**\r
+     * The main method.\r
+     *\r
+     * @param argv the arguments\r
+     */\r
+    public static void main(String[] argv) {\r
+        System.out.println(LogMessages.UNEXPECTED_EXCEPTION.genProperties());\r
+        try {\r
+            Files.write(Paths.get("src/main/resources/logmessages.properties"),\r
+                            LogMessages.UNEXPECTED_EXCEPTION.genProperties().getBytes());\r
+        } catch (IOException e) {\r
+            EELFManager.getInstance().getDebugLogger().debug("Failed to update properties file.", e);\r
+\r
+        }\r
+        StringBuilder sb = new StringBuilder();\r
+        sb.append("<html><body><h1>Cell Site Selection Scheduler mS Observations</h1>\n<table border=\"1\">\n<tr>");\r
+        sb.append("<td>Code</td> ");\r
+        sb.append("<td>Log Level</td> ");\r
+        sb.append("<td>Message</td> ");\r
+        sb.append("</tr>\n");\r
+        for (LogMessages m : LogMessages.values()) {\r
+            if (m.level == Level.ERROR || m.level == Level.WARN || m.level == Level.FATAL) {\r
+                sb.append("<tr>");\r
+                sb.append("<td>").append(m.name()).append("</td> ");\r
+                sb.append("<td>").append(m.level).append("</td> ");\r
+                sb.append("<td>").append(m.defaultMessage).append("</td> ");\r
+                sb.append("</tr>\n");\r
+            }\r
+        }\r
+        try {\r
+            Files.write(Paths.get("logmessages.html"), sb.toString().getBytes());\r
+        } catch (IOException e) {\r
+            EELFManager.getInstance().getDebugLogger().debug("Failed to update properties html file.", e);\r
+\r
+        }\r
+\r
+    }\r
 \r
 }\r
index 19927ad..d726107 100644 (file)
@@ -1,27 +1,27 @@
 /*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright © 2018 IBM.\r
- * \r
+ * Copyright Â© 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright Â© 2018 IBM.\r
+ *\r
  * Licensed under the Apache License, Version 2.0 (the "License");\r
  * you may not use this file except in compliance with the License.\r
  * You may obtain a copy of the License at\r
- * \r
+ *\r
  *         http://www.apache.org/licenses/LICENSE-2.0\r
- * \r
+ *\r
  * Unless required by applicable law or agreed to in writing, software\r
  * distributed under the License is distributed on an "AS IS" BASIS,\r
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
  * See the License for the specific language governing permissions and\r
  * limitations under the License.\r
- * \r
- * \r
+ *\r
+ *\r
  * Unless otherwise specified, all documentation contained herein is licensed\r
  * under the Creative Commons License, Attribution 4.0 Intl. (the "License");\r
  * you may not use this documentation except in compliance with the License.\r
  * You may obtain a copy of the License at\r
- * \r
+ *\r
  *         https://creativecommons.org/licenses/by/4.0/\r
- * \r
+ *\r
  * Unless required by applicable law or agreed to in writing, documentation\r
  * distributed under the License is distributed on an "AS IS" BASIS,\r
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
 \r
 package org.onap.optf.cmso.dispatcher;\r
 \r
+import com.att.eelf.configuration.EELFLogger;\r
+import com.att.eelf.configuration.EELFManager;\r
+import com.fasterxml.jackson.databind.JsonNode;\r
+import com.fasterxml.jackson.databind.ObjectMapper;\r
 import javax.ws.rs.ProcessingException;\r
 import javax.ws.rs.client.Client;\r
 import javax.ws.rs.client.ClientBuilder;\r
@@ -42,16 +46,14 @@ import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;\r
 import org.onap.optf.cmso.common.BasicAuthenticatorFilter;\r
 import org.onap.optf.cmso.common.CMSStatusEnum;\r
-import org.onap.optf.cmso.common.CmHelpers;\r
 import org.onap.optf.cmso.common.LogMessages;\r
 import org.onap.optf.cmso.common.PropertiesManagement;\r
-import org.onap.optf.cmso.filters.CMSOClientFilters;\r
+import org.onap.optf.cmso.filters.CmsoClientFilters;\r
 import org.onap.optf.cmso.model.ChangeManagementSchedule;\r
 import org.onap.optf.cmso.model.Schedule;\r
 import org.onap.optf.cmso.model.dao.ChangeManagementGroupDAO;\r
 import org.onap.optf.cmso.model.dao.ChangeManagementScheduleDAO;\r
 import org.onap.optf.cmso.model.dao.ScheduleDAO;\r
-import org.onap.optf.cmso.service.rs.models.CmDomainDataEnum;\r
 import org.onap.optf.cmso.ticketmgt.TmClient;\r
 import org.onap.optf.cmso.wf.bean.WfChangeManagementResponse;\r
 import org.onap.optf.cmso.wf.bean.WfVidCmResponse;\r
@@ -60,10 +62,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;\r
 import org.springframework.stereotype.Component;\r
 import org.springframework.transaction.annotation.Transactional;\r
-import com.att.eelf.configuration.EELFLogger;\r
-import com.att.eelf.configuration.EELFManager;\r
-import com.fasterxml.jackson.databind.JsonNode;\r
-import com.fasterxml.jackson.databind.ObjectMapper;\r
 \r
 @Component\r
 public class CMSOClient {\r
@@ -81,6 +79,7 @@ public class CMSOClient {
     @Autowired\r
     ScheduleDAO scheduleDAO;\r
 \r
+\r
     @Autowired\r
     Environment env;\r
 \r
@@ -97,13 +96,13 @@ public class CMSOClient {
             if (!url.endsWith("/"))\r
                 url += "/";\r
             url = url + "schedule/" + cmSchedule.getVnfName();\r
-            String callbackData = CmHelpers.getDomainData(schedule, CmDomainDataEnum.CallbackData);\r
+            String callbackData = cmSchedule.getRequest();\r
             String user = env.getProperty("so.user", "");\r
             String pass = pm.getProperty("so.pass", "");\r
             Client client = ClientBuilder.newClient();\r
             if (!user.equals(""))\r
                 client.register(new BasicAuthenticatorFilter(user, pass));\r
-            client.register(new CMSOClientFilters());\r
+            client.register(new CmsoClientFilters());\r
             WebTarget target = client.target(url);\r
             ObjectMapper om = new ObjectMapper();\r
             JsonNode jsonEntity = om.readTree(callbackData);\r
index f29d6c6..8766eee 100644 (file)
@@ -46,7 +46,7 @@ import org.onap.optf.cmso.common.BasicAuthenticatorFilter;
 import org.onap.optf.cmso.common.LogMessages;\r
 import org.onap.optf.cmso.common.PropertiesManagement;\r
 import org.onap.optf.cmso.eventq.DispatchedEventList;\r
-import org.onap.optf.cmso.filters.CMSOClientFilters;\r
+import org.onap.optf.cmso.filters.CmsoClientFilters;\r
 import org.onap.optf.cmso.model.dao.ChangeManagementGroupDAO;\r
 import org.onap.optf.cmso.model.dao.ChangeManagementScheduleDAO;\r
 import org.onap.optf.cmso.model.dao.ScheduleDAO;\r
@@ -126,7 +126,7 @@ public class CmJob implements Job {
             String pass = pm.getProperty("mechid.pass", "");\r
             Client client = ClientBuilder.newClient();\r
             client.register(new BasicAuthenticatorFilter(user, pass));\r
-                       client.register(new CMSOClientFilters());\r
+                       client.register(new CmsoClientFilters());\r
             WebTarget target = client.target(url);\r
             Invocation.Builder invocationBuilder = target.request(MediaType.APPLICATION_JSON);\r
             Response response = null;\r
index feea350..92bb3f3 100644 (file)
@@ -1,27 +1,27 @@
 /*\r
  * Copyright © 2017-2019 AT&T Intellectual Property.\r
  * Modifications Copyright © 2018 IBM.\r
- * \r
+ *\r
  * Licensed under the Apache License, Version 2.0 (the "License");\r
  * you may not use this file except in compliance with the License.\r
  * You may obtain a copy of the License at\r
- * \r
+ *\r
  *         http://www.apache.org/licenses/LICENSE-2.0\r
- * \r
+ *\r
  * Unless required by applicable law or agreed to in writing, software\r
  * distributed under the License is distributed on an "AS IS" BASIS,\r
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
  * See the License for the specific language governing permissions and\r
  * limitations under the License.\r
- * \r
- * \r
+ *\r
+ *\r
  * Unless otherwise specified, all documentation contained herein is licensed\r
  * under the Creative Commons License, Attribution 4.0 Intl. (the "License");\r
  * you may not use this documentation except in compliance with the License.\r
  * You may obtain a copy of the License at\r
- * \r
+ *\r
  *         https://creativecommons.org/licenses/by/4.0/\r
- * \r
+ *\r
  * Unless required by applicable law or agreed to in writing, documentation\r
  * distributed under the License is distributed on an "AS IS" BASIS,\r
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
 \r
 package org.onap.optf.cmso.dispatcher.rs;\r
 \r
+import com.att.eelf.configuration.EELFLogger;\r
+import com.att.eelf.configuration.EELFManager;\r
 import java.util.UUID;\r
-\r
 import javax.servlet.http.HttpServletRequest;\r
 import javax.ws.rs.core.Response;\r
 import javax.ws.rs.core.UriInfo;\r
-\r
 import org.onap.optf.cmso.common.LogMessages;\r
 import org.onap.optf.cmso.dispatcher.DispatchJob;\r
-import org.onap.optf.cmso.optimizer.CMSOptimizerClient;\r
+import org.onap.optf.cmso.optimizer.CmsoOptimizerClient;\r
 import org.onap.optf.cmso.sostatus.MsoStatusClient;\r
 import org.onap.optf.cmso.ticketmgt.TmStatusClient;\r
 import org.springframework.beans.factory.annotation.Autowired;\r
 import org.springframework.stereotype.Controller;\r
 import org.springframework.transaction.annotation.Transactional;\r
 \r
-import com.att.eelf.configuration.EELFLogger;\r
-import com.att.eelf.configuration.EELFManager;\r
-\r
 @Controller\r
 public class DispatcherServiceImpl implements DispacherService {\r
     private static EELFLogger log = EELFManager.getInstance().getLogger(DispatcherServiceImpl.class);\r
@@ -60,7 +57,7 @@ public class DispatcherServiceImpl implements DispacherService {
     DispatchJob dispatchJob;\r
 \r
     @Autowired\r
-    CMSOptimizerClient optimizerClient;\r
+    CmsoOptimizerClient optimizerClient;\r
 \r
     @Autowired\r
     TmStatusClient tmStatusClient;\r
@@ -95,7 +92,7 @@ public class DispatcherServiceImpl implements DispacherService {
             debug.error(e.getMessage(), e);\r
         }\r
         Response response = Response.ok().build();\r
-        audit.info("dispatchSNIRO");\r
+        audit.info("dispatchOptimizer");\r
         return response;\r
     }\r
 \r
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/filters/CMSOClientFilters.java b/cmso-service/src/main/java/org/onap/optf/cmso/filters/CMSOClientFilters.java
deleted file mode 100644 (file)
index 5e29607..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*\r
- * Copyright © 2017-2019 AT&T Intellectual Property.\r
- * Modifications Copyright © 2018 IBM.\r
- * \r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- * \r
- *         http://www.apache.org/licenses/LICENSE-2.0\r
- * \r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- * \r
- * \r
- * Unless otherwise specified, all documentation contained herein is licensed\r
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");\r
- * you may not use this documentation except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- * \r
- *         https://creativecommons.org/licenses/by/4.0/\r
- * \r
- * Unless required by applicable law or agreed to in writing, documentation\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
-*/\r
-\r
-package org.onap.optf.cmso.filters;\r
-\r
-import static com.att.eelf.configuration.Configuration.MDC_KEY_REQUEST_ID;\r
-\r
-import java.io.IOException;\r
-\r
-import javax.ws.rs.client.ClientRequestContext;\r
-import javax.ws.rs.client.ClientRequestFilter;\r
-import javax.ws.rs.client.ClientResponseContext;\r
-import javax.ws.rs.client.ClientResponseFilter;\r
-import javax.ws.rs.core.MultivaluedMap;\r
-\r
-import org.onap.observations.Mdc;\r
-import org.onap.observations.Observation;\r
-import org.onap.optf.cmso.common.LogMessages;\r
-import org.onap.optf.cmso.filters.MessageHeaders.HeadersEnum;\r
-import org.onap.optf.cmso.service.rs.CMSOServiceImpl;\r
-import org.slf4j.MDC;\r
-import org.springframework.stereotype.Component;\r
-\r
-import com.att.eelf.configuration.EELFLogger;\r
-import com.att.eelf.configuration.EELFManager;\r
-\r
-// @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")\r
-@Component\r
-public class CMSOClientFilters implements ClientRequestFilter, ClientResponseFilter {\r
-\r
-    private static EELFLogger log = EELFManager.getInstance().getLogger(CMSOServiceImpl.class);\r
-    private static String appId = "cmso";\r
-\r
-    @Override\r
-    public void filter(ClientRequestContext requestContext, ClientResponseContext responseContext) throws IOException {\r
-               // On the way back\r
-               Mdc.metricEnd(responseContext);\r
-               Mdc.setCaller(17);\r
-               Observation.report(LogMessages.OUTGOING_MESSAGE_RETURNED, \r
-                               requestContext.getMethod(),\r
-                               requestContext.getUri().getPath().toString(),\r
-                               responseContext.getStatusInfo().toString());\r
-    }\r
-\r
-    @Override\r
-    public void filter(ClientRequestContext requestContext) throws IOException {\r
-               // On the way out \r
-               Mdc.metricStart(requestContext);\r
-               Mdc.setCaller(17);\r
-               Observation.report(LogMessages.OUTGOING_MESSAGE, \r
-                               requestContext.getMethod(),\r
-                               requestContext.getUri().getPath().toString());\r
-        MultivaluedMap<String, Object> headers = requestContext.getHeaders();\r
-\r
-        String transactionId = (String) headers.getFirst(MessageHeaders.HeadersEnum.TransactionID.toString());\r
-        String mdcId = MDC.get(MDC_KEY_REQUEST_ID);\r
-        if (transactionId == null || transactionId.equals(""))\r
-            if (mdcId != null)\r
-                headers.add(HeadersEnum.TransactionID.toString(), mdcId);\r
-        headers.add(HeadersEnum.FromAppID.toString(), appId);\r
-    }\r
-\r
-}\r