Changes for checkstyle warnings 42/84142/2
authorJerry Flood <jflood@att.com>
Wed, 3 Apr 2019 20:26:26 +0000 (16:26 -0400)
committerJerry Flood <jflood@att.com>
Wed, 3 Apr 2019 20:46:40 +0000 (16:46 -0400)
Issue-ID: OPTFRA-466
Change-Id: I2b9cea2c7e2cc760a20715b63618fe75ea58f029
Signed-off-by: Jerry Flood <jflood@att.com>
47 files changed:
cmso-service/src/main/docker/assembly/cmso-files.xml
cmso-service/src/main/java/org/onap/observations/Mdc.java
cmso-service/src/main/java/org/onap/optf/cmso/ApplicationPropertiesFiles.java
cmso-service/src/main/java/org/onap/optf/cmso/AutowiringSpringBeanJobFactory.java
cmso-service/src/main/java/org/onap/optf/cmso/aaf/AafUserRole.java
cmso-service/src/main/java/org/onap/optf/cmso/common/ApprovalStatusEnum.java
cmso-service/src/main/java/org/onap/optf/cmso/common/ApprovalTypesEnum.java
cmso-service/src/main/java/org/onap/optf/cmso/common/BasicAuthenticatorFilter.java
cmso-service/src/main/java/org/onap/optf/cmso/common/CMSRequestError.java
cmso-service/src/main/java/org/onap/optf/cmso/common/CMSStatusEnum.java
cmso-service/src/main/java/org/onap/optf/cmso/common/CmHelpers.java
cmso-service/src/main/java/org/onap/optf/cmso/common/Mdc.java
cmso-service/src/main/java/org/onap/optf/cmso/common/PropertiesManagement.java
cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/CmJob.java
cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/DispatchJob.java
cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/rs/DispacherService.java
cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/rs/DispatcherServiceImpl.java
cmso-service/src/main/java/org/onap/optf/cmso/eventq/CMSQueueJob.java
cmso-service/src/main/java/org/onap/optf/cmso/eventq/CmQuartzJob.java
cmso-service/src/main/java/org/onap/optf/cmso/eventq/CmQuartzJobStartup.java
cmso-service/src/main/java/org/onap/optf/cmso/filters/CmsoClientFilters.java
cmso-service/src/main/java/org/onap/optf/cmso/filters/CmsoContainerFilters.java
cmso-service/src/main/java/org/onap/optf/cmso/filters/MessageHeaders.java
cmso-service/src/main/java/org/onap/optf/cmso/model/ChangeManagementDetail.java
cmso-service/src/main/java/org/onap/optf/cmso/model/Domain.java
cmso-service/src/main/java/org/onap/optf/cmso/model/Schedule.java
cmso-service/src/main/java/org/onap/optf/cmso/model/ScheduleApproval.java
cmso-service/src/main/java/org/onap/optf/cmso/model/dao/ChangeManagementChangeWindowDAO.java
cmso-service/src/main/java/org/onap/optf/cmso/model/dao/ChangeManagementGroupDAO.java
cmso-service/src/main/java/org/onap/optf/cmso/model/dao/ChangeManagementScheduleDAO.java
cmso-service/src/main/java/org/onap/optf/cmso/model/dao/ScheduleDAO.java
cmso-service/src/main/java/org/onap/optf/cmso/model/dao/ScheduleQueryDAOImpl.java
cmso-service/src/main/java/org/onap/optf/cmso/optimizer/CmsoOptimizerClient.java
cmso-service/src/main/java/org/onap/optf/cmso/optimizer/CmsoOptimizerHandler.java
cmso-service/src/main/java/org/onap/optf/cmso/optimizer/OptimizerQuartzJob.java
cmso-service/src/main/java/org/onap/optf/cmso/service/rs/BaseSchedulerServiceImpl.java
cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmsoOptimizerCallbackImpl.java
cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmsoServiceImpl.java
cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CommonServiceImpl.java
cmso-service/src/main/java/org/onap/optf/cmso/service/rs/HealthCheckImpl.java
cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/ApprovalMessage.java
cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/CMSInfo.java
cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/CMSMessage.java
cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/ChangeWindowMessage.java
cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/CmDetailsMessage.java
cmso-service/src/main/java/org/onap/optf/cmso/test/loopback/TicketMgtLoopbackService.java
cmso-service/src/main/java/org/onap/optf/cmso/ticketmgt/TmStatusClient.java

index 6dcf422..ff67b66 100644 (file)
@@ -1,5 +1,5 @@
 <!-- ============LICENSE_START======================================================= 
-       ECOMP CMSO ================================================================================ 
+       CMSO ================================================================================ 
        Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. ================================================================================ 
        Licensed under the Apache License, Version 2.0 (the "License"); you may not 
        use this file except in compliance with the License. You may obtain a copy 
index b9b30ea..28d0ec8 100644 (file)
@@ -60,7 +60,7 @@ import org.quartz.JobExecutionContext;
 import org.slf4j.MDC;
 
 /**
- * ECOMP EELF logging MDC fields not defined in the MDC Configuration (i.e. MDC_ALERT_SEVERITY)
+ * EELF logging MDC fields not defined in the MDC Configuration (i.e. MDC_ALERT_SEVERITY)
  **/
 public class Mdc {
 
index 912a6e1..99fce31 100644 (file)
@@ -1,33 +1,34 @@
 /*
- * Copyright © 2018 AT&T Intellectual Property.
- * Modifications Copyright © 2018 IBM.
- * 
+ * Copyright Â© 2018 AT&T Intellectual Property.
+ * Modifications Copyright Â© 2018 IBM.
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *         http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
- * 
+ *
+ *
  * Unless otherwise specified, all documentation contained herein is licensed
  * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
  * you may not use this documentation except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *         https://creativecommons.org/licenses/by/4.0/
- * 
+ *
  * Unless required by applicable law or agreed to in writing, documentation
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
 */
+
 package org.onap.optf.cmso;
 
 import org.springframework.context.annotation.Configuration;
@@ -36,11 +37,8 @@ import org.springframework.context.annotation.PropertySources;
 
 
 @Configuration
-@PropertySources({
-       @PropertySource("file:etc/config/cmso.properties"),
-       @PropertySource("file:etc/config/optimizer.properties"),
-       @PropertySource("file:etc/config/ticketmgt.properties"),
-})
-public class ApplicationPropertiesFiles 
-{
-}
\ No newline at end of file
+@PropertySources({@PropertySource("file:etc/config/cmso.properties"),
+                @PropertySource("file:etc/config/optimizer.properties"),
+                @PropertySource("file:etc/config/ticketmgt.properties"),})
+public class ApplicationPropertiesFiles {
+}
index 04a93d8..781febb 100644 (file)
 \r
 package org.onap.optf.cmso;\r
 \r
+import com.att.eelf.configuration.EELFLogger;\r
+import com.att.eelf.configuration.EELFManager;\r
 import org.quartz.spi.TriggerFiredBundle;\r
 import org.springframework.beans.factory.config.AutowireCapableBeanFactory;\r
 import org.springframework.context.ApplicationContext;\r
 import org.springframework.context.ApplicationContextAware;\r
 import org.springframework.scheduling.quartz.SpringBeanJobFactory;\r
-import com.att.eelf.configuration.EELFLogger;\r
-import com.att.eelf.configuration.EELFManager;\r
-\r
 /**\r
  * This class makes it possible to use @Autowired references in QuartzJobBeans.\r
- *\r
  * Also enables @Autowire of the SchedulerFactoryBean the add Triggers\r
  * for @Autowired QuartzJobBeans for ChangeManagement events. Making a big\r
  * investment in SpringBoot Quartz. It had better work ;-)\r
  *\r
  */\r
+\r
 public final class AutowiringSpringBeanJobFactory extends SpringBeanJobFactory implements ApplicationContextAware {\r
     private static EELFLogger log = EELFManager.getInstance().getLogger(AutowiringSpringBeanJobFactory.class);\r
 \r
index f9351b2..417f9e2 100644 (file)
@@ -34,7 +34,7 @@ import java.util.List;
  */
 public class AafUserRole {
     private String url = "";
-    private String pathParts[] = {};
+    private String[] pathParts = {};
     private String perm = "";
     private String method = "";
     private List<AafPerm> aafPerms = new ArrayList<>();
index db48437..ff4fec8 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
- * Copyright � 2017-2018 AT&T Intellectual Property. Modifications Copyright � 2018 IBM.\r
+ * Copyright © 2017-2018 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
index 97e33d5..9555365 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
- * Copyright � 2017-2018 AT&T Intellectual Property. Modifications Copyright � 2018 IBM.\r
+ * Copyright © 2017-2018 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
index 8b3d3f0..84644e5 100644 (file)
@@ -17,6 +17,8 @@
 \r
 package org.onap.optf.cmso.common;\r
 \r
+import com.att.eelf.configuration.EELFLogger;\r
+import com.att.eelf.configuration.EELFManager;\r
 import java.io.IOException;\r
 import java.io.UnsupportedEncodingException;\r
 import javax.servlet.http.HttpServletRequest;\r
@@ -24,20 +26,33 @@ import javax.ws.rs.client.ClientRequestContext;
 import javax.ws.rs.client.ClientRequestFilter;\r
 import javax.ws.rs.core.MultivaluedMap;\r
 import javax.xml.bind.DatatypeConverter;\r
-import com.att.eelf.configuration.EELFLogger;\r
-import com.att.eelf.configuration.EELFManager;\r
 \r
+/**\r
+ * The Class BasicAuthenticatorFilter.\r
+ */\r
 public class BasicAuthenticatorFilter implements ClientRequestFilter {\r
     private static EELFLogger log = EELFManager.getInstance().getLogger(BasicAuthenticatorFilter.class);\r
     private final String user;\r
     private final String password;\r
 \r
+    /**\r
+     * Instantiates a new basic authenticator filter.\r
+     *\r
+     * @param user the user\r
+     * @param password the password\r
+     */\r
     public BasicAuthenticatorFilter(String user, String password) {\r
         this.user = user;\r
         this.password = password;\r
         log.info("user: " + user + " pass:" + password);\r
     }\r
 \r
+    /**\r
+     * Filter.\r
+     *\r
+     * @param requestContext the request context\r
+     * @throws IOException Signals that an I/O exception has occurred.\r
+     */\r
     @Override\r
     public void filter(ClientRequestContext requestContext) throws IOException {\r
         MultivaluedMap<String, Object> headers = requestContext.getHeaders();\r
@@ -54,6 +69,12 @@ public class BasicAuthenticatorFilter implements ClientRequestFilter {
         }\r
     }\r
 \r
+    /**\r
+     * Gets the user.\r
+     *\r
+     * @param request the request\r
+     * @return the user\r
+     */\r
     public static String getUser(HttpServletRequest request) {\r
         String user = "";\r
         String header = request.getHeader("Authorization");\r
index 161fe9b..ec3804a 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.common;\r
 \r
-import java.io.Serializable;\r
-import java.util.ArrayList;\r
-import java.util.List;\r
 import com.att.eelf.configuration.EELFLogger;\r
 import com.att.eelf.configuration.EELFManager;\r
 import com.fasterxml.jackson.annotation.JsonProperty;\r
+import java.io.Serializable;\r
+import java.util.ArrayList;\r
+import java.util.List;\r
 \r
 public class CMSRequestError implements Serializable {\r
     private static final long serialVersionUID = 1L;\r
@@ -66,6 +66,7 @@ public class CMSRequestError implements Serializable {
             this.variables = variables;\r
         }\r
 \r
+        @Override\r
         public String toString() {\r
             StringBuffer sb = new StringBuffer();\r
             sb.append(messageId).append(":").append(text).append(":").append(variables);\r
@@ -74,6 +75,7 @@ public class CMSRequestError implements Serializable {
         }\r
     }\r
 \r
+    @Override\r
     public String toString() {\r
         return requestError.toString();\r
     }\r
index 5b0a539..62eaec2 100644 (file)
 package org.onap.optf.cmso.common;\r
 \r
 public enum CMSStatusEnum {\r
-  PendingSchedule(\r
-      "Pending Schedule",\r
-      "Schedule request as been accepted. Pending determination of recommended schedule."),\r
-  SchedulingFailed("Scheduling Failed", "Failed to determine recommended schedule."),\r
-  ScheduleFailed("Schedule Failed", "Determination of recommended schedule failed."),\r
-  OptimizationInProgress(\r
-      "Optimization In Progress", "Determination of recommended schedule is in progress."),\r
-  PendingApproval("Pending Approval", "Pending approval of the recommended schedule."),\r
-  OptimizationFailed("Optimization Failed", "Unable to determine recommended schedule."),\r
-  Accepted("Accepted", "Recommended schedule has been accepted."),\r
-  Scheduled("Scheduled", "All approvals received. Recommended schedule is pending execution."),\r
-  ScheduledImmediate(\r
-      "Scheduled Immediate", "All approvals received. Event is scheduled for immediate execution."),\r
-  Triggered("Triggered", "Scheduled event has been triggered."),\r
-  ApprovalRejected("Approval Rejected", "Recommended schedule has been rejected."),\r
-  PastDue("Past due", "Scheduled event time has passed. Queued event was not dispatched."),\r
-  Error("Error", "Attempt to displatch event failed."),\r
-  Failed("Failed", "Triggered event reported a failure."),\r
-  Rejected("Rejected", "Recommended schedule has been rejected."),\r
-  NotificationsInitiated(\r
-      "Notifications Initiated", "Notifications of scheduled events has been initiated."),\r
-  Completed("Completed", "Notification of all scheduled events have been sent."),\r
-  CompletedWithError(\r
-      "Completed with error(s)", "All scheduled events have completed, some with errors."),\r
-  Deleted("Deleted", "Schedule deleted prior to acceptance or after execution."),\r
-  Cancelled("Cancelled", "Scheduled event cancelled before execution."),\r
-  NotScheduled("Not scheduled by optimizer", "Element not included in the schedule by optimizer."),\r
-  ;\r
+    PendingSchedule("Pending Schedule",\r
+                    "Schedule request as been accepted. Pending determination of recommended schedule."),\r
+    SchedulingFailed("Scheduling Failed", "Failed to determine recommended schedule."),\r
+    ScheduleFailed("Schedule Failed", "Determination of recommended schedule failed."),\r
+    OptimizationInProgress("Optimization In Progress", "Determination of recommended schedule is in progress."),\r
+    PendingApproval("Pending Approval", "Pending approval of the recommended schedule."),\r
+    OptimizationFailed("Optimization Failed", "Unable to determine recommended schedule."),\r
+    Accepted("Accepted", "Recommended schedule has been accepted."),\r
+    Scheduled("Scheduled", "All approvals received. Recommended schedule is pending execution."),\r
+    ScheduledImmediate("Scheduled Immediate", "All approvals received. Event is scheduled for immediate execution."),\r
+    Triggered("Triggered", "Scheduled event has been triggered."),\r
+    ApprovalRejected("Approval Rejected", "Recommended schedule has been rejected."),\r
+    PastDue("Past due", "Scheduled event time has passed. Queued event was not dispatched."),\r
+    Error("Error", "Attempt to displatch event failed."),\r
+    Failed("Failed", "Triggered event reported a failure."),\r
+    Rejected("Rejected", "Recommended schedule has been rejected."),\r
+    NotificationsInitiated("Notifications Initiated", "Notifications of scheduled events has been initiated."),\r
+    Completed("Completed", "Notification of all scheduled events have been sent."),\r
+    CompletedWithError("Completed with error(s)", "All scheduled events have completed, some with errors."),\r
+    Deleted("Deleted", "Schedule deleted prior to acceptance or after execution."),\r
+    Cancelled("Cancelled", "Scheduled event cancelled before execution."),\r
+    NotScheduled("Not scheduled by optimizer", "Element not included in the schedule by optimizer."),;\r
 \r
-  private final String text;\r
-  private final String description;\r
+    private final String text;\r
+    private final String description;\r
 \r
-  private CMSStatusEnum(String text, String description) {\r
-    this.text = text;\r
-    this.description = description;\r
-  }\r
+    private CMSStatusEnum(String text, String description) {\r
+        this.text        = text;\r
+        this.description = description;\r
+    }\r
 \r
-  @Override\r
-  public String toString() {\r
-    return text;\r
-  }\r
+    @Override\r
+    public String toString() {\r
+        return text;\r
+    }\r
 \r
-  public CMSStatusEnum fromString(String text) {\r
-    for (CMSStatusEnum e : CMSStatusEnum.values()) if (e.text.equals(text)) return e;\r
-    return null;\r
-  }\r
+    public CMSStatusEnum fromString(String text) {\r
+        for (CMSStatusEnum e : CMSStatusEnum.values())\r
+            if (e.text.equals(text))\r
+                return e;\r
+        return null;\r
+    }\r
 \r
-  // To include in the AID.\r
-  public static void main(String argv[]) {\r
-    StringBuilder sb = new StringBuilder();\r
-    sb.append("<html><body><table border=\"1\">\n");\r
-    for (CMSStatusEnum v : CMSStatusEnum.values())\r
-      sb.append("<tr><td>")\r
-          .append(v.text)\r
-          .append("</td><td>")\r
-          .append(v.description)\r
-          .append("</td></tr>\n");\r
-    sb.append("</table></body></html>\n");\r
-    System.out.println(sb.toString());\r
-  }\r
+    // To include in the AID.\r
+    public static void main(String argv[]) {\r
+        StringBuilder sb = new StringBuilder();\r
+        sb.append("<html><body><table border=\"1\">\n");\r
+        for (CMSStatusEnum v : CMSStatusEnum.values())\r
+            sb.append("<tr><td>").append(v.text).append("</td><td>").append(v.description).append("</td></tr>\n");\r
+        sb.append("</table></body></html>\n");\r
+        System.out.println(sb.toString());\r
+    }\r
 }\r
index c5ff7f0..034af89 100644 (file)
@@ -38,7 +38,7 @@ import org.onap.optf.cmso.model.Schedule;
 import org.onap.optf.cmso.service.rs.models.CmDomainDataEnum;\r
 \r
 /**\r
- * Collection of commann static helper methods for CHangeManagement\r
+ * Collection of commann static helper methods for CHangeManagement.\r
  *\r
  * @author jf9860\r
  *\r
@@ -49,24 +49,40 @@ public class CmHelpers {
         return getDomainData(schedule.getDomainData(), key);\r
     }\r
 \r
+    /**\r
+     * Gets the domain data.\r
+     *\r
+     * @param domainData the domain data\r
+     * @param key the key\r
+     * @return the domain data\r
+     */\r
     public static String getDomainData(List<DomainData> domainData, CmDomainDataEnum key) {\r
         for (DomainData map : domainData) {\r
-            if (map.getName().equals(key.toString()))\r
+            if (map.getName().equals(key.toString())) {\r
                 return map.getValue();\r
+            }\r
         }\r
         return null;\r
     }\r
 \r
-  public static String getEventData(Schedule schedule, CmDomainDataEnum key) {\r
-      return getDomainData(schedule.getDomainData(), key);\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
+     * Gets the element data.\r
+     *\r
+     * @param eventData the event data\r
+     * @param key the key\r
+     * @return the element data\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
+        }\r
+        return null;\r
+    }\r
 \r
 }\r
index 30451b5..3230933 100644 (file)
@@ -60,7 +60,7 @@ import org.slf4j.MDC;
 import com.att.eelf.utils.Stopwatch;\r
 \r
 /**\r
- * ECOMP EELF logging MDC fields not defined in the MDC Configuration (i.e.\r
+ * EELF logging MDC fields not defined in the MDC Configuration (i.e.\r
  * MDC_ALERT_SEVERITY)\r
  **/\r
 public class Mdc {\r
@@ -116,7 +116,7 @@ public class Mdc {
             MDC.put(MDC_SERVER_FQDN, e.getMessage());\r
         }\r
         MDC.put(MDC_SERVICE_INSTANCE_ID, "UNKNOWN");\r
-        MDC.put(MDC_SERVICE_NAME, "ecomp-cmso");\r
+        MDC.put(MDC_SERVICE_NAME, "cmso");\r
         // MDC.put(MDC_STATUS_CODE, "");\r
         setPartherTargetFromUri(request.getRequestURL().toString());\r
         // Override partner hostname with username\r
@@ -217,7 +217,7 @@ public class Mdc {
             MDC.put(MDC_SERVER_FQDN, e.getMessage());\r
         }\r
         MDC.put(MDC_SERVICE_INSTANCE_ID, "UNKNOWN");\r
-        MDC.put(MDC_SERVICE_NAME, "ecomp-cmso");\r
+        MDC.put(MDC_SERVICE_NAME, "cmso");\r
         // MDC.put(MDC_STATUS_CODE, "");\r
         // MDC.put(MDC_TARGET_ENTITY, "");\r
         // MDC.put(MDC_TARGET_SERVICE_NAME, "");\r
@@ -255,7 +255,7 @@ public class Mdc {
         // InetAddress.getLocalHost().getHostAddress()); } catch (Exception e){\r
         // MDC.put(MDC_SERVER_FQDN, e.getMessage());}\r
         // MDC.put(MDC_SERVICE_INSTANCE_ID, "UNKNOWN");\r
-        // MDC.put(MDC_SERVICE_NAME, "ecomp-cmso");\r
+        // MDC.put(MDC_SERVICE_NAME, "cmso");\r
         // MDC.put(MDC_STATUS_CODE, "");\r
         // MDC.put(MDC_TARGET_ENTITY, "");\r
         // MDC.put(MDC_TARGET_SERVICE_NAME, "");\r
@@ -302,7 +302,7 @@ public class Mdc {
         // InetAddress.getLocalHost().getHostAddress()); } catch (Exception e){\r
         // MDC.put(MDC_SERVER_FQDN, e.getMessage());}\r
         // MDC.put(MDC_SERVICE_INSTANCE_ID, "UNKNOWN");\r
-        // MDC.put(MDC_SERVICE_NAME, "ecomp-cmso");\r
+        // MDC.put(MDC_SERVICE_NAME, "cmso");\r
         // MDC.put(MDC_STATUS_CODE, "");\r
         setPartherTargetFromUri(url);\r
         // MDC.put(MDC_TARGET_ENTITY, "");\r
@@ -347,7 +347,7 @@ public class Mdc {
         // InetAddress.getLocalHost().getHostAddress()); } catch (Exception e){\r
         // MDC.put(MDC_SERVER_FQDN, e.getMessage());}\r
         // MDC.put(MDC_SERVICE_INSTANCE_ID, "UNKNOWN");\r
-        // MDC.put(MDC_SERVICE_NAME, "ecomp-cmso");\r
+        // MDC.put(MDC_SERVICE_NAME, "cmso");\r
         MDC.put(MDC_STATUS_CODE, "COMPLETE");\r
         if (response.getStatus() == 500)\r
             MDC.put(MDC_STATUS_CODE, "ERROR");\r
index 4514a57..de917e4 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.common;\r
 \r
-import java.io.UnsupportedEncodingException;\r
+import com.att.eelf.configuration.EELFLogger;\r
+import com.att.eelf.configuration.EELFManager;\r
 import javax.crypto.Cipher;\r
 import javax.crypto.spec.IvParameterSpec;\r
 import javax.crypto.spec.SecretKeySpec;\r
-import javax.xml.bind.DatatypeConverter;\r
 import org.apache.commons.codec.binary.Base64;\r
 import org.springframework.beans.factory.annotation.Autowired;\r
 import org.springframework.core.env.Environment;\r
 import org.springframework.stereotype.Component;\r
-import com.att.eelf.configuration.EELFLogger;\r
-import com.att.eelf.configuration.EELFManager;\r
 \r
+/**\r
+ * The Class PropertiesManagement.\r
+ */\r
 @Component\r
 public class PropertiesManagement {\r
 \r
     private static EELFLogger debug = EELFManager.getInstance().getDebugLogger();\r
     private static EELFLogger errors = EELFManager.getInstance().getErrorLogger();\r
 \r
-    private final static String algorithm = "AES";\r
-    private final static String cipherMode = "CBC";\r
-    private final static String paddingScheme = "PKCS5Padding";\r
-    private final static String transformation = algorithm + "/" + cipherMode + "/" + paddingScheme;\r
-\r
+    private static final String algorithm = "AES";\r
+    private static final String cipherMode = "CBC";\r
+    private static final String paddingScheme = "PKCS5Padding";\r
+    private static final String transformation = algorithm + "/" + cipherMode + "/" + paddingScheme;\r
     private static final String initVector = "ONAPCMSOVECTORIV"; // 16 bytes IV\r
 \r
     @Autowired\r
     Environment env;\r
 \r
+    /**\r
+     * Gets the property.\r
+     *\r
+     * @param key the key\r
+     * @param defaultValue the default value\r
+     * @return the property\r
+     */\r
     public String getProperty(String key, String defaultValue) {\r
         String value = env.getProperty(key, defaultValue);\r
         value = getDecryptedValue(value);\r
         return value;\r
     }\r
 \r
+    /**\r
+     * Gets the decrypted value.\r
+     *\r
+     * @param value the value\r
+     * @return the decrypted value\r
+     */\r
     public static String getDecryptedValue(String value) {\r
         if (value.startsWith("enc:")) {\r
             String secret = getSecret();\r
@@ -73,6 +86,12 @@ public class PropertiesManagement {
         return value;\r
     }\r
 \r
+    /**\r
+     * Gets the encrypted value.\r
+     *\r
+     * @param value the value\r
+     * @return the encrypted value\r
+     */\r
     public static String getEncryptedValue(String value) {\r
         String secret = getSecret();\r
         value = encrypt(secret, initVector, value);\r
@@ -114,17 +133,4 @@ public class PropertiesManagement {
         return "ONAPCMSOSECRETIV";\r
     }\r
 \r
-    public static void main(String[] args) {\r
-        try {\r
-            String pass = getDecryptedValue("enc:bfodXf8qRfCqMvlxVBYNWQ==");\r
-            //System.out.println("Decrypt - "+pass);\r
-            pass = getEncryptedValue("cmso@onap.org");\r
-            //System.out.println("Encrypt - "+pass);\r
-            //System.out.println(DatatypeConverter.printBase64Binary("cmso@onap.org:cmso@onap.org".getBytes("UTF-8")));\r
-        } catch (Exception e) {\r
-            // TODO Auto-generated catch block\r
-            e.printStackTrace();\r
-        }\r
-\r
-    }\r
 }\r
index 8766eee..256878c 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;\r
 \r
+import com.att.eelf.configuration.EELFLogger;\r
+import com.att.eelf.configuration.EELFManager;\r
 import java.util.Map;\r
 import java.util.UUID;\r
-\r
 import javax.ws.rs.client.Client;\r
 import javax.ws.rs.client.ClientBuilder;\r
 import javax.ws.rs.client.Invocation;\r
 import javax.ws.rs.client.WebTarget;\r
 import javax.ws.rs.core.MediaType;\r
 import javax.ws.rs.core.Response;\r
-\r
 import org.onap.observations.Mdc;\r
 import org.onap.optf.cmso.common.BasicAuthenticatorFilter;\r
 import org.onap.optf.cmso.common.LogMessages;\r
@@ -60,12 +60,9 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;\r
 import org.springframework.stereotype.Component;\r
 \r
-import com.att.eelf.configuration.EELFLogger;\r
-import com.att.eelf.configuration.EELFManager;\r
-\r
 /**\r
- * This is the Quartz Job that is run to send the workflow to VID for execution\r
- * \r
+ * This is the Quartz Job that is run to send the workflow to VID for execution.\r
+ *\r
  *\r
  */\r
 @Component\r
@@ -80,7 +77,7 @@ public class CmJob implements Job {
     CMSOClient vidClient;\r
 \r
     @Autowired\r
-    ChangeManagementScheduleDAO cmScheduleDAO;\r
+    ChangeManagementScheduleDAO cmScheduleDao;\r
 \r
     @Autowired\r
     ChangeManagementGroupDAO cmGroupDAO;\r
@@ -126,7 +123,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 60d8bdb..49be23a 100644 (file)
@@ -1,27 +1,27 @@
 /*\r
  * Copyright © 2017-2018 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;\r
 \r
+import com.att.eelf.configuration.EELFLogger;\r
+import com.att.eelf.configuration.EELFManager;\r
+import com.att.eelf.i18n.EELFResourceManager;\r
 import java.net.InetAddress;\r
 import java.util.Date;\r
 import java.util.HashSet;\r
 import java.util.Set;\r
 import java.util.UUID;\r
-\r
 import org.onap.optf.cmso.common.CMSStatusEnum;\r
 import org.onap.optf.cmso.common.LogMessages;\r
 import org.onap.optf.cmso.model.ChangeManagementGroup;\r
@@ -55,19 +57,14 @@ import org.springframework.core.env.Environment;
 import org.springframework.stereotype.Component;\r
 import org.springframework.transaction.annotation.Transactional;\r
 \r
-import com.att.eelf.configuration.EELFLogger;\r
-import com.att.eelf.configuration.EELFManager;\r
-import com.att.eelf.i18n.EELFResourceManager;\r
-\r
 /**\r
- * This is the service used to dispatch a job COuld not get QuartzJobBean to\r
+ * This is the service used to dispatch a job COuld not get QuartzJobBean to.\r
  * be @Transactional\r
  *\r
  */\r
 @Component\r
 public class DispatchJob {\r
     private static EELFLogger log = EELFManager.getInstance().getLogger(DispatchJob.class);\r
-    private static EELFLogger metrics = EELFManager.getInstance().getMetricsLogger();\r
     private static EELFLogger errors = EELFManager.getInstance().getErrorLogger();\r
     private static EELFLogger debug = EELFManager.getInstance().getDebugLogger();\r
 \r
@@ -188,7 +185,7 @@ public class DispatchJob {
         // (Sleep until actual dispatch time...)\r
         // leadTime allows for preparing call to VID to the start of workflow.\r
         long sleep = (startMillis - leadTime) - System.currentTimeMillis();\r
-        if (sleep > 0l) {\r
+        if (sleep > 0L) {\r
             try {\r
                 Thread.sleep(sleep);\r
             } catch (Exception e) {\r
index 3c53759..9d93ec4 100644 (file)
@@ -1,27 +1,27 @@
 /*\r
  * Copyright © 2017-2018 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 io.swagger.annotations.Api;\r
+import io.swagger.annotations.ApiOperation;\r
+import io.swagger.annotations.ApiParam;\r
+import io.swagger.annotations.ApiResponse;\r
+import io.swagger.annotations.ApiResponses;\r
 import javax.servlet.http.HttpServletRequest;\r
 import javax.ws.rs.GET;\r
 import javax.ws.rs.Path;\r
@@ -41,12 +46,6 @@ import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;\r
 import javax.ws.rs.core.UriInfo;\r
 \r
-import io.swagger.annotations.Api;\r
-import io.swagger.annotations.ApiOperation;\r
-import io.swagger.annotations.ApiParam;\r
-import io.swagger.annotations.ApiResponse;\r
-import io.swagger.annotations.ApiResponses;\r
-\r
 @Api\r
 @Path("/dispatch")\r
 @Produces({MediaType.APPLICATION_JSON})\r
index e612734..84ff91e 100644 (file)
@@ -67,9 +67,9 @@ public class DispatcherServiceImpl implements DispacherService {
     @Override\r
     @Transactional\r
     public Response dispatchSchedule(String id, UriInfo uri, HttpServletRequest request) {\r
-        debug.debug("dispatchSchedule entered  {}" , id);\r
+        debug.debug("dispatchSchedule entered  {}", id);\r
         try {\r
-               UUID uuid = UUID.fromString(id);\r
+            UUID uuid = UUID.fromString(id);\r
             dispatchJob.execute(uuid);\r
         } catch (Exception e) {\r
             errors.error(LogMessages.UNEXPECTED_EXCEPTION, e.getMessage());\r
@@ -84,7 +84,7 @@ public class DispatcherServiceImpl implements DispacherService {
     public Response dispatchOptimizer(String id, UriInfo uri, HttpServletRequest request) {\r
         debug.debug("dispatchOptimizer entered {}", id);\r
         try {\r
-               UUID uuid = UUID.fromString(id);\r
+            UUID uuid = UUID.fromString(id);\r
             optimizerClient.scheduleOptimization(uuid);\r
         } catch (Exception e) {\r
             errors.error(LogMessages.UNEXPECTED_EXCEPTION, e.getMessage());\r
index 86fa038..cb0ca87 100644 (file)
@@ -31,6 +31,8 @@
 \r
 package org.onap.optf.cmso.eventq;\r
 \r
+import com.att.eelf.configuration.EELFLogger;\r
+import com.att.eelf.configuration.EELFManager;\r
 import java.util.Date;\r
 import java.util.List;\r
 import org.onap.optf.cmso.common.CMSStatusEnum;\r
@@ -47,8 +49,6 @@ import org.springframework.core.env.Environment;
 import org.springframework.scheduling.quartz.SchedulerFactoryBean;\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
 \r
 /**\r
  * This job will look for ChangeManagementSchedule approved jobs that are due\r
@@ -64,7 +64,7 @@ public class CMSQueueJob {
     private static EELFLogger debug = EELFManager.getInstance().getDebugLogger();\r
 \r
     @Autowired\r
-    ChangeManagementScheduleDAO cmScheduleDAO;\r
+    ChangeManagementScheduleDAO cmScheduleDao;\r
 \r
     @Autowired\r
     SchedulerFactoryBean qsScheduler;\r
@@ -75,15 +75,21 @@ public class CMSQueueJob {
     @Autowired\r
     DispatchedEventList dispatchedEventList;\r
 \r
+    /**\r
+     * Queue imminent jobs.\r
+     *\r
+     * @return true, if successful\r
+     */\r
     public boolean queueImminentJobs() {\r
         Integer interval = env.getProperty("cmso.cm.polling.job.interval.ms", Integer.class, 10000);\r
         Integer lookahead = env.getProperty("cmso.cm.polling.job.lookahead.intervals", Integer.class, 5);\r
         long now = System.currentTimeMillis();\r
         Long endTime = now + (interval * lookahead);\r
         List<ChangeManagementSchedule> schedules =\r
-                cmScheduleDAO.findByStatusAndEndTime(CMSStatusEnum.Scheduled.toString(), endTime);\r
-        if (schedules.size() == 0)\r
+                cmScheduleDao.findByStatusAndEndTime(CMSStatusEnum.Scheduled.toString(), endTime);\r
+        if (schedules.size() == 0) {\r
             return false;\r
+        }\r
         for (ChangeManagementSchedule schedule : schedules) {\r
             try {\r
                 if (!dispatchedEventList.isAlreadyDispatched(schedule.getUuid())) {\r
@@ -106,6 +112,12 @@ public class CMSQueueJob {
         return false;\r
     }\r
 \r
+    /**\r
+     * Schedule cm job.\r
+     *\r
+     * @param schedule the schedule\r
+     * @throws Exception the scheduler exception\r
+     */\r
     public void scheduleCmJob(ChangeManagementSchedule schedule) throws org.quartz.SchedulerException {\r
         //\r
         Integer dispatherLeadTime = env.getProperty("cmso.cm.dispatcher.lead.time.ms", Integer.class, 5000);\r
@@ -113,8 +125,9 @@ public class CMSQueueJob {
         Long startTime = schedule.getStartTimeMillis();\r
 \r
         /// If startTIme is null, it is an immediate start\r
-        if (startTime != null)\r
+        if (startTime != null) {\r
             dispatchTime = startTime - dispatherLeadTime;\r
+        }\r
 \r
         JobDetail jobDetail = JobBuilder.newJob(CmJob.class).build();\r
         jobDetail.getJobDataMap().put("key", schedule.getUuid().toString());\r
@@ -122,18 +135,25 @@ public class CMSQueueJob {
         TriggerBuilder<Trigger> tb = TriggerBuilder.newTrigger().forJob(jobDetail);\r
 \r
         long now = System.currentTimeMillis();\r
-        if (now > dispatchTime)\r
+        if (now > dispatchTime) {\r
             tb.startNow();\r
-        else\r
+        }\r
+        else {\r
             tb.startAt(new Date(dispatchTime));\r
+        }\r
         Trigger trigger = tb.build();\r
         qsScheduler.getScheduler().scheduleJob(jobDetail, trigger);\r
 \r
     }\r
 \r
+    /**\r
+     * Update schedule status.\r
+     *\r
+     * @param cmSchedule the cm schedule\r
+     */\r
     @Transactional\r
     public void updateScheduleStatus(ChangeManagementSchedule cmSchedule) {\r
-        cmScheduleDAO.save(cmSchedule);\r
+        cmScheduleDao.save(cmSchedule);\r
 \r
     }\r
 \r
index 9e1159a..7816f72 100644 (file)
@@ -31,6 +31,8 @@
 \r
 package org.onap.optf.cmso.eventq;\r
 \r
+import com.att.eelf.configuration.EELFLogger;\r
+import com.att.eelf.configuration.EELFManager;\r
 import org.onap.observations.Mdc;\r
 import org.onap.optf.cmso.common.LogMessages;\r
 import org.onap.optf.cmso.model.dao.ChangeManagementScheduleDAO;\r
@@ -41,8 +43,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.quartz.QuartzJobBean;\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
 \r
 /**\r
  * This quartz job runs periodically to query the ChangeManagementSChedule table\r
@@ -55,7 +55,7 @@ public class CmQuartzJob extends QuartzJobBean {
     private static EELFLogger debug = EELFManager.getInstance().getDebugLogger();\r
 \r
     @Autowired\r
-    CMSQueueJob qJob;\r
+    CMSQueueJob qqJob;\r
 \r
     // This is not called directly. Using @Autowired to ensure that startup\r
     // Runs before the fist invocation of executeInternal\r
@@ -63,7 +63,7 @@ public class CmQuartzJob extends QuartzJobBean {
     CmQuartzJobStartup startup;\r
 \r
     @Autowired\r
-    ChangeManagementScheduleDAO cmScheduleDAO;\r
+    ChangeManagementScheduleDAO cmScheduleDao;\r
 \r
     @Override\r
     @Transactional\r
@@ -87,7 +87,7 @@ public class CmQuartzJob extends QuartzJobBean {
             boolean moreToSchedule = true;\r
             while (moreToSchedule) {\r
                 try {\r
-                    moreToSchedule = qJob.queueImminentJobs();\r
+                    moreToSchedule = qqJob.queueImminentJobs();\r
                 } catch (Exception e) {\r
                     debug.debug(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
                     moreToSchedule = false;\r
index 2624bfe..add1478 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.eventq;\r
 \r
+import com.att.eelf.configuration.EELFLogger;\r
+import com.att.eelf.configuration.EELFManager;\r
 import java.net.InetAddress;\r
 import java.util.concurrent.atomic.AtomicBoolean;\r
 import org.onap.optf.cmso.model.dao.ChangeManagementScheduleDAO;\r
 import org.springframework.beans.factory.annotation.Autowired;\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
 \r
 /**\r
  * This bean uses @AUtowired to ensure that it runs once at startup to reset all\r
  * QueuedForDispatch rows that were in flight last time from this\r
  * "dispatcherInstnace" shut down.\r
- * \r
  * Potentially, in a distributed environment, when a "dispatcherInstance"\r
  * shutdown is detected by another instance, it can run this query to requeue\r
  * these items. We are a long way from there.\r
- * \r
  * Chances are great that re-queued events will end up being Past Due events\r
- * \r
+ *\r
  */\r
 @Component\r
 public class CmQuartzJobStartup {\r
     private static EELFLogger log = EELFManager.getInstance().getLogger(CmQuartzJobStartup.class);\r
 \r
     @Autowired\r
-    ChangeManagementScheduleDAO cmScheduleDAO;\r
+    ChangeManagementScheduleDAO cmScheduleDao;\r
 \r
     private AtomicBoolean started = new AtomicBoolean(false);\r
 \r
@@ -65,12 +63,16 @@ public class CmQuartzJobStartup {
 \r
     }\r
 \r
+    /**\r
+     * Startup.\r
+     */\r
     @Transactional\r
     public void startup() {\r
         try {\r
-            if (started.getAndSet(true))\r
+            if (started.getAndSet(true)) {\r
                 return;\r
-            int rows = cmScheduleDAO.requeueQueuedForDispatch(InetAddress.getLocalHost().getHostAddress());\r
+            }\r
+            int rows = cmScheduleDao.requeueQueuedForDispatch(InetAddress.getLocalHost().getHostAddress());\r
             log.info("{0} QUeued For Dispatch rows have been requeued at startup", rows);\r
         } catch (Exception e) {\r
             log.error("Exception caught in requeueing Queued for DIspatch rows at startup", e);\r
index 3f040ae..d43c60b 100644 (file)
@@ -32,6 +32,7 @@
 package org.onap.optf.cmso.filters;
 
 import static com.att.eelf.configuration.Configuration.MDC_KEY_REQUEST_ID;
+
 import java.io.IOException;
 import javax.ws.rs.client.ClientRequestContext;
 import javax.ws.rs.client.ClientRequestFilter;
@@ -53,30 +54,29 @@ public class CmsoClientFilters implements ClientRequestFilter, ClientResponseFil
 
     @Override
     public void filter(ClientRequestContext requestContext, ClientResponseContext responseContext) throws IOException {
-               // On the way back
-               Mdc.metricEnd(responseContext);
-               Mdc.setCaller(17);
-               Observation.report(LogMessages.OUTGOING_MESSAGE_RETURNED,
-                               requestContext.getMethod(),
-                               requestContext.getUri().getPath().toString(),
-                               responseContext.getStatusInfo().toString());
+        // On the way back
+        Mdc.metricEnd(responseContext);
+        Mdc.setCaller(17);
+        Observation.report(LogMessages.OUTGOING_MESSAGE_RETURNED, requestContext.getMethod(),
+                        requestContext.getUri().getPath().toString(), responseContext.getStatusInfo().toString());
     }
 
     @Override
     public void filter(ClientRequestContext requestContext) throws IOException {
-               // On the way out
-               Mdc.metricStart(requestContext);
-               Mdc.setCaller(17);
-               Observation.report(LogMessages.OUTGOING_MESSAGE,
-                               requestContext.getMethod(),
-                               requestContext.getUri().getPath().toString());
+        // On the way out
+        Mdc.metricStart(requestContext);
+        Mdc.setCaller(17);
+        Observation.report(LogMessages.OUTGOING_MESSAGE, requestContext.getMethod(),
+                        requestContext.getUri().getPath().toString());
         MultivaluedMap<String, Object> headers = requestContext.getHeaders();
 
         String transactionId = (String) headers.getFirst(MessageHeaders.HeadersEnum.TransactionID.toString());
         String mdcId = MDC.get(MDC_KEY_REQUEST_ID);
-        if (transactionId == null || transactionId.equals(""))
-            if (mdcId != null)
+        if (transactionId == null || transactionId.equals("")) {
+            if (mdcId != null) {
                 headers.add(HeadersEnum.TransactionID.toString(), mdcId);
+            }
+        }
         headers.add(HeadersEnum.FromAppID.toString(), appId);
     }
 
index 4c44163..d62f5c2 100644 (file)
@@ -1,27 +1,27 @@
 /*
  * Copyright © 2017-2019 AT&T Intellectual Property.
  * Modifications Copyright © 2018 IBM.
- * 
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *         http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
- * 
+ *
+ *
  * Unless otherwise specified, all documentation contained herein is licensed
  * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
  * you may not use this documentation except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *         https://creativecommons.org/licenses/by/4.0/
- * 
+ *
  * Unless required by applicable law or agreed to in writing, documentation
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -33,7 +33,6 @@ package org.onap.optf.cmso.filters;
 
 import java.io.IOException;
 import java.util.UUID;
-
 import javax.annotation.Priority;
 import javax.servlet.http.HttpServletRequest;
 import javax.ws.rs.WebApplicationException;
@@ -46,7 +45,6 @@ import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.Response.ResponseBuilder;
 import javax.ws.rs.ext.Provider;
-
 import org.onap.observations.Mdc;
 import org.onap.observations.Observation;
 import org.onap.optf.cmso.common.LogMessages;
@@ -59,30 +57,29 @@ import org.springframework.stereotype.Component;
 public class CmsoContainerFilters implements ContainerRequestFilter, ContainerResponseFilter {
 
 
-       @Context
-       private HttpServletRequest servletRequest;
+    @Context
+    private HttpServletRequest servletRequest;
 
     @Override
     public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext)
-            throws IOException {
+                    throws IOException {
         try {
-                       Mdc.auditEnd(requestContext, responseContext);
-                       Observation.report(LogMessages.INCOMING_MESSAGE_RESPONSE, 
-                                       requestContext.getMethod(),
-                                       requestContext.getUriInfo().getPath().toString(),
-                                       responseContext.getStatusInfo().toString());
+            Mdc.auditEnd(requestContext, responseContext);
+            Observation.report(LogMessages.INCOMING_MESSAGE_RESPONSE, requestContext.getMethod(),
+                            requestContext.getUriInfo().getPath().toString(),
+                            responseContext.getStatusInfo().toString());
             MultivaluedMap<String, String> reqHeaders = requestContext.getHeaders();
             MultivaluedMap<String, Object> respHeaders = responseContext.getHeaders();
-            String minorVersion = (String) reqHeaders.getFirst(HeadersEnum.MinorVersion.toString());
+            String minorVersion = reqHeaders.getFirst(HeadersEnum.MinorVersion.toString());
             respHeaders.add(HeadersEnum.MinorVersion.toString(), minorVersion);
             respHeaders.add(HeadersEnum.LatestVersion.toString(), MessageHeaders.latestVersion);
             respHeaders.add(HeadersEnum.PatchVersion.toString(), MessageHeaders.patchVersion);
 
         } catch (Exception e) {
             if (e instanceof WebApplicationException) {
-               Observation.report(LogMessages.EXPECTED_EXCEPTION, e.getMessage());
+                Observation.report(LogMessages.EXPECTED_EXCEPTION, e.getMessage());
             } else {
-               Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e.getMessage());
+                Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e.getMessage());
             }
         }
     }
@@ -91,16 +88,16 @@ public class CmsoContainerFilters implements ContainerRequestFilter, ContainerRe
     public void filter(ContainerRequestContext requestContext) throws IOException {
         try {
             // On the way in
-                       Mdc.auditStart(requestContext, servletRequest);
-                       Observation.report(LogMessages.INCOMING_MESSAGE, 
-                                       requestContext.getMethod(),
-                                       requestContext.getUriInfo().getPath().toString());
+            Mdc.auditStart(requestContext, servletRequest);
+            Observation.report(LogMessages.INCOMING_MESSAGE, requestContext.getMethod(),
+                            requestContext.getUriInfo().getPath().toString());
 
             String majorVersion = requestContext.getUriInfo().getPath();
             if (majorVersion != null) {
 
-                if (majorVersion.startsWith("dispatch/"))
+                if (majorVersion.startsWith("dispatch/")) {
                     return;
+                }
                 majorVersion = majorVersion.replaceAll("/.*$", "");
             }
             if (!MessageHeaders.validateMajorVersion(majorVersion)) {
@@ -110,12 +107,12 @@ public class CmsoContainerFilters implements ContainerRequestFilter, ContainerRe
                 throw new WebApplicationException(builder.build());
             }
             MultivaluedMap<String, String> headers = requestContext.getHeaders();
-            String transactionId = (String) headers.getFirst(HeadersEnum.TransactionID.toString());
+            String transactionId = headers.getFirst(HeadersEnum.TransactionID.toString());
             if (transactionId == null) {
                 transactionId = UUID.randomUUID().toString();
                 headers.add(HeadersEnum.TransactionID.toString(), transactionId);
             }
-            String minorVersion = (String) headers.getFirst(HeadersEnum.MinorVersion.toString());
+            String minorVersion = headers.getFirst(HeadersEnum.MinorVersion.toString());
             if (minorVersion == null) {
                 minorVersion = MessageHeaders.supportedMajorVersions.get(majorVersion);
                 headers.add(HeadersEnum.MinorVersion.toString(), minorVersion);
@@ -132,7 +129,7 @@ public class CmsoContainerFilters implements ContainerRequestFilter, ContainerRe
                 Observation.report(LogMessages.EXPECTED_EXCEPTION, e.getMessage());
                 throw e;
             } else {
-               Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e.getMessage());
+                Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e.getMessage());
             }
         }
 
index ba3efa3..b62cce2 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
@@ -37,7 +37,14 @@ import java.util.HashSet;
 import java.util.Map;\r
 import java.util.Set;\r
 \r
+/**\r
+ * The Class MessageHeaders.\r
+ */\r
 public class MessageHeaders {\r
+\r
+    /**\r
+     * The Enum HeadersEnum.\r
+     */\r
     public enum HeadersEnum {\r
         UNDEFINED("UNDEFINED"), TransactionID("X-TransactionId"), FromAppID("X-FromAppId"), MinorVersion(\r
                 "X-MinorVersion"), PatchVersion("X-PatchVersion"), LatestVersion("X-LatestVersion"),;\r
@@ -50,51 +57,98 @@ public class MessageHeaders {
             this.list = new ArrayList<>();\r
         }\r
 \r
+        /**\r
+         * To string.\r
+         *\r
+         * @return the string\r
+         */\r
         @Override\r
         public String toString() {\r
             return text;\r
         }\r
     }\r
 \r
+    /** The Constant supportedMajorVersions. */\r
     public static final Map<String, String> supportedMajorVersions = new HashMap<String, String>();\r
+\r
     static {\r
         supportedMajorVersions.put("v1", "0");\r
         supportedMajorVersions.put("v2", "0");\r
     }\r
+\r
+    /** The Constant supportedMajorMinorVersions. */\r
     public static final Set<String> supportedMajorMinorVersions = new HashSet<String>();\r
+\r
     static {\r
         supportedMajorMinorVersions.add("v1.0");\r
         supportedMajorMinorVersions.add("v2.0");\r
     }\r
+\r
+    /** The Constant latestVersion. */\r
     public static final String latestVersion = "2.0.0";\r
+\r
+    /** The Constant patchVersion. */\r
     public static final String patchVersion = "0";\r
 \r
+    /**\r
+     * From string.\r
+     *\r
+     * @param text the text\r
+     * @return the headers enum\r
+     */\r
     public static HeadersEnum fromString(String text) {\r
-        for (HeadersEnum e : HeadersEnum.values())\r
-            if (e.text.equals(text))\r
+        for (HeadersEnum e : HeadersEnum.values()) {\r
+            if (e.text.equals(text)) {\r
                 return e;\r
+            }\r
+        }\r
         return HeadersEnum.UNDEFINED;\r
     }\r
 \r
+    /**\r
+     * Gets the patch version.\r
+     *\r
+     * @return the patch version\r
+     */\r
     public static String getPatchVersion() {\r
         return patchVersion;\r
     }\r
 \r
+    /**\r
+     * Gets the latest version.\r
+     *\r
+     * @return the latest version\r
+     */\r
     public static String getLatestVersion() {\r
         return latestVersion;\r
     }\r
 \r
+    /**\r
+     * Validate major version.\r
+     *\r
+     * @param major the major\r
+     * @return true, if successful\r
+     */\r
     public static boolean validateMajorVersion(String major) {\r
         String majorKey = major.toLowerCase();\r
-        if (!supportedMajorVersions.containsKey(majorKey))\r
+        if (!supportedMajorVersions.containsKey(majorKey)) {\r
             return false;\r
+        }\r
         return true;\r
     }\r
 \r
+    /**\r
+     * Validate major minor version.\r
+     *\r
+     * @param major the major\r
+     * @param minor the minor\r
+     * @return true, if successful\r
+     */\r
     public static boolean validateMajorMinorVersion(String major, String minor) {\r
         String majorKey = major.toLowerCase();\r
-        if (!supportedMajorVersions.containsKey(majorKey))\r
+        if (!supportedMajorVersions.containsKey(majorKey)) {\r
             return false;\r
+        }\r
 \r
         if (minor != null) {\r
             String majorMinorKey = majorKey + "." + minor;\r
index 304eb03..04473ea 100644 (file)
@@ -247,8 +247,9 @@ public class ChangeManagementDetail {
      * @return the start time\r
      */\r
     public String getStartTime() {\r
-        if (startTimeMillis != null)\r
+        if (startTimeMillis != null) {\r
             return ISODateTimeFormat.dateTimeNoMillis().print(startTimeMillis);\r
+        }\r
         return null;\r
     }\r
 \r
@@ -265,8 +266,9 @@ public class ChangeManagementDetail {
      * @return the finish time\r
      */\r
     public String getFinishTime() {\r
-        if (finishTimeMillis != null)\r
+        if (finishTimeMillis != null) {\r
             return ISODateTimeFormat.dateTimeNoMillis().print(finishTimeMillis);\r
+        }\r
         return null;\r
     }\r
 \r
index c8f7e85..84b454e 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
- * Copyright � 2017-2018 AT&T Intellectual Property. Modifications Copyright � 2018 IBM.\r
+ * Copyright © 2017-2018 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
index 200e641..aa1f0d6 100644 (file)
@@ -1,23 +1,23 @@
 /*\r
  * Copyright © 2017-2018 AT&T Intellectual Property. Modifications Copyright © 2018 IBM.\r
- * \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
+ *\r
  * http://www.apache.org/licenses/LICENSE-2.0\r
- * \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
+ *\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
+ *\r
  * https://creativecommons.org/licenses/by/4.0/\r
- * \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
@@ -48,7 +48,7 @@ import org.joda.time.format.ISODateTimeFormat;
 \r
 /**\r
  * The persistent class for the schedules database table.\r
- * \r
+ *\r
  */\r
 @Entity\r
 @Table(name = "SCHEDULES")\r
@@ -151,210 +151,461 @@ public class Schedule implements Serializable {
     @Transient\r
     List<ChangeManagementGroup> groups;\r
 \r
+    /**\r
+     * Instantiates a new schedule.\r
+     */\r
     public Schedule() {}\r
 \r
+    /**\r
+     * Gets the uuid.\r
+     *\r
+     * @return the uuid\r
+     */\r
     public UUID getUuid() {\r
         return uuid;\r
     }\r
 \r
+    /**\r
+     * Sets the uuid.\r
+     *\r
+     * @param uuid the new uuid\r
+     */\r
     public void setUuid(UUID uuid) {\r
         this.uuid = uuid;\r
     }\r
 \r
+    /**\r
+     * Sets the domain data.\r
+     *\r
+     * @param domainData the new domain data\r
+     */\r
     public void setDomainData(List<DomainData> domainData) {\r
         this.domainData = domainData;\r
     }\r
 \r
+    /**\r
+     * Sets the schedule approvals.\r
+     *\r
+     * @param scheduleApprovals the new schedule approvals\r
+     */\r
     public void setScheduleApprovals(List<ScheduleApproval> scheduleApprovals) {\r
         this.scheduleApprovals = scheduleApprovals;\r
     }\r
 \r
+    /**\r
+     * Gets the creates the date time.\r
+     *\r
+     * @return the creates the date time\r
+     */\r
     public String getCreateDateTime() {\r
-        if (createDateTimeMillis != null)\r
+        if (createDateTimeMillis != null) {\r
             return ISODateTimeFormat.dateTimeNoMillis().print(this.createDateTimeMillis);\r
+        }\r
         return null;\r
     }\r
 \r
+    /**\r
+     * Sets the creates the date time.\r
+     *\r
+     * @param datetime the new creates the date time\r
+     */\r
     public void setCreateDateTime(String datetime) {\r
         // only set time via setCreateDateTimeMillis\r
     }\r
 \r
+    /**\r
+     * Sets the creates the date time millis.\r
+     *\r
+     * @param millis the new creates the date time millis\r
+     */\r
     public void setCreateDateTimeMillis(Long millis) {\r
         this.createDateTimeMillis = millis;\r
     }\r
 \r
+    /**\r
+     * Gets the creates the date time millis.\r
+     *\r
+     * @return the creates the date time millis\r
+     */\r
     public long getCreateDateTimeMillis() {\r
         return this.createDateTimeMillis;\r
     }\r
 \r
+    /**\r
+     * Gets the delete date time millis.\r
+     *\r
+     * @return the delete date time millis\r
+     */\r
     public Long getDeleteDateTimeMillis() {\r
         return deleteDateTimeMillis;\r
     }\r
 \r
+    /**\r
+     * Sets the delete date time millis.\r
+     *\r
+     * @param deleteDateTimeMillis the new delete date time millis\r
+     */\r
     public void setDeleteDateTimeMillis(Long deleteDateTimeMillis) {\r
         this.deleteDateTimeMillis = deleteDateTimeMillis;\r
     }\r
 \r
+    /**\r
+     * Gets the delete date time.\r
+     *\r
+     * @return the delete date time\r
+     */\r
     public String getDeleteDateTime() {\r
-        if (deleteDateTimeMillis != null)\r
+        if (deleteDateTimeMillis != null) {\r
             return ISODateTimeFormat.dateTimeNoMillis().print(this.deleteDateTimeMillis);\r
+        }\r
         return null;\r
     }\r
 \r
+    /**\r
+     * Sets the delete date time.\r
+     *\r
+     * @param deleteDateTime the new delete date time\r
+     */\r
     public void setDeleteDateTime(String deleteDateTime) {}\r
 \r
+    /**\r
+     * Gets the optimizer date time.\r
+     *\r
+     * @return the optimizer date time\r
+     */\r
     public String getOptimizerDateTime() {\r
-        if (optimizerDateTimeMillis != null)\r
+        if (optimizerDateTimeMillis != null) {\r
             return ISODateTimeFormat.dateTimeNoMillis().print(this.optimizerDateTimeMillis);\r
+        }\r
         return null;\r
     }\r
 \r
+    /**\r
+     * Sets the optimizer date time.\r
+     *\r
+     * @param optimizerDateTime the new optimizer date time\r
+     */\r
     public void setOptimizerDateTime(String optimizerDateTime) {}\r
 \r
+    /**\r
+     * Gets the optimizer message.\r
+     *\r
+     * @return the optimizer message\r
+     */\r
     public String getOptimizerMessage() {\r
         return this.optimizerMessage;\r
     }\r
 \r
+    /**\r
+     * Sets the optimizer message.\r
+     *\r
+     * @param optimizerMessage the new optimizer message\r
+     */\r
     public void setOptimizerMessage(String optimizerMessage) {\r
         this.optimizerMessage = optimizerMessage;\r
     }\r
 \r
+    /**\r
+     * Gets the optimizer status.\r
+     *\r
+     * @return the optimizer status\r
+     */\r
     public String getOptimizerStatus() {\r
         return this.optimizerStatus;\r
     }\r
 \r
+    /**\r
+     * Sets the optimizer status.\r
+     *\r
+     * @param optimizerStatus the new optimizer status\r
+     */\r
     public void setOptimizerStatus(String optimizerStatus) {\r
         this.optimizerStatus = optimizerStatus;\r
     }\r
 \r
+    /**\r
+     * Gets the schedule.\r
+     *\r
+     * @return the schedule\r
+     */\r
     public String getSchedule() {\r
         return this.schedule;\r
     }\r
 \r
+    /**\r
+     * Sets the schedule.\r
+     *\r
+     * @param schedule the new schedule\r
+     */\r
     public void setSchedule(String schedule) {\r
         this.schedule = schedule;\r
     }\r
 \r
+    /**\r
+     * Gets the schedule id.\r
+     *\r
+     * @return the schedule id\r
+     */\r
     public String getScheduleId() {\r
         return this.scheduleId;\r
     }\r
 \r
+    /**\r
+     * Sets the schedule id.\r
+     *\r
+     * @param scheduleId the new schedule id\r
+     */\r
     public void setScheduleId(String scheduleId) {\r
         this.scheduleId = scheduleId;\r
     }\r
 \r
+    /**\r
+     * Gets the schedule name.\r
+     *\r
+     * @return the schedule name\r
+     */\r
     public String getScheduleName() {\r
         return this.scheduleName;\r
     }\r
 \r
+    /**\r
+     * Sets the schedule name.\r
+     *\r
+     * @param scheduleName the new schedule name\r
+     */\r
     public void setScheduleName(String scheduleName) {\r
         this.scheduleName = scheduleName;\r
     }\r
 \r
+    /**\r
+     * Gets the schedule info.\r
+     *\r
+     * @return the schedule info\r
+     */\r
     public String getScheduleInfo() {\r
         return this.scheduleInfo;\r
     }\r
 \r
+    /**\r
+     * Sets the schedule info.\r
+     *\r
+     * @param scheduleInfo the new schedule info\r
+     */\r
     public void setScheduleInfo(String scheduleInfo) {\r
         this.scheduleInfo = scheduleInfo;\r
     }\r
 \r
+    /**\r
+     * Gets the status.\r
+     *\r
+     * @return the status\r
+     */\r
     public String getStatus() {\r
         return this.status;\r
     }\r
 \r
+    /**\r
+     * Sets the status.\r
+     *\r
+     * @param status the new status\r
+     */\r
     public void setStatus(String status) {\r
         this.status = status;\r
     }\r
 \r
+    /**\r
+     * Gets the user id.\r
+     *\r
+     * @return the user id\r
+     */\r
     public String getUserId() {\r
         return this.userId;\r
     }\r
 \r
+    /**\r
+     * Sets the user id.\r
+     *\r
+     * @param userId the new user id\r
+     */\r
     public void setUserId(String userId) {\r
         this.userId = userId;\r
     }\r
 \r
+    /**\r
+     * Gets the domain.\r
+     *\r
+     * @return the domain\r
+     */\r
     public String getDomain() {\r
         return domain;\r
     }\r
 \r
+    /**\r
+     * Sets the domain.\r
+     *\r
+     * @param domain the new domain\r
+     */\r
     public void setDomain(String domain) {\r
         this.domain = domain;\r
     }\r
 \r
+    /**\r
+     * Gets the domain data.\r
+     *\r
+     * @return the domain data\r
+     */\r
     public List<DomainData> getDomainData() {\r
         return domainData;\r
     }\r
 \r
+    /**\r
+     * Gets the schedule approvals.\r
+     *\r
+     * @return the schedule approvals\r
+     */\r
     public List<ScheduleApproval> getScheduleApprovals() {\r
         return scheduleApprovals;\r
     }\r
 \r
+    /**\r
+     * Adds the domain data.\r
+     *\r
+     * @param domainData the domain data\r
+     * @return the domain data\r
+     */\r
     public DomainData addDomainData(DomainData domainData) {\r
         List<DomainData> list = getDomainData();\r
-        if (list == null)\r
+        if (list == null) {\r
             list = new ArrayList<DomainData>();\r
+        }\r
         list.add(domainData);\r
         domainData.setSchedule(this);\r
         return domainData;\r
     }\r
 \r
+    /**\r
+     * Adds the schedule approval.\r
+     *\r
+     * @param sa the sa\r
+     * @return the schedule approval\r
+     */\r
     public ScheduleApproval addScheduleApproval(ScheduleApproval sa) {\r
         List<ScheduleApproval> list = getScheduleApprovals();\r
-        if (list == null)\r
+        if (list == null) {\r
             list = new ArrayList<ScheduleApproval>();\r
+        }\r
         list.add(sa);\r
         sa.setSchedule(this);\r
         return sa;\r
     }\r
 \r
+    /**\r
+     * Gets the optimizer attempts to schedule.\r
+     *\r
+     * @return the optimizer attempts to schedule\r
+     */\r
     public Integer getOptimizerAttemptsToSchedule() {\r
         return optimizerAttemptsToSchedule;\r
     }\r
 \r
+    /**\r
+     * Sets the optimizer attempts to schedule.\r
+     *\r
+     * @param optimizerAttemptsToSchedule the new optimizer attempts to schedule\r
+     */\r
     public void setOptimizerAttemptsToSchedule(Integer optimizerAttemptsToSchedule) {\r
         this.optimizerAttemptsToSchedule = optimizerAttemptsToSchedule;\r
     }\r
 \r
+    /**\r
+     * Gets the optimizer return date time.\r
+     *\r
+     * @return the optimizer return date time\r
+     */\r
     public String getOptimizerReturnDateTime() {\r
-        if (optimizerReturnDateTimeMillis != null)\r
+        if (optimizerReturnDateTimeMillis != null) {\r
             return ISODateTimeFormat.dateTimeNoMillis().print(this.optimizerReturnDateTimeMillis);\r
+        }\r
         return null;\r
     }\r
 \r
+    /**\r
+     * Sets the optimizer return date time.\r
+     *\r
+     * @param optimizerReturnDateTime the new optimizer return date time\r
+     */\r
     public void setOptimizerReturnDateTime(String optimizerReturnDateTime) {\r
 \r
     }\r
 \r
+    /**\r
+     * Gets the optimizer transaction id.\r
+     *\r
+     * @return the optimizer transaction id\r
+     */\r
     public String getOptimizerTransactionId() {\r
         return optimizerTransactionId;\r
     }\r
 \r
+    /**\r
+     * Sets the optimizer transaction id.\r
+     *\r
+     * @param optimizerTransactionId the new optimizer transaction id\r
+     */\r
     public void setOptimizerTransactionId(String optimizerTransactionId) {\r
         this.optimizerTransactionId = optimizerTransactionId;\r
     }\r
 \r
+    /**\r
+     * Gets the optimizer date time millis.\r
+     *\r
+     * @return the optimizer date time millis\r
+     */\r
     public Long getOptimizerDateTimeMillis() {\r
         return optimizerDateTimeMillis;\r
     }\r
 \r
+    /**\r
+     * Sets the optimizer date time millis.\r
+     *\r
+     * @param optimizerDateTimeMillis the new optimizer date time millis\r
+     */\r
     public void setOptimizerDateTimeMillis(Long optimizerDateTimeMillis) {\r
         this.optimizerDateTimeMillis = optimizerDateTimeMillis;\r
     }\r
 \r
+    /**\r
+     * Gets the optimizer return date time millis.\r
+     *\r
+     * @return the optimizer return date time millis\r
+     */\r
     public Long getOptimizerReturnDateTimeMillis() {\r
         return optimizerReturnDateTimeMillis;\r
     }\r
 \r
+    /**\r
+     * Sets the optimizer return date time millis.\r
+     *\r
+     * @param optimizerReturnDateTimeMillis the new optimizer return date time millis\r
+     */\r
     public void setOptimizerReturnDateTimeMillis(Long optimizerReturnDateTimeMillis) {\r
         this.optimizerReturnDateTimeMillis = optimizerReturnDateTimeMillis;\r
     }\r
 \r
+    /**\r
+     * Gets the groups.\r
+     *\r
+     * @return the groups\r
+     */\r
     public List<ChangeManagementGroup> getGroups() {\r
         return groups;\r
     }\r
 \r
+    /**\r
+     * Sets the groups.\r
+     *\r
+     * @param groups the new groups\r
+     */\r
     public void setGroups(List<ChangeManagementGroup> groups) {\r
         this.groups = groups;\r
     }\r
index 588aede..184a014 100644 (file)
@@ -1,23 +1,23 @@
 /*\r
  * Copyright © 2017-2018 AT&T Intellectual Property. Modifications Copyright © 2018 IBM.\r
- * \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
+ *\r
  * http://www.apache.org/licenses/LICENSE-2.0\r
- * \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
+ *\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
+ *\r
  * https://creativecommons.org/licenses/by/4.0/\r
- * \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
@@ -44,7 +44,7 @@ import org.joda.time.format.ISODateTimeFormat;
 \r
 /**\r
  * The persistent class for the schedule_approvals database table.\r
- * \r
+ *\r
  */\r
 @Entity\r
 @Table(name = "SCHEDULE_APPROVALS")\r
@@ -86,9 +86,15 @@ public class ScheduleApproval implements Serializable {
     public ScheduleApproval() {}\r
 \r
 \r
+    /**\r
+     * Gets the approval date time.\r
+     *\r
+     * @return the approval date time\r
+     */\r
     public String getApprovalDateTime() {\r
-        if (approvalDateTimeMillis != null)\r
+        if (approvalDateTimeMillis != null) {\r
             return ISODateTimeFormat.dateTimeNoMillis().print(this.approvalDateTimeMillis);\r
+        }\r
         return null;\r
     }\r
 \r
index 303be20..976a57f 100644 (file)
@@ -49,7 +49,7 @@ public interface ChangeManagementChangeWindowDAO
     void delete(ChangeManagementChangeWindow toDelete);\r
 \r
     @Query(value = "SELECT d FROM ChangeManagementChangeWindow d WHERE d.changeManagementGroupUuid = ?1")\r
-    List<ChangeManagementChangeWindow> findByGroupsUUID(UUID id);\r
+    List<ChangeManagementChangeWindow> findByGroupsUuid(UUID id);\r
 \r
     @Modifying\r
     @Query(value = "DELETE FROM ChangeManagementChangeWindow d WHERE d.changeManagementGroupUuid = ?1")\r
index 7acc228..7694d8d 100644 (file)
@@ -47,9 +47,9 @@ public interface ChangeManagementGroupDAO extends PagingAndSortingRepository<Cha
     void delete(ChangeManagementGroup toDelete);\r
 \r
     @Query(value = "SELECT d FROM ChangeManagementGroup d WHERE d.schedulesUuid = ?1")\r
-    List<ChangeManagementGroup> findBySchedulesID(UUID id);\r
+    List<ChangeManagementGroup> findBySchedulesId(UUID id);\r
 \r
     @Query(value = "SELECT d FROM ChangeManagementGroup d WHERE d.schedulesUuid = ?1 AND d.groupId = ?2")\r
-    ChangeManagementGroup findOneBySchedulesIDGroupID(UUID id, String groupId);\r
+    ChangeManagementGroup findOneBySchedulesIdGroupId(UUID id, String groupId);\r
 \r
 }\r
index 27a5029..8741587 100644 (file)
@@ -66,14 +66,18 @@ public interface ChangeManagementScheduleDAO extends PagingAndSortingRepository<
             + " AND g.groupId = ?2"\r
             + " AND d.changeManagementGroupUuid = g.uuid"\r
             + " AND d.vnfName = ?3")\r
-    ChangeManagementSchedule findOneByScheduleUUIDGroupIdAndVnfName(UUID id, String groupId, String vnfName);\r
+    ChangeManagementSchedule findOneByScheduleUuidGroupIdAndVnfName(UUID id, String groupId, String vnfName);\r
 \r
 \r
-    @Query(value = "SELECT d FROM ChangeManagementSchedule d WHERE (d.status = ?1 AND d.startTimeMillis <= ?2) or d.status = 'Scheduled Immediate' order by d.startTimeMillis")\r
+    @Query(value = "SELECT d FROM ChangeManagementSchedule d"\r
+                    + " WHERE (d.status = ?1 AND d.startTimeMillis <= ?2)"\r
+                    + " or d.status = 'Scheduled Immediate' order by d.startTimeMillis")\r
     List<ChangeManagementSchedule> findByStatusAndEndTime(String status, Long date);\r
 \r
     @Modifying\r
-    @Query(value = "Update ChangeManagementSchedule d set d.status = 'Scheduled', d.dispatcherInstance = '' WHERE d.status = 'Queued for Dispatch' AND d.dispatcherInstance = ?1")\r
+    @Query(value = "Update ChangeManagementSchedule d set d.status = 'Scheduled',"\r
+                    + " d.dispatcherInstance = ''"\r
+                    + " WHERE d.status = 'Queued for Dispatch' AND d.dispatcherInstance = ?1")\r
     public int requeueQueuedForDispatch(String dispatcherInstance);\r
 \r
     @Query(value = "SELECT d FROM ChangeManagementSchedule d WHERE d.status = 'Triggered'")\r
index 90843c4..14d3143 100644 (file)
@@ -50,10 +50,10 @@ public interface ScheduleDAO extends PagingAndSortingRepository<Schedule, UUID>
     void delete(Schedule toDelete);\r
 \r
     @Query(value = "SELECT s FROM Schedule s WHERE s.domain = ?1 AND s.scheduleId= ?2 ")\r
-    Schedule findByDomainScheduleID(String domain, String scheduleId);\r
+    Schedule findByDomainScheduleId(String domain, String scheduleId);\r
 \r
     @Query(value = "SELECT s FROM Schedule s WHERE s.domain = ?1 AND s.status = ?2 ")\r
-    List<Schedule> findByDomainStatus(String domain, String Status);\r
+    List<Schedule> findByDomainStatus(String domain, String status);\r
 \r
     @Query(value = "SELECT s FROM Schedule s WHERE s.optimizerTransactionId= ?1")\r
     Schedule findOneByTransactionId(String transactionId);\r
index 80bb7f0..b5a6e57 100644 (file)
@@ -1,27 +1,27 @@
 /*\r
  * Copyright © 2017-2018 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
@@ -54,11 +54,12 @@ public class ScheduleQueryDAOImpl implements ScheduleQueryDAO {
                 + " left outer join APPROVAL_TYPES at on sa.approval_types_uuid = at.uuid ");\r
         sql.append(where);\r
         sql.append(" order by uuid ");\r
-        if (limit > 0)\r
+        if (limit > 0) {\r
             sql.append("LIMIT " + limit);\r
+        }\r
 \r
-        Query q = manager.createNativeQuery(sql.toString(), ScheduleQuery.class);\r
-        List<ScheduleQuery> list = q.getResultList();\r
+        Query qry = manager.createNativeQuery(sql.toString(), ScheduleQuery.class);\r
+        List<ScheduleQuery> list = qry.getResultList();\r
         return list;\r
     }\r
 }\r
index 4fd0164..898339a 100644 (file)
@@ -72,7 +72,7 @@ public class CmsoOptimizerClient {
     private static EELFLogger debug = EELFManager.getInstance().getDebugLogger();
 
     @Autowired
-    ScheduleDAO scheduleDAO;
+    ScheduleDAO scheduleDao;
 
     @Autowired
     Environment env;
@@ -92,7 +92,7 @@ public class CmsoOptimizerClient {
         Map<String, String> mdcSave = Mdc.save();
         try {
             // Ensure that only one cmso is requsting this call to optimizer
-            Schedule schedule = scheduleDAO.lockOne(uuid);
+            Schedule schedule = scheduleDao.lockOne(uuid);
             if (schedule.getStatus().equals(CMSStatusEnum.PendingSchedule.toString())) {
                 scheduleNewOptimization(schedule);
             }
@@ -205,13 +205,13 @@ public class CmsoOptimizerClient {
                         break;
                     case 500:
                     default: {
-                        String message = response.readEntity(String.class);
                         // SHould probably track the number of retries.
                         schedule.setOptimizerDateTimeMillis(System.currentTimeMillis());
                         int tries = schedule.getOptimizerAttemptsToSchedule();
                         tries++;
                         schedule.setStatus(CMSStatusEnum.ScheduleFailed.toString());
                         schedule.setOptimizerAttemptsToSchedule(tries);
+                        String message = response.readEntity(String.class);
                         schedule.setOptimizerMessage(message);
                         updateScheduleStatus(schedule);
                         /// Got processing error response
@@ -255,8 +255,6 @@ public class CmsoOptimizerClient {
     public void pollOptimizer(Schedule schedule) {
         try {
             String optimizerurl = env.getProperty("cmso.optimizer.status.url");
-            String username = env.getProperty("mechid.user");
-            String password = pm.getProperty("mechid.pass", "");
             Long timeout = env.getProperty("cmso.optimizer.request.timeout.secs", Long.class);
             if (timeout == null) {
                 timeout = 3600L;
@@ -276,6 +274,8 @@ public class CmsoOptimizerClient {
             // If the request is successfully scheduled in optimizer, status will be
             // updated to OptimizationInProgress.
             Client client = ClientBuilder.newClient();
+            String username = env.getProperty("mechid.user");
+            String password = pm.getProperty("mechid.pass", "");
             client.register(new BasicAuthenticatorFilter(username, password));
             client.register(new CmsoClientFilters());
             WebTarget optimizerTarget = client.target(optimizerurl);
@@ -337,7 +337,7 @@ public class CmsoOptimizerClient {
             schedule.setOptimizerStatus("Failed to parse optimizer request");
             schedule.setOptimizerDateTimeMillis(System.currentTimeMillis());
             schedule.setStatus(CMSStatusEnum.OptimizationFailed.toString());
-            scheduleDAO.save(schedule);
+            scheduleDao.save(schedule);
         }
         return null;
     }
@@ -375,7 +375,7 @@ public class CmsoOptimizerClient {
      */
     @Transactional
     public void updateScheduleStatus(Schedule schedule) {
-        scheduleDAO.save(schedule);
+        scheduleDao.save(schedule);
     }
 
     /**
index ea78df1..cb658bb 100644 (file)
@@ -63,19 +63,19 @@ public class CmsoOptimizerHandler {
     Environment env;
 
     @Autowired
-    ChangeManagementScheduleDAO cmScheduleDAO;
+    ChangeManagementScheduleDAO cmScheduleDao;
 
     @Autowired
-    ScheduleDAO scheduleDAO;
+    ScheduleDAO scheduleDao;
 
     @Autowired
-    ChangeManagementGroupDAO cmGroupDAO;
+    ChangeManagementGroupDAO cmGroupDao;
 
     @Autowired
-    ChangeManagementChangeWindowDAO cmChangeWindowDAO;
+    ChangeManagementChangeWindowDAO cmChangeWindowDao;
 
     @Autowired
-    ChangeManagementDetailDAO cmDetailsDAO;
+    ChangeManagementDetailDAO cmDetailsDao;
 
     /**
      * Handle optimizer response.
@@ -97,7 +97,7 @@ public class CmsoOptimizerHandler {
                 // The dispatch logic ensures that we only every dispatch once.
                 case OptimizationInProgress:
                     processResponse(response, schedule);
-                    scheduleDAO.save(schedule);
+                    scheduleDao.save(schedule);
                     break;
                 default:
                     throw new CMSException(Status.PRECONDITION_FAILED, LogMessages.OPTIMIZER_CALLBACK_STATE_ERROR,
@@ -128,7 +128,7 @@ public class CmsoOptimizerHandler {
                 default:
                     break;
             }
-            scheduleDAO.save(schedule);
+            scheduleDao.save(schedule);
         } catch (CMSException e) {
             Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());
             schedule.setStatus(CMSStatusEnum.OptimizationFailed.toString());
@@ -163,7 +163,7 @@ public class CmsoOptimizerHandler {
             return;
         }
 
-        List<ChangeManagementGroup> groups = cmGroupDAO.findBySchedulesID(schedule.getUuid());
+        List<ChangeManagementGroup> groups = cmGroupDao.findBySchedulesId(schedule.getUuid());
         Map<String, ChangeManagementGroup> updatedGroups = new HashMap<>();
 
         for (ScheduledElement element : osi.getScheduledElements()) {
@@ -171,27 +171,27 @@ public class CmsoOptimizerHandler {
             String groupId = element.getGroupId();
             String vnfName = element.getElementId();
             ChangeManagementSchedule cms =
-                            cmScheduleDAO.findOneByScheduleUUIDGroupIdAndVnfName(schedule.getUuid(), groupId, vnfName);
+                            cmScheduleDao.findOneByScheduleUuidGroupIdAndVnfName(schedule.getUuid(), groupId, vnfName);
             cms.setStartTimeMillis(element.getStartTime().getTime());
             cms.setFinishTimeMillis(element.getEndTime().getTime());
             cms.setStatus(CMSStatusEnum.PendingApproval.toString());
-            cmScheduleDAO.save(cms);
+            cmScheduleDao.save(cms);
         }
         if (osi.getUnScheduledElements() != null) {
             for (UnScheduledElement element : osi.getUnScheduledElements()) {
                 String groupId = element.getGroupId();
                 String vnfName = element.getElementId();
-                ChangeManagementSchedule cms = cmScheduleDAO.findOneByScheduleUUIDGroupIdAndVnfName(schedule.getUuid(),
+                ChangeManagementSchedule cms = cmScheduleDao.findOneByScheduleUuidGroupIdAndVnfName(schedule.getUuid(),
                                 groupId, vnfName);
                 cms.setStatus(CMSStatusEnum.NotScheduled.toString());
-                cmScheduleDAO.save(cms);
+                cmScheduleDao.save(cms);
 
             }
         }
 
         // Save any changes to the groups
         for (ChangeManagementGroup cmg : updatedGroups.values()) {
-            cmGroupDAO.save(cmg);
+            cmGroupDao.save(cmg);
         }
         schedule.setStatus(CMSStatusEnum.PendingApproval.toString());
     }
index 71a2092..0021c0d 100644 (file)
@@ -60,6 +60,9 @@ import org.springframework.core.env.Environment;
 import org.springframework.scheduling.quartz.QuartzJobBean;\r
 import org.springframework.stereotype.Component;\r
 \r
+/**\r
+ * The Class OptimizerQuartzJob.\r
+ */\r
 @Component\r
 @DisallowConcurrentExecution\r
 public class OptimizerQuartzJob extends QuartzJobBean {\r
@@ -111,8 +114,13 @@ public class OptimizerQuartzJob extends QuartzJobBean {
 \r
     }\r
 \r
-    public void scheduleOptimization(Schedule s) {\r
-        UUID id = s.getUuid();\r
+    /**\r
+     * Schedule optimization.\r
+     *\r
+     * @param sch the s\r
+     */\r
+    public void scheduleOptimization(Schedule sch) {\r
+        UUID id = sch.getUuid();\r
         Map<String, String> mdcSave = Mdc.save();\r
         try {\r
             String url = env.getProperty("cmso.dispatch.url", "http://localhost:8089");\r
@@ -151,13 +159,10 @@ public class OptimizerQuartzJob extends QuartzJobBean {
      * According to the documentation I read, Quartz would queue a job without waiting for the\r
      * completion of the job with @DisallowConcurrentExecution to complete so that there would be a\r
      * backlog of triggers to process\r
-     *\r
      * This was designed to spin though these stale triggers. When this didn't work, I discovered that\r
      * the behavior is that Quartz will wait for the appropriate interval\r
      * after @DisallowConcurrentExecution jobs complete.\r
-     *\r
      * I tested by adding a sleep for an interval > the trigger interval\r
-     *\r
      * QUartz appears to do what makes sense. Leaving this here in case issues arise...\r
      *\r
      */\r
index 18678ff..816a80e 100644 (file)
@@ -58,21 +58,21 @@ public class BaseSchedulerServiceImpl {
     private static EELFLogger log = EELFManager.getInstance().getLogger(BaseSchedulerServiceImpl.class);\r
 \r
     @Autowired\r
-    protected ScheduleDAO scheduleDAO;\r
+    protected ScheduleDAO scheduleDao;\r
 \r
     @Autowired\r
-    DomainDataDAO domainDataDAO;\r
+    DomainDataDAO domainDataDao;\r
 \r
     @Autowired\r
-    ApprovalTypeDAO approvalTypeDAO;\r
+    ApprovalTypeDAO approvalTypeDao;\r
 \r
     @Autowired\r
-    ScheduleApprovalDAO scheduleApprovalDAO;\r
+    ScheduleApprovalDAO scheduleApprovalDao;\r
 \r
     protected Schedule validateAndAddScheduleRequest(OptimizedScheduleMessage scheduleMessage,\r
                     List<DomainData> domainData) throws CMSException {\r
         messageValidations(scheduleMessage);\r
-        Schedule sch = scheduleDAO.findByDomainScheduleID(scheduleMessage.getDomain(), scheduleMessage.getScheduleId());\r
+        Schedule sch = scheduleDao.findByDomainScheduleId(scheduleMessage.getDomain(), scheduleMessage.getScheduleId());\r
 \r
         if (sch != null) {\r
             throw new CMSAlreadyExistsException(scheduleMessage.getDomain(), scheduleMessage.getScheduleId());\r
@@ -91,13 +91,13 @@ public class BaseSchedulerServiceImpl {
         sch.setOptimizerAttemptsToSchedule(0);\r
         sch.setScheduleInfo(scheduleMessage.getSchedulingData().toString());\r
         sch.setStatus(CMSStatusEnum.PendingSchedule.toString());\r
-        scheduleDAO.save(sch);\r
+        scheduleDao.save(sch);\r
         for (DomainData dd : domainData) {\r
             dd.setUuid(UUID.randomUUID());\r
             sch.addDomainData(dd);\r
-            domainDataDAO.save(dd);\r
+            domainDataDao.save(dd);\r
         }\r
-        scheduleDAO.save(sch);\r
+        scheduleDao.save(sch);\r
         return sch;\r
     }\r
 \r
@@ -111,7 +111,7 @@ public class BaseSchedulerServiceImpl {
     }\r
 \r
     protected void deleteScheduleRequest(String domain, String scheduleId) throws CMSException {\r
-        Schedule sch = scheduleDAO.findByDomainScheduleID(domain, scheduleId);\r
+        Schedule sch = scheduleDao.findByDomainScheduleId(domain, scheduleId);\r
         if (sch == null) {\r
             throw new CMSNotFoundException(domain, scheduleId);\r
         }\r
@@ -127,14 +127,14 @@ public class BaseSchedulerServiceImpl {
             default:\r
                 sch.setStatus(CMSStatusEnum.Deleted.toString());\r
         }\r
-        scheduleDAO.save(sch);\r
+        scheduleDao.save(sch);\r
     }\r
 \r
     protected Schedule processApproval(Schedule sch, String domain, ApprovalMessage approvalMessage)\r
                     throws CMSException {\r
         String scheduleId = sch.getScheduleId();\r
         ApprovalType approvalType =\r
-                        approvalTypeDAO.findByDomainAndType(domain, approvalMessage.getApprovalType().toString());\r
+                        approvalTypeDao.findByDomainAndType(domain, approvalMessage.getApprovalType().toString());\r
         if (approvalType == null) {\r
             throw new CMSException(Status.BAD_REQUEST, LogMessages.INVALID_ATTRIBUTE, "approvalType",\r
                             approvalMessage.getApprovalType().toString());\r
@@ -169,7 +169,7 @@ public class BaseSchedulerServiceImpl {
         sa.setStatus(approvalMessage.getApprovalStatus().toString());\r
         sa.setSchedule(sch);\r
         sch.addScheduleApproval(sa);\r
-        scheduleDAO.save(sch);\r
+        scheduleDao.save(sch);\r
         if (sa.getStatus().equals(ApprovalStatusEnum.Rejected.toString())) {\r
             sch.setStatus(CMSStatusEnum.Rejected.toString());\r
         } else {\r
@@ -177,7 +177,7 @@ public class BaseSchedulerServiceImpl {
                 sch.setStatus(CMSStatusEnum.Accepted.toString());\r
             }\r
         }\r
-        scheduleDAO.save(sch);\r
+        scheduleDao.save(sch);\r
         return sch;\r
     }\r
 \r
@@ -188,7 +188,7 @@ public class BaseSchedulerServiceImpl {
         // for\r
         // logging\r
 \r
-        List<ApprovalType> approvalTypes = approvalTypeDAO.findByDomain(schedule.getDomain());\r
+        List<ApprovalType> approvalTypes = approvalTypeDao.findByDomain(schedule.getDomain());\r
         for (ApprovalType at : approvalTypes) {\r
             UUID type = at.getUuid();\r
             Integer count = at.getApprovalCount();\r
index 6abb6bb..6a7b1b3 100644 (file)
@@ -80,16 +80,16 @@ public class CmsoOptimizerCallbackImpl extends BaseSchedulerServiceImpl implemen
 
 
     @Autowired
-    ChangeManagementScheduleDAO cmScheduleDAO;
+    ChangeManagementScheduleDAO cmScheduleDao;
 
     @Autowired
-    ChangeManagementGroupDAO cmGroupDAO;
+    ChangeManagementGroupDAO cmGroupDao;
 
     @Autowired
-    ChangeManagementChangeWindowDAO cmChangeWindowDAO;
+    ChangeManagementChangeWindowDAO cmChangeWindowDao;
 
     @Autowired
-    ChangeManagementDetailDAO cmDetailsDAO;
+    ChangeManagementDetailDAO cmDetailsDaoO;
 
     /**
      * Sniro callback.
@@ -120,7 +120,7 @@ public class CmsoOptimizerCallbackImpl extends BaseSchedulerServiceImpl implemen
             // the response.
             // If this lock times out, the schedule will remain in 'Optimization In
             // Progress' and never complete.
-            Schedule schedule = scheduleDAO.lockOneByTransactionId(transactionId);
+            Schedule schedule = scheduleDao.lockOneByTransactionId(transactionId);
 
             if (schedule == null) {
                 throw new CMSNotFoundException(DomainsEnum.ChangeManagement.toString(),
@@ -136,7 +136,7 @@ public class CmsoOptimizerCallbackImpl extends BaseSchedulerServiceImpl implemen
                 // The dispatch logic ensures that we only every dispatch once.
                 case OptimizationInProgress:
                     processSniroResponse(sniroResponse, schedule);
-                    scheduleDAO.save(schedule);
+                    scheduleDao.save(schedule);
                     response = Response.ok().build();
                     break;
                 default:
@@ -149,7 +149,6 @@ public class CmsoOptimizerCallbackImpl extends BaseSchedulerServiceImpl implemen
         } catch (Exception e) {
             errors.error(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());
             response = Response.serverError().entity(e.getMessage()).build();
-        } finally {
         }
         return response;
     }
@@ -170,7 +169,7 @@ public class CmsoOptimizerCallbackImpl extends BaseSchedulerServiceImpl implemen
                     String groupId = sniroSchedule.getGroupId();
                     DateTime finishTime = convertDate(sniroSchedule.getFinishTime(), "finishTime");
                     DateTime startTime = convertDate(sniroSchedule.getStartTime(), "startTime");
-                    ChangeManagementGroup group = cmGroupDAO.findOneBySchedulesIDGroupID(schedule.getUuid(), groupId);
+                    ChangeManagementGroup group = cmGroupDao.findOneBySchedulesIdGroupId(schedule.getUuid(), groupId);
                     if (group == null) {
                         throw new CMSException(Status.PRECONDITION_FAILED,
                                 LogMessages.CHANGE_MANAGEMENT_GROUP_NOT_FOUND, schedule.getScheduleId(), groupId);
@@ -180,7 +179,7 @@ public class CmsoOptimizerCallbackImpl extends BaseSchedulerServiceImpl implemen
                     DateTime latestInstanceStartTime =
                                     convertDate(sniroSchedule.getLatestInstanceStartTime(), "latestInstanceStartTime");
                     group.setLastInstanceStartTimeMillis(latestInstanceStartTime.getMillis());
-                    cmGroupDAO.save(group);
+                    cmGroupDao.save(group);
                     long totalDuration =
                             (group.getAdditionalDurationInSecs() + group.getNormalDurationInSecs()) * 1000L;
                     Map<String, Map<String, Long>> startAndFinishTimeMap = new HashMap<String, Map<String, Long>>();
@@ -224,7 +223,6 @@ public class CmsoOptimizerCallbackImpl extends BaseSchedulerServiceImpl implemen
         Long nextStartTime = null;
         Long nextFinishTime = null;
         for (int nodeNumber = 0; nodeNumber < nodeList.size(); nodeNumber++) {
-            String node = nodeList.get(nodeNumber);
             if (nodeNumber % concurrencyLimit == 0) {
                 if (nodeNumber == 0) {
                     nextStartTime = startTime;
@@ -242,6 +240,7 @@ public class CmsoOptimizerCallbackImpl extends BaseSchedulerServiceImpl implemen
             Map<String, Long> map = new HashMap<String, Long>();
             map.put("startTime", nextStartTime);
             map.put("finishTime", nextFinishTime);
+            String node = nodeList.get(nodeNumber);
             startAndFinishTimeMap.put(node, map);
         }
 
@@ -250,7 +249,7 @@ public class CmsoOptimizerCallbackImpl extends BaseSchedulerServiceImpl implemen
     private void processNode(Schedule schedule, ChangeManagementGroup group, String node,
             Map<String, Map<String, Long>> startAndFinishTimeMap) throws CMSException {
         Map<String, Long> map = startAndFinishTimeMap.get(node);
-        ChangeManagementSchedule detail = cmScheduleDAO.findOneByGroupUuidAndVnfName(group.getUuid(), node);
+        ChangeManagementSchedule detail = cmScheduleDao.findOneByGroupUuidAndVnfName(group.getUuid(), node);
         if (detail == null) {
             throw new CMSException(Status.NOT_FOUND, LogMessages.UNABLE_TO_LOCATE_SCHEDULE_DETAIL,
                     schedule.getScheduleId(), group.getGroupId(), node);
@@ -259,7 +258,7 @@ public class CmsoOptimizerCallbackImpl extends BaseSchedulerServiceImpl implemen
         detail.setFinishTimeMillis(map.get("finishTime"));
         detail.setVnfId("");
         detail.setStatus(CMSStatusEnum.PendingApproval.toString());
-        cmScheduleDAO.save(detail);
+        cmScheduleDao.save(detail);
     }
 
     /**
index 9b3785a..7ffd606 100644 (file)
@@ -148,7 +148,7 @@ public class CmsoServiceImpl extends CommonServiceImpl implements CmsoService {
                 if (sch != null) {
                     schedules.add(sch);
                     if (includeDetails) {
-                        List<ChangeManagementGroup> groups = cmGroupDao.findBySchedulesID(sch.getUuid());
+                        List<ChangeManagementGroup> groups = cmGroupDao.findBySchedulesId(sch.getUuid());
                         sch.setGroups(groups);
                         for (ChangeManagementGroup g : groups) {
                             List<ChangeManagementSchedule> cmSchedules =
@@ -212,10 +212,8 @@ public class CmsoServiceImpl extends CommonServiceImpl implements CmsoService {
                 if (!name.equals(CmDomainDataEnum.CallbackData.toString())) {
                     NameValue nv = new NameValue(name, map.get(name));
                     dd.add(nv);
-                }
-                else
-                {
-                    callbackData= map.get(name);
+                } else {
+                    callbackData = map.get(name);
                 }
             }
         }
@@ -288,7 +286,7 @@ public class CmsoServiceImpl extends CommonServiceImpl implements CmsoService {
         Response response = null;
         Observation.report(LogMessages.DELETE_SCHEDULE_REQUEST, "Received", request.getRemoteAddr(), scheduleId, "");
         try {
-            Schedule schedule = scheduleDao.findByDomainScheduleID(DomainsEnum.ChangeManagement.toString(), scheduleId);
+            Schedule schedule = scheduleDao.findByDomainScheduleId(DomainsEnum.ChangeManagement.toString(), scheduleId);
             if (schedule == null) {
                 throw new CMSNotFoundException(DomainsEnum.ChangeManagement.toString(), scheduleId);
             }
@@ -315,7 +313,7 @@ public class CmsoServiceImpl extends CommonServiceImpl implements CmsoService {
         Observation.report(LogMessages.GET_SCHEDULE_REQUEST_INFO, "Received", request.getRemoteAddr(), scheduleId, "");
         Schedule schedule = null;
         try {
-            schedule = scheduleDao.findByDomainScheduleID(DomainsEnum.ChangeManagement.toString(), scheduleId);
+            schedule = scheduleDao.findByDomainScheduleId(DomainsEnum.ChangeManagement.toString(), scheduleId);
             if (schedule == null) {
                 throw new CMSException(Status.NOT_FOUND, LogMessages.SCHEDULE_NOT_FOUND,
                                 DomainsEnum.ChangeManagement.toString(), scheduleId);
@@ -342,7 +340,7 @@ public class CmsoServiceImpl extends CommonServiceImpl implements CmsoService {
                         approval.toString());
         try {
             String domain = DomainsEnum.ChangeManagement.toString();
-            Schedule sch = scheduleDao.findByDomainScheduleID(domain, scheduleId);
+            Schedule sch = scheduleDao.findByDomainScheduleId(domain, scheduleId);
             if (sch == null) {
                 throw new CMSNotFoundException(domain, scheduleId);
             }
index 52a0928..750d0a7 100644 (file)
@@ -1,5 +1,5 @@
-/*
- * Copyright © 2017-2019 AT&T Intellectual Property. Modifications Copyright © 2018 IBM.
+/*oaoo
+ * Copyright © 2017-2019 AT&T Intellectaoual Property. Modifications Copyright © 2018 IBM.
  *
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
  * in compliance with the License. You may obtain a copy of the License at
@@ -81,25 +81,25 @@ public class CommonServiceImpl extends BaseSchedulerServiceImpl {
     Environment env;
 
     @Autowired
-    ChangeManagementScheduleDAO cmScheduleDAO;
+    ChangeManagementScheduleDAO cmScheduleDao;
 
     @Autowired
-    ChangeManagementGroupDAO cmGroupDAO;
+    ChangeManagementGroupDAO cmGroupDao;
 
     @Autowired
-    ChangeManagementChangeWindowDAO cmChangeWindowDAO;
+    ChangeManagementChangeWindowDAO cmChangeWindowDao;
 
     @Autowired
-    ChangeManagementDetailDAO cmDetailsDAO;
+    ChangeManagementDetailDAO cmDetailsDao;
 
     @Autowired
-    ScheduleQueryDAO scheduleQueryDAO;
+    ScheduleQueryDAO scheduleQueryDao;
 
     @Autowired
-    ScheduleDAO scheduleDAO;
+    ScheduleDAO scheduleDao;
 
     @Autowired
-    ElementDataDAO elementDataDAO;
+    ElementDataDAO elementDataDao;
 
     @Autowired
     TmClient tmClient;
@@ -225,14 +225,14 @@ public class CommonServiceImpl extends BaseSchedulerServiceImpl {
             cmg.setNormalDurationInSecs(schedulingInfo.getNormalDurationInSeconds());
             cmg.setAdditionalDurationInSecs(schedulingInfo.getAdditionalDurationInSeconds());
             cmg.setConcurrencyLimit(schedulingInfo.getConcurrencyLimit());
-            cmGroupDAO.save(cmg);
+            cmGroupDao.save(cmg);
             for (ChangeWindow cw : schedulingInfo.getChangeWindows()) {
                 ChangeManagementChangeWindow cmcw = new ChangeManagementChangeWindow();
                 cmcw.setUuid(UUID.randomUUID());
                 cmcw.setChangeManagementGroupUuid(cmg.getUuid());
                 cmcw.setStartTimeMillis(cw.getStartTime().getTime());
                 cmcw.setFinishTimeMillis(cw.getEndTime().getTime());
-                cmChangeWindowDAO.save(cmcw);
+                cmChangeWindowDao.save(cmcw);
             }
 
             for (ElementInfo element : groups.get(groupId)) {
@@ -242,7 +242,7 @@ public class CommonServiceImpl extends BaseSchedulerServiceImpl {
                 cms.setVnfName(element.getElementId());
                 cms.setStatus(CMSStatusEnum.PendingSchedule.toString());
                 cms.setRequest(element.getRequest().toString());
-                cmScheduleDAO.save(cms);
+                cmScheduleDao.save(cms);
                 // Save elementData
                 saveElementData(cms, element);
             }
@@ -259,7 +259,7 @@ public class CommonServiceImpl extends BaseSchedulerServiceImpl {
                 ed.setName(nv.getName());
                 // TODO Save as JSON
                 ed.setValue(nv.getValue().toString());
-                elementDataDAO.save(ed);
+                elementDataDao.save(ed);
             }
         }
 
@@ -279,7 +279,7 @@ public class CommonServiceImpl extends BaseSchedulerServiceImpl {
             cmg.setFinishTimeMillis(System.currentTimeMillis() + ((duration * 1000) + (backout * 1000)));
             cmg.setNormalDurationInSecs(duration);
             cmg.setAdditionalDurationInSecs(backout);
-            cmGroupDAO.save(cmg);
+            cmGroupDao.save(cmg);
             for (ElementInfo element : groups.get(groupId)) {
                 ChangeManagementSchedule cms = new ChangeManagementSchedule();
                 cms.setUuid(UUID.randomUUID());
@@ -287,18 +287,18 @@ public class CommonServiceImpl extends BaseSchedulerServiceImpl {
                 cms.setVnfName(element.getElementId());
                 cms.setRequest(element.getRequest().toString());
                 cms.setStatus(CMSStatusEnum.PendingApproval.toString());
-                cmScheduleDAO.save(cms);
+                cmScheduleDao.save(cms);
             }
             schedule.setStatus(CMSStatusEnum.PendingApproval.toString());
-            scheduleDAO.save(schedule);
+            scheduleDao.save(schedule);
         }
     }
 
     protected void deleteChangeManagement(Schedule schedule) throws CMSException {
-        List<ChangeManagementGroup> cmgs = cmGroupDAO.findBySchedulesID(schedule.getUuid());
+        List<ChangeManagementGroup> cmgs = cmGroupDao.findBySchedulesId(schedule.getUuid());
 
         for (ChangeManagementGroup cmg : cmgs) {
-            List<ChangeManagementSchedule> schedules = cmScheduleDAO.findByChangeManagementGroupId(cmg.getUuid());
+            List<ChangeManagementSchedule> schedules = cmScheduleDao.findByChangeManagementGroupId(cmg.getUuid());
             for (ChangeManagementSchedule s : schedules) {
                 CMSStatusEnum currentState = CMSStatusEnum.Completed.fromString(s.getStatus());
                 switch (currentState) {
@@ -314,7 +314,7 @@ public class CommonServiceImpl extends BaseSchedulerServiceImpl {
                     default:
                         s.setStatus(CMSStatusEnum.Deleted.toString());
                 }
-                cmScheduleDAO.save(s);
+                cmScheduleDao.save(s);
             }
         }
 
@@ -342,7 +342,7 @@ public class CommonServiceImpl extends BaseSchedulerServiceImpl {
 
     protected void processApproveScheduleRequest(Schedule sch, ApprovalMessage approval, List<DomainData> domainData)
                     throws CMSException {
-        sch = scheduleDAO.lockOne(sch.getUuid());
+        sch = scheduleDao.lockOne(sch.getUuid());
         String domain = DomainsEnum.ChangeManagement.toString();
         processApproval(sch, domain, approval);
         if (sch.getStatus().equals(CMSStatusEnum.Accepted.toString())) {
@@ -358,10 +358,10 @@ public class CommonServiceImpl extends BaseSchedulerServiceImpl {
 
         Integer maxvnfsperticket = env.getProperty("tm.vnfs.per.ticket", Integer.class, 1);
 
-        List<ChangeManagementGroup> groups = cmGroupDAO.findBySchedulesID(sch.getUuid());
+        List<ChangeManagementGroup> groups = cmGroupDao.findBySchedulesId(sch.getUuid());
         for (ChangeManagementGroup group : groups) {
 
-            List<ChangeManagementSchedule> schedules = cmScheduleDAO.findByChangeManagementGroupId(group.getUuid());
+            List<ChangeManagementSchedule> schedules = cmScheduleDao.findByChangeManagementGroupId(group.getUuid());
             List<List<ChangeManagementSchedule>> ticketList = new ArrayList<List<ChangeManagementSchedule>>();
             List<ChangeManagementSchedule> current = null;
             for (ChangeManagementSchedule cms : schedules) {
@@ -401,20 +401,20 @@ public class CommonServiceImpl extends BaseSchedulerServiceImpl {
             else {
                 cms.setStatus(CMSStatusEnum.Scheduled.toString());
             }
-            cmScheduleDAO.save(cms);
+            cmScheduleDao.save(cms);
         }
         schedule.setStatus(CMSStatusEnum.Scheduled.toString());
-        scheduleDAO.save(schedule);
+        scheduleDao.save(schedule);
     }
 
     private void updateChangeManagementSchedules(Schedule sch, CMSStatusEnum approvalrejected) {
         debug.debug("Entered updateChangeManagementSchedules");
-        List<ChangeManagementGroup> groups = cmGroupDAO.findBySchedulesID(sch.getUuid());
+        List<ChangeManagementGroup> groups = cmGroupDao.findBySchedulesId(sch.getUuid());
         for (ChangeManagementGroup group : groups) {
-            List<ChangeManagementSchedule> schedules = cmScheduleDAO.findByChangeManagementGroupId(group.getUuid());
+            List<ChangeManagementSchedule> schedules = cmScheduleDao.findByChangeManagementGroupId(group.getUuid());
             for (ChangeManagementSchedule schedule : schedules) {
                 schedule.setStatus(approvalrejected.toString());
-                cmScheduleDAO.save(schedule);
+                cmScheduleDao.save(schedule);
             }
         }
         debug.debug("Exited updateChangeManagementSchedules");
index 6785646..79094d3 100644 (file)
@@ -69,7 +69,7 @@ public class HealthCheckImpl implements HealthCheck {
     CmsoOptimizerClient optimizerClient;\r
 \r
     @Autowired\r
-    ApprovalTypeDAO approvalTypeDAO;\r
+    ApprovalTypeDAO approvalTypeDao;\r
 \r
     @Autowired\r
     Environment env;\r
@@ -127,7 +127,7 @@ public class HealthCheckImpl implements HealthCheck {
         String url = env.getProperty("spring.datasource.url");\r
         hcc.setUrl(url);\r
         try {\r
-            approvalTypeDAO.findByDomain("HealthCheck");\r
+            approvalTypeDao.findByDomain("HealthCheck");\r
             hcc.setHealthy(true);\r
             hcc.setStatus("OK");\r
         } catch (Exception e) {\r
index f038905..b8e45fc 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
- * Copyright  2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright  2018 IBM.\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
index 3d104d2..d39798f 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
- * Copyright  2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright  2018 IBM.\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
index cd8c946..9e236e2 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
- * Copyright  2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright  2018 IBM.\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
index 071ab8f..ef0862a 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
- * Copyright  2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright  2018 IBM.\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
index a526065..b5aabf5 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
- * Copyright  2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright  2018 IBM.\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
index f329cfc..495d686 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
- * Copyright � 2017-2018 AT&T Intellectual Property. Modifications Copyright � 2018 IBM.\r
+ * Copyright © 2017-2018 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
index 3d13b6f..a7ae5ed 100644 (file)
@@ -111,7 +111,7 @@ public class TmStatusClient {
             }\r
             Map<GroupAuditStatus, List<ChangeManagementGroup>> groupStatus =\r
                             new HashMap<GroupAuditStatus, List<ChangeManagementGroup>>();\r
-            List<ChangeManagementGroup> groups = cmGroupDao.findBySchedulesID(uuid);\r
+            List<ChangeManagementGroup> groups = cmGroupDao.findBySchedulesId(uuid);\r
 \r
             // Close tickets for completed VNFs\r
             for (ChangeManagementGroup group : groups) {\r