summaryrefslogtreecommitdiffstats
path: root/cmso-service/src/main
diff options
context:
space:
mode:
authorJerry Flood <jflood@att.com>2019-04-03 16:26:26 -0400
committerJerry Flood <jflood@att.com>2019-04-03 16:46:40 -0400
commite8f3843950f26bfdf74fa2d0ca0f2019a1586eb2 (patch)
treee6b8bcb02f98add27c0de2250030fb407206f9a9 /cmso-service/src/main
parentb775e3842710fe1190675d318a0526b8dfb8eead (diff)
Changes for checkstyle warnings
Issue-ID: OPTFRA-466 Change-Id: I2b9cea2c7e2cc760a20715b63618fe75ea58f029 Signed-off-by: Jerry Flood <jflood@att.com>
Diffstat (limited to 'cmso-service/src/main')
-rw-r--r--cmso-service/src/main/docker/assembly/cmso-files.xml2
-rw-r--r--cmso-service/src/main/java/org/onap/observations/Mdc.java2
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/ApplicationPropertiesFiles.java32
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/AutowiringSpringBeanJobFactory.java7
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/aaf/AafUserRole.java2
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/common/ApprovalStatusEnum.java2
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/common/ApprovalTypesEnum.java2
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/common/BasicAuthenticatorFilter.java25
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/common/CMSRequestError.java26
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/common/CMSStatusEnum.java102
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/common/CmHelpers.java40
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/common/Mdc.java12
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/common/PropertiesManagement.java68
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/CmJob.java29
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/DispatchJob.java27
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/rs/DispacherService.java25
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/rs/DispatcherServiceImpl.java6
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/eventq/CMSQueueJob.java38
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/eventq/CmQuartzJob.java10
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/eventq/CmQuartzJobStartup.java36
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/filters/CmsoClientFilters.java30
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/filters/CmsoContainerFilters.java53
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/filters/MessageHeaders.java80
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/model/ChangeManagementDetail.java6
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/model/Domain.java2
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/model/Schedule.java279
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/model/ScheduleApproval.java24
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/model/dao/ChangeManagementChangeWindowDAO.java2
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/model/dao/ChangeManagementGroupDAO.java4
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/model/dao/ChangeManagementScheduleDAO.java10
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/model/dao/ScheduleDAO.java4
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/model/dao/ScheduleQueryDAOImpl.java21
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/optimizer/CmsoOptimizerClient.java14
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/optimizer/CmsoOptimizerHandler.java26
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/optimizer/OptimizerQuartzJob.java15
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/service/rs/BaseSchedulerServiceImpl.java28
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmsoOptimizerCallbackImpl.java23
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmsoServiceImpl.java14
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CommonServiceImpl.java54
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/service/rs/HealthCheckImpl.java4
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/ApprovalMessage.java4
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/CMSInfo.java4
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/CMSMessage.java4
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/ChangeWindowMessage.java4
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/CmDetailsMessage.java4
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/test/loopback/TicketMgtLoopbackService.java2
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/ticketmgt/TmStatusClient.java2
47 files changed, 788 insertions, 422 deletions
diff --git a/cmso-service/src/main/docker/assembly/cmso-files.xml b/cmso-service/src/main/docker/assembly/cmso-files.xml
index 6dcf422..ff67b66 100644
--- a/cmso-service/src/main/docker/assembly/cmso-files.xml
+++ b/cmso-service/src/main/docker/assembly/cmso-files.xml
@@ -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
diff --git a/cmso-service/src/main/java/org/onap/observations/Mdc.java b/cmso-service/src/main/java/org/onap/observations/Mdc.java
index b9b30ea..28d0ec8 100644
--- a/cmso-service/src/main/java/org/onap/observations/Mdc.java
+++ b/cmso-service/src/main/java/org/onap/observations/Mdc.java
@@ -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 {
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/ApplicationPropertiesFiles.java b/cmso-service/src/main/java/org/onap/optf/cmso/ApplicationPropertiesFiles.java
index 912a6e1..99fce31 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/ApplicationPropertiesFiles.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/ApplicationPropertiesFiles.java
@@ -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 {
+}
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/AutowiringSpringBeanJobFactory.java b/cmso-service/src/main/java/org/onap/optf/cmso/AutowiringSpringBeanJobFactory.java
index 04a93d8..781febb 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/AutowiringSpringBeanJobFactory.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/AutowiringSpringBeanJobFactory.java
@@ -17,22 +17,21 @@
package org.onap.optf.cmso;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import org.quartz.spi.TriggerFiredBundle;
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.scheduling.quartz.SpringBeanJobFactory;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
-
/**
* This class makes it possible to use @Autowired references in QuartzJobBeans.
- *
* Also enables @Autowire of the SchedulerFactoryBean the add Triggers
* for @Autowired QuartzJobBeans for ChangeManagement events. Making a big
* investment in SpringBoot Quartz. It had better work ;-)
*
*/
+
public final class AutowiringSpringBeanJobFactory extends SpringBeanJobFactory implements ApplicationContextAware {
private static EELFLogger log = EELFManager.getInstance().getLogger(AutowiringSpringBeanJobFactory.class);
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/aaf/AafUserRole.java b/cmso-service/src/main/java/org/onap/optf/cmso/aaf/AafUserRole.java
index f9351b2..417f9e2 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/aaf/AafUserRole.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/aaf/AafUserRole.java
@@ -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<>();
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/common/ApprovalStatusEnum.java b/cmso-service/src/main/java/org/onap/optf/cmso/common/ApprovalStatusEnum.java
index db48437..ff4fec8 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/common/ApprovalStatusEnum.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/common/ApprovalStatusEnum.java
@@ -1,5 +1,5 @@
/*
- * Copyright � 2017-2018 AT&T Intellectual Property. Modifications Copyright � 2018 IBM.
+ * Copyright © 2017-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
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/common/ApprovalTypesEnum.java b/cmso-service/src/main/java/org/onap/optf/cmso/common/ApprovalTypesEnum.java
index 97e33d5..9555365 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/common/ApprovalTypesEnum.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/common/ApprovalTypesEnum.java
@@ -1,5 +1,5 @@
/*
- * Copyright � 2017-2018 AT&T Intellectual Property. Modifications Copyright � 2018 IBM.
+ * Copyright © 2017-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
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/common/BasicAuthenticatorFilter.java b/cmso-service/src/main/java/org/onap/optf/cmso/common/BasicAuthenticatorFilter.java
index 8b3d3f0..84644e5 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/common/BasicAuthenticatorFilter.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/common/BasicAuthenticatorFilter.java
@@ -17,6 +17,8 @@
package org.onap.optf.cmso.common;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import javax.servlet.http.HttpServletRequest;
@@ -24,20 +26,33 @@ import javax.ws.rs.client.ClientRequestContext;
import javax.ws.rs.client.ClientRequestFilter;
import javax.ws.rs.core.MultivaluedMap;
import javax.xml.bind.DatatypeConverter;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
+/**
+ * The Class BasicAuthenticatorFilter.
+ */
public class BasicAuthenticatorFilter implements ClientRequestFilter {
private static EELFLogger log = EELFManager.getInstance().getLogger(BasicAuthenticatorFilter.class);
private final String user;
private final String password;
+ /**
+ * Instantiates a new basic authenticator filter.
+ *
+ * @param user the user
+ * @param password the password
+ */
public BasicAuthenticatorFilter(String user, String password) {
this.user = user;
this.password = password;
log.info("user: " + user + " pass:" + password);
}
+ /**
+ * Filter.
+ *
+ * @param requestContext the request context
+ * @throws IOException Signals that an I/O exception has occurred.
+ */
@Override
public void filter(ClientRequestContext requestContext) throws IOException {
MultivaluedMap<String, Object> headers = requestContext.getHeaders();
@@ -54,6 +69,12 @@ public class BasicAuthenticatorFilter implements ClientRequestFilter {
}
}
+ /**
+ * Gets the user.
+ *
+ * @param request the request
+ * @return the user
+ */
public static String getUser(HttpServletRequest request) {
String user = "";
String header = request.getHeader("Authorization");
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/common/CMSRequestError.java b/cmso-service/src/main/java/org/onap/optf/cmso/common/CMSRequestError.java
index 161fe9b..ec3804a 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/common/CMSRequestError.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/common/CMSRequestError.java
@@ -1,27 +1,27 @@
/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright © 2018 IBM.
- *
+ * Copyright © 2017-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.
@@ -31,12 +31,12 @@
package org.onap.optf.cmso.common;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
public class CMSRequestError implements Serializable {
private static final long serialVersionUID = 1L;
@@ -66,6 +66,7 @@ public class CMSRequestError implements Serializable {
this.variables = variables;
}
+ @Override
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append(messageId).append(":").append(text).append(":").append(variables);
@@ -74,6 +75,7 @@ public class CMSRequestError implements Serializable {
}
}
+ @Override
public String toString() {
return requestError.toString();
}
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/common/CMSStatusEnum.java b/cmso-service/src/main/java/org/onap/optf/cmso/common/CMSStatusEnum.java
index 5b0a539..62eaec2 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/common/CMSStatusEnum.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/common/CMSStatusEnum.java
@@ -32,64 +32,56 @@
package org.onap.optf.cmso.common;
public enum CMSStatusEnum {
- PendingSchedule(
- "Pending Schedule",
- "Schedule request as been accepted. Pending determination of recommended schedule."),
- SchedulingFailed("Scheduling Failed", "Failed to determine recommended schedule."),
- ScheduleFailed("Schedule Failed", "Determination of recommended schedule failed."),
- OptimizationInProgress(
- "Optimization In Progress", "Determination of recommended schedule is in progress."),
- PendingApproval("Pending Approval", "Pending approval of the recommended schedule."),
- OptimizationFailed("Optimization Failed", "Unable to determine recommended schedule."),
- Accepted("Accepted", "Recommended schedule has been accepted."),
- Scheduled("Scheduled", "All approvals received. Recommended schedule is pending execution."),
- ScheduledImmediate(
- "Scheduled Immediate", "All approvals received. Event is scheduled for immediate execution."),
- Triggered("Triggered", "Scheduled event has been triggered."),
- ApprovalRejected("Approval Rejected", "Recommended schedule has been rejected."),
- PastDue("Past due", "Scheduled event time has passed. Queued event was not dispatched."),
- Error("Error", "Attempt to displatch event failed."),
- Failed("Failed", "Triggered event reported a failure."),
- Rejected("Rejected", "Recommended schedule has been rejected."),
- NotificationsInitiated(
- "Notifications Initiated", "Notifications of scheduled events has been initiated."),
- Completed("Completed", "Notification of all scheduled events have been sent."),
- CompletedWithError(
- "Completed with error(s)", "All scheduled events have completed, some with errors."),
- Deleted("Deleted", "Schedule deleted prior to acceptance or after execution."),
- Cancelled("Cancelled", "Scheduled event cancelled before execution."),
- NotScheduled("Not scheduled by optimizer", "Element not included in the schedule by optimizer."),
- ;
+ PendingSchedule("Pending Schedule",
+ "Schedule request as been accepted. Pending determination of recommended schedule."),
+ SchedulingFailed("Scheduling Failed", "Failed to determine recommended schedule."),
+ ScheduleFailed("Schedule Failed", "Determination of recommended schedule failed."),
+ OptimizationInProgress("Optimization In Progress", "Determination of recommended schedule is in progress."),
+ PendingApproval("Pending Approval", "Pending approval of the recommended schedule."),
+ OptimizationFailed("Optimization Failed", "Unable to determine recommended schedule."),
+ Accepted("Accepted", "Recommended schedule has been accepted."),
+ Scheduled("Scheduled", "All approvals received. Recommended schedule is pending execution."),
+ ScheduledImmediate("Scheduled Immediate", "All approvals received. Event is scheduled for immediate execution."),
+ Triggered("Triggered", "Scheduled event has been triggered."),
+ ApprovalRejected("Approval Rejected", "Recommended schedule has been rejected."),
+ PastDue("Past due", "Scheduled event time has passed. Queued event was not dispatched."),
+ Error("Error", "Attempt to displatch event failed."),
+ Failed("Failed", "Triggered event reported a failure."),
+ Rejected("Rejected", "Recommended schedule has been rejected."),
+ NotificationsInitiated("Notifications Initiated", "Notifications of scheduled events has been initiated."),
+ Completed("Completed", "Notification of all scheduled events have been sent."),
+ CompletedWithError("Completed with error(s)", "All scheduled events have completed, some with errors."),
+ Deleted("Deleted", "Schedule deleted prior to acceptance or after execution."),
+ Cancelled("Cancelled", "Scheduled event cancelled before execution."),
+ NotScheduled("Not scheduled by optimizer", "Element not included in the schedule by optimizer."),;
- private final String text;
- private final String description;
+ private final String text;
+ private final String description;
- private CMSStatusEnum(String text, String description) {
- this.text = text;
- this.description = description;
- }
+ private CMSStatusEnum(String text, String description) {
+ this.text = text;
+ this.description = description;
+ }
- @Override
- public String toString() {
- return text;
- }
+ @Override
+ public String toString() {
+ return text;
+ }
- public CMSStatusEnum fromString(String text) {
- for (CMSStatusEnum e : CMSStatusEnum.values()) if (e.text.equals(text)) return e;
- return null;
- }
+ public CMSStatusEnum fromString(String text) {
+ for (CMSStatusEnum e : CMSStatusEnum.values())
+ if (e.text.equals(text))
+ return e;
+ return null;
+ }
- // To include in the AID.
- public static void main(String argv[]) {
- StringBuilder sb = new StringBuilder();
- sb.append("<html><body><table border=\"1\">\n");
- for (CMSStatusEnum v : CMSStatusEnum.values())
- sb.append("<tr><td>")
- .append(v.text)
- .append("</td><td>")
- .append(v.description)
- .append("</td></tr>\n");
- sb.append("</table></body></html>\n");
- System.out.println(sb.toString());
- }
+ // To include in the AID.
+ public static void main(String argv[]) {
+ StringBuilder sb = new StringBuilder();
+ sb.append("<html><body><table border=\"1\">\n");
+ for (CMSStatusEnum v : CMSStatusEnum.values())
+ sb.append("<tr><td>").append(v.text).append("</td><td>").append(v.description).append("</td></tr>\n");
+ sb.append("</table></body></html>\n");
+ System.out.println(sb.toString());
+ }
}
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/common/CmHelpers.java b/cmso-service/src/main/java/org/onap/optf/cmso/common/CmHelpers.java
index c5ff7f0..034af89 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/common/CmHelpers.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/common/CmHelpers.java
@@ -38,7 +38,7 @@ import org.onap.optf.cmso.model.Schedule;
import org.onap.optf.cmso.service.rs.models.CmDomainDataEnum;
/**
- * Collection of commann static helper methods for CHangeManagement
+ * Collection of commann static helper methods for CHangeManagement.
*
* @author jf9860
*
@@ -49,24 +49,40 @@ public class CmHelpers {
return getDomainData(schedule.getDomainData(), key);
}
+ /**
+ * Gets the domain data.
+ *
+ * @param domainData the domain data
+ * @param key the key
+ * @return the domain data
+ */
public static String getDomainData(List<DomainData> domainData, CmDomainDataEnum key) {
for (DomainData map : domainData) {
- if (map.getName().equals(key.toString()))
+ if (map.getName().equals(key.toString())) {
return map.getValue();
+ }
}
return null;
}
- public static String getEventData(Schedule schedule, CmDomainDataEnum key) {
- return getDomainData(schedule.getDomainData(), key);
- }
+ public static String getEventData(Schedule schedule, CmDomainDataEnum key) {
+ return getDomainData(schedule.getDomainData(), key);
+ }
- public static String getElementData(List<ElementData> eventData, CmDomainDataEnum key) {
- for (ElementData map : eventData) {
- if (map.getName().equals(key.toString()))
- return map.getValue();
- }
- return null;
- }
+ /**
+ * Gets the element data.
+ *
+ * @param eventData the event data
+ * @param key the key
+ * @return the element data
+ */
+ public static String getElementData(List<ElementData> eventData, CmDomainDataEnum key) {
+ for (ElementData map : eventData) {
+ if (map.getName().equals(key.toString())) {
+ return map.getValue();
+ }
+ }
+ return null;
+ }
}
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/common/Mdc.java b/cmso-service/src/main/java/org/onap/optf/cmso/common/Mdc.java
index 30451b5..3230933 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/common/Mdc.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/common/Mdc.java
@@ -60,7 +60,7 @@ import org.slf4j.MDC;
import com.att.eelf.utils.Stopwatch;
/**
- * ECOMP EELF logging MDC fields not defined in the MDC Configuration (i.e.
+ * EELF logging MDC fields not defined in the MDC Configuration (i.e.
* MDC_ALERT_SEVERITY)
**/
public class Mdc {
@@ -116,7 +116,7 @@ public class Mdc {
MDC.put(MDC_SERVER_FQDN, e.getMessage());
}
MDC.put(MDC_SERVICE_INSTANCE_ID, "UNKNOWN");
- MDC.put(MDC_SERVICE_NAME, "ecomp-cmso");
+ MDC.put(MDC_SERVICE_NAME, "cmso");
// MDC.put(MDC_STATUS_CODE, "");
setPartherTargetFromUri(request.getRequestURL().toString());
// Override partner hostname with username
@@ -217,7 +217,7 @@ public class Mdc {
MDC.put(MDC_SERVER_FQDN, e.getMessage());
}
MDC.put(MDC_SERVICE_INSTANCE_ID, "UNKNOWN");
- MDC.put(MDC_SERVICE_NAME, "ecomp-cmso");
+ MDC.put(MDC_SERVICE_NAME, "cmso");
// MDC.put(MDC_STATUS_CODE, "");
// MDC.put(MDC_TARGET_ENTITY, "");
// MDC.put(MDC_TARGET_SERVICE_NAME, "");
@@ -255,7 +255,7 @@ public class Mdc {
// InetAddress.getLocalHost().getHostAddress()); } catch (Exception e){
// MDC.put(MDC_SERVER_FQDN, e.getMessage());}
// MDC.put(MDC_SERVICE_INSTANCE_ID, "UNKNOWN");
- // MDC.put(MDC_SERVICE_NAME, "ecomp-cmso");
+ // MDC.put(MDC_SERVICE_NAME, "cmso");
// MDC.put(MDC_STATUS_CODE, "");
// MDC.put(MDC_TARGET_ENTITY, "");
// MDC.put(MDC_TARGET_SERVICE_NAME, "");
@@ -302,7 +302,7 @@ public class Mdc {
// InetAddress.getLocalHost().getHostAddress()); } catch (Exception e){
// MDC.put(MDC_SERVER_FQDN, e.getMessage());}
// MDC.put(MDC_SERVICE_INSTANCE_ID, "UNKNOWN");
- // MDC.put(MDC_SERVICE_NAME, "ecomp-cmso");
+ // MDC.put(MDC_SERVICE_NAME, "cmso");
// MDC.put(MDC_STATUS_CODE, "");
setPartherTargetFromUri(url);
// MDC.put(MDC_TARGET_ENTITY, "");
@@ -347,7 +347,7 @@ public class Mdc {
// InetAddress.getLocalHost().getHostAddress()); } catch (Exception e){
// MDC.put(MDC_SERVER_FQDN, e.getMessage());}
// MDC.put(MDC_SERVICE_INSTANCE_ID, "UNKNOWN");
- // MDC.put(MDC_SERVICE_NAME, "ecomp-cmso");
+ // MDC.put(MDC_SERVICE_NAME, "cmso");
MDC.put(MDC_STATUS_CODE, "COMPLETE");
if (response.getStatus() == 500)
MDC.put(MDC_STATUS_CODE, "ERROR");
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/common/PropertiesManagement.java b/cmso-service/src/main/java/org/onap/optf/cmso/common/PropertiesManagement.java
index 4514a57..de917e4 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/common/PropertiesManagement.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/common/PropertiesManagement.java
@@ -1,27 +1,27 @@
/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright © 2018 IBM.
- *
+ * Copyright © 2017-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.
@@ -31,40 +31,53 @@
package org.onap.optf.cmso.common;
-import java.io.UnsupportedEncodingException;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
-import javax.xml.bind.DatatypeConverter;
import org.apache.commons.codec.binary.Base64;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
+/**
+ * The Class PropertiesManagement.
+ */
@Component
public class PropertiesManagement {
private static EELFLogger debug = EELFManager.getInstance().getDebugLogger();
private static EELFLogger errors = EELFManager.getInstance().getErrorLogger();
- private final static String algorithm = "AES";
- private final static String cipherMode = "CBC";
- private final static String paddingScheme = "PKCS5Padding";
- private final static String transformation = algorithm + "/" + cipherMode + "/" + paddingScheme;
-
+ private static final String algorithm = "AES";
+ private static final String cipherMode = "CBC";
+ private static final String paddingScheme = "PKCS5Padding";
+ private static final String transformation = algorithm + "/" + cipherMode + "/" + paddingScheme;
private static final String initVector = "ONAPCMSOVECTORIV"; // 16 bytes IV
@Autowired
Environment env;
+ /**
+ * Gets the property.
+ *
+ * @param key the key
+ * @param defaultValue the default value
+ * @return the property
+ */
public String getProperty(String key, String defaultValue) {
String value = env.getProperty(key, defaultValue);
value = getDecryptedValue(value);
return value;
}
+ /**
+ * Gets the decrypted value.
+ *
+ * @param value the value
+ * @return the decrypted value
+ */
public static String getDecryptedValue(String value) {
if (value.startsWith("enc:")) {
String secret = getSecret();
@@ -73,6 +86,12 @@ public class PropertiesManagement {
return value;
}
+ /**
+ * Gets the encrypted value.
+ *
+ * @param value the value
+ * @return the encrypted value
+ */
public static String getEncryptedValue(String value) {
String secret = getSecret();
value = encrypt(secret, initVector, value);
@@ -114,17 +133,4 @@ public class PropertiesManagement {
return "ONAPCMSOSECRETIV";
}
- public static void main(String[] args) {
- try {
- String pass = getDecryptedValue("enc:bfodXf8qRfCqMvlxVBYNWQ==");
- //System.out.println("Decrypt - "+pass);
- pass = getEncryptedValue("cmso@onap.org");
- //System.out.println("Encrypt - "+pass);
- //System.out.println(DatatypeConverter.printBase64Binary("cmso@onap.org:cmso@onap.org".getBytes("UTF-8")));
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- }
}
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/CmJob.java b/cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/CmJob.java
index 8766eee..256878c 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/CmJob.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/CmJob.java
@@ -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.
@@ -31,16 +31,16 @@
package org.onap.optf.cmso.dispatcher;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import java.util.Map;
import java.util.UUID;
-
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Invocation;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-
import org.onap.observations.Mdc;
import org.onap.optf.cmso.common.BasicAuthenticatorFilter;
import org.onap.optf.cmso.common.LogMessages;
@@ -60,12 +60,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
-
/**
- * This is the Quartz Job that is run to send the workflow to VID for execution
- *
+ * This is the Quartz Job that is run to send the workflow to VID for execution.
+ *
*
*/
@Component
@@ -80,7 +77,7 @@ public class CmJob implements Job {
CMSOClient vidClient;
@Autowired
- ChangeManagementScheduleDAO cmScheduleDAO;
+ ChangeManagementScheduleDAO cmScheduleDao;
@Autowired
ChangeManagementGroupDAO cmGroupDAO;
@@ -126,7 +123,7 @@ public class CmJob implements Job {
String pass = pm.getProperty("mechid.pass", "");
Client client = ClientBuilder.newClient();
client.register(new BasicAuthenticatorFilter(user, pass));
- client.register(new CmsoClientFilters());
+ client.register(new CmsoClientFilters());
WebTarget target = client.target(url);
Invocation.Builder invocationBuilder = target.request(MediaType.APPLICATION_JSON);
Response response = null;
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/DispatchJob.java b/cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/DispatchJob.java
index 60d8bdb..49be23a 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/DispatchJob.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/DispatchJob.java
@@ -1,27 +1,27 @@
/*
* Copyright © 2017-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.
@@ -31,12 +31,14 @@
package org.onap.optf.cmso.dispatcher;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import com.att.eelf.i18n.EELFResourceManager;
import java.net.InetAddress;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
-
import org.onap.optf.cmso.common.CMSStatusEnum;
import org.onap.optf.cmso.common.LogMessages;
import org.onap.optf.cmso.model.ChangeManagementGroup;
@@ -55,19 +57,14 @@ import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
-import com.att.eelf.i18n.EELFResourceManager;
-
/**
- * This is the service used to dispatch a job COuld not get QuartzJobBean to
+ * This is the service used to dispatch a job COuld not get QuartzJobBean to.
* be @Transactional
*
*/
@Component
public class DispatchJob {
private static EELFLogger log = EELFManager.getInstance().getLogger(DispatchJob.class);
- private static EELFLogger metrics = EELFManager.getInstance().getMetricsLogger();
private static EELFLogger errors = EELFManager.getInstance().getErrorLogger();
private static EELFLogger debug = EELFManager.getInstance().getDebugLogger();
@@ -188,7 +185,7 @@ public class DispatchJob {
// (Sleep until actual dispatch time...)
// leadTime allows for preparing call to VID to the start of workflow.
long sleep = (startMillis - leadTime) - System.currentTimeMillis();
- if (sleep > 0l) {
+ if (sleep > 0L) {
try {
Thread.sleep(sleep);
} catch (Exception e) {
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/rs/DispacherService.java b/cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/rs/DispacherService.java
index 3c53759..9d93ec4 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/rs/DispacherService.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/rs/DispacherService.java
@@ -1,27 +1,27 @@
/*
* Copyright © 2017-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.
@@ -31,6 +31,11 @@
package org.onap.optf.cmso.dispatcher.rs;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
@@ -41,12 +46,6 @@ import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-
@Api
@Path("/dispatch")
@Produces({MediaType.APPLICATION_JSON})
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/rs/DispatcherServiceImpl.java b/cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/rs/DispatcherServiceImpl.java
index e612734..84ff91e 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/rs/DispatcherServiceImpl.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/dispatcher/rs/DispatcherServiceImpl.java
@@ -67,9 +67,9 @@ public class DispatcherServiceImpl implements DispacherService {
@Override
@Transactional
public Response dispatchSchedule(String id, UriInfo uri, HttpServletRequest request) {
- debug.debug("dispatchSchedule entered {}" , id);
+ debug.debug("dispatchSchedule entered {}", id);
try {
- UUID uuid = UUID.fromString(id);
+ UUID uuid = UUID.fromString(id);
dispatchJob.execute(uuid);
} catch (Exception e) {
errors.error(LogMessages.UNEXPECTED_EXCEPTION, e.getMessage());
@@ -84,7 +84,7 @@ public class DispatcherServiceImpl implements DispacherService {
public Response dispatchOptimizer(String id, UriInfo uri, HttpServletRequest request) {
debug.debug("dispatchOptimizer entered {}", id);
try {
- UUID uuid = UUID.fromString(id);
+ UUID uuid = UUID.fromString(id);
optimizerClient.scheduleOptimization(uuid);
} catch (Exception e) {
errors.error(LogMessages.UNEXPECTED_EXCEPTION, e.getMessage());
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/eventq/CMSQueueJob.java b/cmso-service/src/main/java/org/onap/optf/cmso/eventq/CMSQueueJob.java
index 86fa038..cb0ca87 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/eventq/CMSQueueJob.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/eventq/CMSQueueJob.java
@@ -31,6 +31,8 @@
package org.onap.optf.cmso.eventq;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import java.util.Date;
import java.util.List;
import org.onap.optf.cmso.common.CMSStatusEnum;
@@ -47,8 +49,6 @@ import org.springframework.core.env.Environment;
import org.springframework.scheduling.quartz.SchedulerFactoryBean;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
/**
* This job will look for ChangeManagementSchedule approved jobs that are due
@@ -64,7 +64,7 @@ public class CMSQueueJob {
private static EELFLogger debug = EELFManager.getInstance().getDebugLogger();
@Autowired
- ChangeManagementScheduleDAO cmScheduleDAO;
+ ChangeManagementScheduleDAO cmScheduleDao;
@Autowired
SchedulerFactoryBean qsScheduler;
@@ -75,15 +75,21 @@ public class CMSQueueJob {
@Autowired
DispatchedEventList dispatchedEventList;
+ /**
+ * Queue imminent jobs.
+ *
+ * @return true, if successful
+ */
public boolean queueImminentJobs() {
Integer interval = env.getProperty("cmso.cm.polling.job.interval.ms", Integer.class, 10000);
Integer lookahead = env.getProperty("cmso.cm.polling.job.lookahead.intervals", Integer.class, 5);
long now = System.currentTimeMillis();
Long endTime = now + (interval * lookahead);
List<ChangeManagementSchedule> schedules =
- cmScheduleDAO.findByStatusAndEndTime(CMSStatusEnum.Scheduled.toString(), endTime);
- if (schedules.size() == 0)
+ cmScheduleDao.findByStatusAndEndTime(CMSStatusEnum.Scheduled.toString(), endTime);
+ if (schedules.size() == 0) {
return false;
+ }
for (ChangeManagementSchedule schedule : schedules) {
try {
if (!dispatchedEventList.isAlreadyDispatched(schedule.getUuid())) {
@@ -106,6 +112,12 @@ public class CMSQueueJob {
return false;
}
+ /**
+ * Schedule cm job.
+ *
+ * @param schedule the schedule
+ * @throws Exception the scheduler exception
+ */
public void scheduleCmJob(ChangeManagementSchedule schedule) throws org.quartz.SchedulerException {
//
Integer dispatherLeadTime = env.getProperty("cmso.cm.dispatcher.lead.time.ms", Integer.class, 5000);
@@ -113,8 +125,9 @@ public class CMSQueueJob {
Long startTime = schedule.getStartTimeMillis();
/// If startTIme is null, it is an immediate start
- if (startTime != null)
+ if (startTime != null) {
dispatchTime = startTime - dispatherLeadTime;
+ }
JobDetail jobDetail = JobBuilder.newJob(CmJob.class).build();
jobDetail.getJobDataMap().put("key", schedule.getUuid().toString());
@@ -122,18 +135,25 @@ public class CMSQueueJob {
TriggerBuilder<Trigger> tb = TriggerBuilder.newTrigger().forJob(jobDetail);
long now = System.currentTimeMillis();
- if (now > dispatchTime)
+ if (now > dispatchTime) {
tb.startNow();
- else
+ }
+ else {
tb.startAt(new Date(dispatchTime));
+ }
Trigger trigger = tb.build();
qsScheduler.getScheduler().scheduleJob(jobDetail, trigger);
}
+ /**
+ * Update schedule status.
+ *
+ * @param cmSchedule the cm schedule
+ */
@Transactional
public void updateScheduleStatus(ChangeManagementSchedule cmSchedule) {
- cmScheduleDAO.save(cmSchedule);
+ cmScheduleDao.save(cmSchedule);
}
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/eventq/CmQuartzJob.java b/cmso-service/src/main/java/org/onap/optf/cmso/eventq/CmQuartzJob.java
index 9e1159a..7816f72 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/eventq/CmQuartzJob.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/eventq/CmQuartzJob.java
@@ -31,6 +31,8 @@
package org.onap.optf.cmso.eventq;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import org.onap.observations.Mdc;
import org.onap.optf.cmso.common.LogMessages;
import org.onap.optf.cmso.model.dao.ChangeManagementScheduleDAO;
@@ -41,8 +43,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.quartz.QuartzJobBean;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
/**
* This quartz job runs periodically to query the ChangeManagementSChedule table
@@ -55,7 +55,7 @@ public class CmQuartzJob extends QuartzJobBean {
private static EELFLogger debug = EELFManager.getInstance().getDebugLogger();
@Autowired
- CMSQueueJob qJob;
+ CMSQueueJob qqJob;
// This is not called directly. Using @Autowired to ensure that startup
// Runs before the fist invocation of executeInternal
@@ -63,7 +63,7 @@ public class CmQuartzJob extends QuartzJobBean {
CmQuartzJobStartup startup;
@Autowired
- ChangeManagementScheduleDAO cmScheduleDAO;
+ ChangeManagementScheduleDAO cmScheduleDao;
@Override
@Transactional
@@ -87,7 +87,7 @@ public class CmQuartzJob extends QuartzJobBean {
boolean moreToSchedule = true;
while (moreToSchedule) {
try {
- moreToSchedule = qJob.queueImminentJobs();
+ moreToSchedule = qqJob.queueImminentJobs();
} catch (Exception e) {
debug.debug(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());
moreToSchedule = false;
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/eventq/CmQuartzJobStartup.java b/cmso-service/src/main/java/org/onap/optf/cmso/eventq/CmQuartzJobStartup.java
index 2624bfe..add1478 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/eventq/CmQuartzJobStartup.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/eventq/CmQuartzJobStartup.java
@@ -1,27 +1,27 @@
/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright © 2018 IBM.
- *
+ * Copyright © 2017-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.
@@ -31,33 +31,31 @@
package org.onap.optf.cmso.eventq;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import java.net.InetAddress;
import java.util.concurrent.atomic.AtomicBoolean;
import org.onap.optf.cmso.model.dao.ChangeManagementScheduleDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
/**
* This bean uses @AUtowired to ensure that it runs once at startup to reset all
* QueuedForDispatch rows that were in flight last time from this
* "dispatcherInstnace" shut down.
- *
* Potentially, in a distributed environment, when a "dispatcherInstance"
* shutdown is detected by another instance, it can run this query to requeue
* these items. We are a long way from there.
- *
* Chances are great that re-queued events will end up being Past Due events
- *
+ *
*/
@Component
public class CmQuartzJobStartup {
private static EELFLogger log = EELFManager.getInstance().getLogger(CmQuartzJobStartup.class);
@Autowired
- ChangeManagementScheduleDAO cmScheduleDAO;
+ ChangeManagementScheduleDAO cmScheduleDao;
private AtomicBoolean started = new AtomicBoolean(false);
@@ -65,12 +63,16 @@ public class CmQuartzJobStartup {
}
+ /**
+ * Startup.
+ */
@Transactional
public void startup() {
try {
- if (started.getAndSet(true))
+ if (started.getAndSet(true)) {
return;
- int rows = cmScheduleDAO.requeueQueuedForDispatch(InetAddress.getLocalHost().getHostAddress());
+ }
+ int rows = cmScheduleDao.requeueQueuedForDispatch(InetAddress.getLocalHost().getHostAddress());
log.info("{0} QUeued For Dispatch rows have been requeued at startup", rows);
} catch (Exception e) {
log.error("Exception caught in requeueing Queued for DIspatch rows at startup", e);
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/filters/CmsoClientFilters.java b/cmso-service/src/main/java/org/onap/optf/cmso/filters/CmsoClientFilters.java
index 3f040ae..d43c60b 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/filters/CmsoClientFilters.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/filters/CmsoClientFilters.java
@@ -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);
}
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/filters/CmsoContainerFilters.java b/cmso-service/src/main/java/org/onap/optf/cmso/filters/CmsoContainerFilters.java
index 4c44163..d62f5c2 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/filters/CmsoContainerFilters.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/filters/CmsoContainerFilters.java
@@ -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());
}
}
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/filters/MessageHeaders.java b/cmso-service/src/main/java/org/onap/optf/cmso/filters/MessageHeaders.java
index ba3efa3..b62cce2 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/filters/MessageHeaders.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/filters/MessageHeaders.java
@@ -1,27 +1,27 @@
/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright © 2018 IBM.
- *
+ * Copyright © 2017-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.
@@ -37,7 +37,14 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Set;
+/**
+ * The Class MessageHeaders.
+ */
public class MessageHeaders {
+
+ /**
+ * The Enum HeadersEnum.
+ */
public enum HeadersEnum {
UNDEFINED("UNDEFINED"), TransactionID("X-TransactionId"), FromAppID("X-FromAppId"), MinorVersion(
"X-MinorVersion"), PatchVersion("X-PatchVersion"), LatestVersion("X-LatestVersion"),;
@@ -50,51 +57,98 @@ public class MessageHeaders {
this.list = new ArrayList<>();
}
+ /**
+ * To string.
+ *
+ * @return the string
+ */
@Override
public String toString() {
return text;
}
}
+ /** The Constant supportedMajorVersions. */
public static final Map<String, String> supportedMajorVersions = new HashMap<String, String>();
+
static {
supportedMajorVersions.put("v1", "0");
supportedMajorVersions.put("v2", "0");
}
+
+ /** The Constant supportedMajorMinorVersions. */
public static final Set<String> supportedMajorMinorVersions = new HashSet<String>();
+
static {
supportedMajorMinorVersions.add("v1.0");
supportedMajorMinorVersions.add("v2.0");
}
+
+ /** The Constant latestVersion. */
public static final String latestVersion = "2.0.0";
+
+ /** The Constant patchVersion. */
public static final String patchVersion = "0";
+ /**
+ * From string.
+ *
+ * @param text the text
+ * @return the headers enum
+ */
public static HeadersEnum fromString(String text) {
- for (HeadersEnum e : HeadersEnum.values())
- if (e.text.equals(text))
+ for (HeadersEnum e : HeadersEnum.values()) {
+ if (e.text.equals(text)) {
return e;
+ }
+ }
return HeadersEnum.UNDEFINED;
}
+ /**
+ * Gets the patch version.
+ *
+ * @return the patch version
+ */
public static String getPatchVersion() {
return patchVersion;
}
+ /**
+ * Gets the latest version.
+ *
+ * @return the latest version
+ */
public static String getLatestVersion() {
return latestVersion;
}
+ /**
+ * Validate major version.
+ *
+ * @param major the major
+ * @return true, if successful
+ */
public static boolean validateMajorVersion(String major) {
String majorKey = major.toLowerCase();
- if (!supportedMajorVersions.containsKey(majorKey))
+ if (!supportedMajorVersions.containsKey(majorKey)) {
return false;
+ }
return true;
}
+ /**
+ * Validate major minor version.
+ *
+ * @param major the major
+ * @param minor the minor
+ * @return true, if successful
+ */
public static boolean validateMajorMinorVersion(String major, String minor) {
String majorKey = major.toLowerCase();
- if (!supportedMajorVersions.containsKey(majorKey))
+ if (!supportedMajorVersions.containsKey(majorKey)) {
return false;
+ }
if (minor != null) {
String majorMinorKey = majorKey + "." + minor;
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/model/ChangeManagementDetail.java b/cmso-service/src/main/java/org/onap/optf/cmso/model/ChangeManagementDetail.java
index 304eb03..04473ea 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/model/ChangeManagementDetail.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/model/ChangeManagementDetail.java
@@ -247,8 +247,9 @@ public class ChangeManagementDetail {
* @return the start time
*/
public String getStartTime() {
- if (startTimeMillis != null)
+ if (startTimeMillis != null) {
return ISODateTimeFormat.dateTimeNoMillis().print(startTimeMillis);
+ }
return null;
}
@@ -265,8 +266,9 @@ public class ChangeManagementDetail {
* @return the finish time
*/
public String getFinishTime() {
- if (finishTimeMillis != null)
+ if (finishTimeMillis != null) {
return ISODateTimeFormat.dateTimeNoMillis().print(finishTimeMillis);
+ }
return null;
}
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/model/Domain.java b/cmso-service/src/main/java/org/onap/optf/cmso/model/Domain.java
index c8f7e85..84b454e 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/model/Domain.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/model/Domain.java
@@ -1,5 +1,5 @@
/*
- * Copyright � 2017-2018 AT&T Intellectual Property. Modifications Copyright � 2018 IBM.
+ * Copyright © 2017-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
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/model/Schedule.java b/cmso-service/src/main/java/org/onap/optf/cmso/model/Schedule.java
index 200e641..aa1f0d6 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/model/Schedule.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/model/Schedule.java
@@ -1,23 +1,23 @@
/*
* Copyright © 2017-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
@@ -48,7 +48,7 @@ import org.joda.time.format.ISODateTimeFormat;
/**
* The persistent class for the schedules database table.
- *
+ *
*/
@Entity
@Table(name = "SCHEDULES")
@@ -151,210 +151,461 @@ public class Schedule implements Serializable {
@Transient
List<ChangeManagementGroup> groups;
+ /**
+ * Instantiates a new schedule.
+ */
public Schedule() {}
+ /**
+ * Gets the uuid.
+ *
+ * @return the uuid
+ */
public UUID getUuid() {
return uuid;
}
+ /**
+ * Sets the uuid.
+ *
+ * @param uuid the new uuid
+ */
public void setUuid(UUID uuid) {
this.uuid = uuid;
}
+ /**
+ * Sets the domain data.
+ *
+ * @param domainData the new domain data
+ */
public void setDomainData(List<DomainData> domainData) {
this.domainData = domainData;
}
+ /**
+ * Sets the schedule approvals.
+ *
+ * @param scheduleApprovals the new schedule approvals
+ */
public void setScheduleApprovals(List<ScheduleApproval> scheduleApprovals) {
this.scheduleApprovals = scheduleApprovals;
}
+ /**
+ * Gets the creates the date time.
+ *
+ * @return the creates the date time
+ */
public String getCreateDateTime() {
- if (createDateTimeMillis != null)
+ if (createDateTimeMillis != null) {
return ISODateTimeFormat.dateTimeNoMillis().print(this.createDateTimeMillis);
+ }
return null;
}
+ /**
+ * Sets the creates the date time.
+ *
+ * @param datetime the new creates the date time
+ */
public void setCreateDateTime(String datetime) {
// only set time via setCreateDateTimeMillis
}
+ /**
+ * Sets the creates the date time millis.
+ *
+ * @param millis the new creates the date time millis
+ */
public void setCreateDateTimeMillis(Long millis) {
this.createDateTimeMillis = millis;
}
+ /**
+ * Gets the creates the date time millis.
+ *
+ * @return the creates the date time millis
+ */
public long getCreateDateTimeMillis() {
return this.createDateTimeMillis;
}
+ /**
+ * Gets the delete date time millis.
+ *
+ * @return the delete date time millis
+ */
public Long getDeleteDateTimeMillis() {
return deleteDateTimeMillis;
}
+ /**
+ * Sets the delete date time millis.
+ *
+ * @param deleteDateTimeMillis the new delete date time millis
+ */
public void setDeleteDateTimeMillis(Long deleteDateTimeMillis) {
this.deleteDateTimeMillis = deleteDateTimeMillis;
}
+ /**
+ * Gets the delete date time.
+ *
+ * @return the delete date time
+ */
public String getDeleteDateTime() {
- if (deleteDateTimeMillis != null)
+ if (deleteDateTimeMillis != null) {
return ISODateTimeFormat.dateTimeNoMillis().print(this.deleteDateTimeMillis);
+ }
return null;
}
+ /**
+ * Sets the delete date time.
+ *
+ * @param deleteDateTime the new delete date time
+ */
public void setDeleteDateTime(String deleteDateTime) {}
+ /**
+ * Gets the optimizer date time.
+ *
+ * @return the optimizer date time
+ */
public String getOptimizerDateTime() {
- if (optimizerDateTimeMillis != null)
+ if (optimizerDateTimeMillis != null) {
return ISODateTimeFormat.dateTimeNoMillis().print(this.optimizerDateTimeMillis);
+ }
return null;
}
+ /**
+ * Sets the optimizer date time.
+ *
+ * @param optimizerDateTime the new optimizer date time
+ */
public void setOptimizerDateTime(String optimizerDateTime) {}
+ /**
+ * Gets the optimizer message.
+ *
+ * @return the optimizer message
+ */
public String getOptimizerMessage() {
return this.optimizerMessage;
}
+ /**
+ * Sets the optimizer message.
+ *
+ * @param optimizerMessage the new optimizer message
+ */
public void setOptimizerMessage(String optimizerMessage) {
this.optimizerMessage = optimizerMessage;
}
+ /**
+ * Gets the optimizer status.
+ *
+ * @return the optimizer status
+ */
public String getOptimizerStatus() {
return this.optimizerStatus;
}
+ /**
+ * Sets the optimizer status.
+ *
+ * @param optimizerStatus the new optimizer status
+ */
public void setOptimizerStatus(String optimizerStatus) {
this.optimizerStatus = optimizerStatus;
}
+ /**
+ * Gets the schedule.
+ *
+ * @return the schedule
+ */
public String getSchedule() {
return this.schedule;
}
+ /**
+ * Sets the schedule.
+ *
+ * @param schedule the new schedule
+ */
public void setSchedule(String schedule) {
this.schedule = schedule;
}
+ /**
+ * Gets the schedule id.
+ *
+ * @return the schedule id
+ */
public String getScheduleId() {
return this.scheduleId;
}
+ /**
+ * Sets the schedule id.
+ *
+ * @param scheduleId the new schedule id
+ */
public void setScheduleId(String scheduleId) {
this.scheduleId = scheduleId;
}
+ /**
+ * Gets the schedule name.
+ *
+ * @return the schedule name
+ */
public String getScheduleName() {
return this.scheduleName;
}
+ /**
+ * Sets the schedule name.
+ *
+ * @param scheduleName the new schedule name
+ */
public void setScheduleName(String scheduleName) {
this.scheduleName = scheduleName;
}
+ /**
+ * Gets the schedule info.
+ *
+ * @return the schedule info
+ */
public String getScheduleInfo() {
return this.scheduleInfo;
}
+ /**
+ * Sets the schedule info.
+ *
+ * @param scheduleInfo the new schedule info
+ */
public void setScheduleInfo(String scheduleInfo) {
this.scheduleInfo = scheduleInfo;
}
+ /**
+ * Gets the status.
+ *
+ * @return the status
+ */
public String getStatus() {
return this.status;
}
+ /**
+ * Sets the status.
+ *
+ * @param status the new status
+ */
public void setStatus(String status) {
this.status = status;
}
+ /**
+ * Gets the user id.
+ *
+ * @return the user id
+ */
public String getUserId() {
return this.userId;
}
+ /**
+ * Sets the user id.
+ *
+ * @param userId the new user id
+ */
public void setUserId(String userId) {
this.userId = userId;
}
+ /**
+ * Gets the domain.
+ *
+ * @return the domain
+ */
public String getDomain() {
return domain;
}
+ /**
+ * Sets the domain.
+ *
+ * @param domain the new domain
+ */
public void setDomain(String domain) {
this.domain = domain;
}
+ /**
+ * Gets the domain data.
+ *
+ * @return the domain data
+ */
public List<DomainData> getDomainData() {
return domainData;
}
+ /**
+ * Gets the schedule approvals.
+ *
+ * @return the schedule approvals
+ */
public List<ScheduleApproval> getScheduleApprovals() {
return scheduleApprovals;
}
+ /**
+ * Adds the domain data.
+ *
+ * @param domainData the domain data
+ * @return the domain data
+ */
public DomainData addDomainData(DomainData domainData) {
List<DomainData> list = getDomainData();
- if (list == null)
+ if (list == null) {
list = new ArrayList<DomainData>();
+ }
list.add(domainData);
domainData.setSchedule(this);
return domainData;
}
+ /**
+ * Adds the schedule approval.
+ *
+ * @param sa the sa
+ * @return the schedule approval
+ */
public ScheduleApproval addScheduleApproval(ScheduleApproval sa) {
List<ScheduleApproval> list = getScheduleApprovals();
- if (list == null)
+ if (list == null) {
list = new ArrayList<ScheduleApproval>();
+ }
list.add(sa);
sa.setSchedule(this);
return sa;
}
+ /**
+ * Gets the optimizer attempts to schedule.
+ *
+ * @return the optimizer attempts to schedule
+ */
public Integer getOptimizerAttemptsToSchedule() {
return optimizerAttemptsToSchedule;
}
+ /**
+ * Sets the optimizer attempts to schedule.
+ *
+ * @param optimizerAttemptsToSchedule the new optimizer attempts to schedule
+ */
public void setOptimizerAttemptsToSchedule(Integer optimizerAttemptsToSchedule) {
this.optimizerAttemptsToSchedule = optimizerAttemptsToSchedule;
}
+ /**
+ * Gets the optimizer return date time.
+ *
+ * @return the optimizer return date time
+ */
public String getOptimizerReturnDateTime() {
- if (optimizerReturnDateTimeMillis != null)
+ if (optimizerReturnDateTimeMillis != null) {
return ISODateTimeFormat.dateTimeNoMillis().print(this.optimizerReturnDateTimeMillis);
+ }
return null;
}
+ /**
+ * Sets the optimizer return date time.
+ *
+ * @param optimizerReturnDateTime the new optimizer return date time
+ */
public void setOptimizerReturnDateTime(String optimizerReturnDateTime) {
}
+ /**
+ * Gets the optimizer transaction id.
+ *
+ * @return the optimizer transaction id
+ */
public String getOptimizerTransactionId() {
return optimizerTransactionId;
}
+ /**
+ * Sets the optimizer transaction id.
+ *
+ * @param optimizerTransactionId the new optimizer transaction id
+ */
public void setOptimizerTransactionId(String optimizerTransactionId) {
this.optimizerTransactionId = optimizerTransactionId;
}
+ /**
+ * Gets the optimizer date time millis.
+ *
+ * @return the optimizer date time millis
+ */
public Long getOptimizerDateTimeMillis() {
return optimizerDateTimeMillis;
}
+ /**
+ * Sets the optimizer date time millis.
+ *
+ * @param optimizerDateTimeMillis the new optimizer date time millis
+ */
public void setOptimizerDateTimeMillis(Long optimizerDateTimeMillis) {
this.optimizerDateTimeMillis = optimizerDateTimeMillis;
}
+ /**
+ * Gets the optimizer return date time millis.
+ *
+ * @return the optimizer return date time millis
+ */
public Long getOptimizerReturnDateTimeMillis() {
return optimizerReturnDateTimeMillis;
}
+ /**
+ * Sets the optimizer return date time millis.
+ *
+ * @param optimizerReturnDateTimeMillis the new optimizer return date time millis
+ */
public void setOptimizerReturnDateTimeMillis(Long optimizerReturnDateTimeMillis) {
this.optimizerReturnDateTimeMillis = optimizerReturnDateTimeMillis;
}
+ /**
+ * Gets the groups.
+ *
+ * @return the groups
+ */
public List<ChangeManagementGroup> getGroups() {
return groups;
}
+ /**
+ * Sets the groups.
+ *
+ * @param groups the new groups
+ */
public void setGroups(List<ChangeManagementGroup> groups) {
this.groups = groups;
}
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/model/ScheduleApproval.java b/cmso-service/src/main/java/org/onap/optf/cmso/model/ScheduleApproval.java
index 588aede..184a014 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/model/ScheduleApproval.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/model/ScheduleApproval.java
@@ -1,23 +1,23 @@
/*
* Copyright © 2017-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
@@ -44,7 +44,7 @@ import org.joda.time.format.ISODateTimeFormat;
/**
* The persistent class for the schedule_approvals database table.
- *
+ *
*/
@Entity
@Table(name = "SCHEDULE_APPROVALS")
@@ -86,9 +86,15 @@ public class ScheduleApproval implements Serializable {
public ScheduleApproval() {}
+ /**
+ * Gets the approval date time.
+ *
+ * @return the approval date time
+ */
public String getApprovalDateTime() {
- if (approvalDateTimeMillis != null)
+ if (approvalDateTimeMillis != null) {
return ISODateTimeFormat.dateTimeNoMillis().print(this.approvalDateTimeMillis);
+ }
return null;
}
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/model/dao/ChangeManagementChangeWindowDAO.java b/cmso-service/src/main/java/org/onap/optf/cmso/model/dao/ChangeManagementChangeWindowDAO.java
index 303be20..976a57f 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/model/dao/ChangeManagementChangeWindowDAO.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/model/dao/ChangeManagementChangeWindowDAO.java
@@ -49,7 +49,7 @@ public interface ChangeManagementChangeWindowDAO
void delete(ChangeManagementChangeWindow toDelete);
@Query(value = "SELECT d FROM ChangeManagementChangeWindow d WHERE d.changeManagementGroupUuid = ?1")
- List<ChangeManagementChangeWindow> findByGroupsUUID(UUID id);
+ List<ChangeManagementChangeWindow> findByGroupsUuid(UUID id);
@Modifying
@Query(value = "DELETE FROM ChangeManagementChangeWindow d WHERE d.changeManagementGroupUuid = ?1")
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/model/dao/ChangeManagementGroupDAO.java b/cmso-service/src/main/java/org/onap/optf/cmso/model/dao/ChangeManagementGroupDAO.java
index 7acc228..7694d8d 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/model/dao/ChangeManagementGroupDAO.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/model/dao/ChangeManagementGroupDAO.java
@@ -47,9 +47,9 @@ public interface ChangeManagementGroupDAO extends PagingAndSortingRepository<Cha
void delete(ChangeManagementGroup toDelete);
@Query(value = "SELECT d FROM ChangeManagementGroup d WHERE d.schedulesUuid = ?1")
- List<ChangeManagementGroup> findBySchedulesID(UUID id);
+ List<ChangeManagementGroup> findBySchedulesId(UUID id);
@Query(value = "SELECT d FROM ChangeManagementGroup d WHERE d.schedulesUuid = ?1 AND d.groupId = ?2")
- ChangeManagementGroup findOneBySchedulesIDGroupID(UUID id, String groupId);
+ ChangeManagementGroup findOneBySchedulesIdGroupId(UUID id, String groupId);
}
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/model/dao/ChangeManagementScheduleDAO.java b/cmso-service/src/main/java/org/onap/optf/cmso/model/dao/ChangeManagementScheduleDAO.java
index 27a5029..8741587 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/model/dao/ChangeManagementScheduleDAO.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/model/dao/ChangeManagementScheduleDAO.java
@@ -66,14 +66,18 @@ public interface ChangeManagementScheduleDAO extends PagingAndSortingRepository<
+ " AND g.groupId = ?2"
+ " AND d.changeManagementGroupUuid = g.uuid"
+ " AND d.vnfName = ?3")
- ChangeManagementSchedule findOneByScheduleUUIDGroupIdAndVnfName(UUID id, String groupId, String vnfName);
+ ChangeManagementSchedule findOneByScheduleUuidGroupIdAndVnfName(UUID id, String groupId, String vnfName);
- @Query(value = "SELECT d FROM ChangeManagementSchedule d WHERE (d.status = ?1 AND d.startTimeMillis <= ?2) or d.status = 'Scheduled Immediate' order by d.startTimeMillis")
+ @Query(value = "SELECT d FROM ChangeManagementSchedule d"
+ + " WHERE (d.status = ?1 AND d.startTimeMillis <= ?2)"
+ + " or d.status = 'Scheduled Immediate' order by d.startTimeMillis")
List<ChangeManagementSchedule> findByStatusAndEndTime(String status, Long date);
@Modifying
- @Query(value = "Update ChangeManagementSchedule d set d.status = 'Scheduled', d.dispatcherInstance = '' WHERE d.status = 'Queued for Dispatch' AND d.dispatcherInstance = ?1")
+ @Query(value = "Update ChangeManagementSchedule d set d.status = 'Scheduled',"
+ + " d.dispatcherInstance = ''"
+ + " WHERE d.status = 'Queued for Dispatch' AND d.dispatcherInstance = ?1")
public int requeueQueuedForDispatch(String dispatcherInstance);
@Query(value = "SELECT d FROM ChangeManagementSchedule d WHERE d.status = 'Triggered'")
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/model/dao/ScheduleDAO.java b/cmso-service/src/main/java/org/onap/optf/cmso/model/dao/ScheduleDAO.java
index 90843c4..14d3143 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/model/dao/ScheduleDAO.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/model/dao/ScheduleDAO.java
@@ -50,10 +50,10 @@ public interface ScheduleDAO extends PagingAndSortingRepository<Schedule, UUID>
void delete(Schedule toDelete);
@Query(value = "SELECT s FROM Schedule s WHERE s.domain = ?1 AND s.scheduleId= ?2 ")
- Schedule findByDomainScheduleID(String domain, String scheduleId);
+ Schedule findByDomainScheduleId(String domain, String scheduleId);
@Query(value = "SELECT s FROM Schedule s WHERE s.domain = ?1 AND s.status = ?2 ")
- List<Schedule> findByDomainStatus(String domain, String Status);
+ List<Schedule> findByDomainStatus(String domain, String status);
@Query(value = "SELECT s FROM Schedule s WHERE s.optimizerTransactionId= ?1")
Schedule findOneByTransactionId(String transactionId);
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/model/dao/ScheduleQueryDAOImpl.java b/cmso-service/src/main/java/org/onap/optf/cmso/model/dao/ScheduleQueryDAOImpl.java
index 80bb7f0..b5a6e57 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/model/dao/ScheduleQueryDAOImpl.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/model/dao/ScheduleQueryDAOImpl.java
@@ -1,27 +1,27 @@
/*
* Copyright © 2017-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.
@@ -54,11 +54,12 @@ public class ScheduleQueryDAOImpl implements ScheduleQueryDAO {
+ " left outer join APPROVAL_TYPES at on sa.approval_types_uuid = at.uuid ");
sql.append(where);
sql.append(" order by uuid ");
- if (limit > 0)
+ if (limit > 0) {
sql.append("LIMIT " + limit);
+ }
- Query q = manager.createNativeQuery(sql.toString(), ScheduleQuery.class);
- List<ScheduleQuery> list = q.getResultList();
+ Query qry = manager.createNativeQuery(sql.toString(), ScheduleQuery.class);
+ List<ScheduleQuery> list = qry.getResultList();
return list;
}
}
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/optimizer/CmsoOptimizerClient.java b/cmso-service/src/main/java/org/onap/optf/cmso/optimizer/CmsoOptimizerClient.java
index 4fd0164..898339a 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/optimizer/CmsoOptimizerClient.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/optimizer/CmsoOptimizerClient.java
@@ -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);
}
/**
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/optimizer/CmsoOptimizerHandler.java b/cmso-service/src/main/java/org/onap/optf/cmso/optimizer/CmsoOptimizerHandler.java
index ea78df1..cb658bb 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/optimizer/CmsoOptimizerHandler.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/optimizer/CmsoOptimizerHandler.java
@@ -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());
}
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/optimizer/OptimizerQuartzJob.java b/cmso-service/src/main/java/org/onap/optf/cmso/optimizer/OptimizerQuartzJob.java
index 71a2092..0021c0d 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/optimizer/OptimizerQuartzJob.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/optimizer/OptimizerQuartzJob.java
@@ -60,6 +60,9 @@ import org.springframework.core.env.Environment;
import org.springframework.scheduling.quartz.QuartzJobBean;
import org.springframework.stereotype.Component;
+/**
+ * The Class OptimizerQuartzJob.
+ */
@Component
@DisallowConcurrentExecution
public class OptimizerQuartzJob extends QuartzJobBean {
@@ -111,8 +114,13 @@ public class OptimizerQuartzJob extends QuartzJobBean {
}
- public void scheduleOptimization(Schedule s) {
- UUID id = s.getUuid();
+ /**
+ * Schedule optimization.
+ *
+ * @param sch the s
+ */
+ public void scheduleOptimization(Schedule sch) {
+ UUID id = sch.getUuid();
Map<String, String> mdcSave = Mdc.save();
try {
String url = env.getProperty("cmso.dispatch.url", "http://localhost:8089");
@@ -151,13 +159,10 @@ public class OptimizerQuartzJob extends QuartzJobBean {
* According to the documentation I read, Quartz would queue a job without waiting for the
* completion of the job with @DisallowConcurrentExecution to complete so that there would be a
* backlog of triggers to process
- *
* This was designed to spin though these stale triggers. When this didn't work, I discovered that
* the behavior is that Quartz will wait for the appropriate interval
* after @DisallowConcurrentExecution jobs complete.
- *
* I tested by adding a sleep for an interval > the trigger interval
- *
* QUartz appears to do what makes sense. Leaving this here in case issues arise...
*
*/
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/BaseSchedulerServiceImpl.java b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/BaseSchedulerServiceImpl.java
index 18678ff..816a80e 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/BaseSchedulerServiceImpl.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/BaseSchedulerServiceImpl.java
@@ -58,21 +58,21 @@ public class BaseSchedulerServiceImpl {
private static EELFLogger log = EELFManager.getInstance().getLogger(BaseSchedulerServiceImpl.class);
@Autowired
- protected ScheduleDAO scheduleDAO;
+ protected ScheduleDAO scheduleDao;
@Autowired
- DomainDataDAO domainDataDAO;
+ DomainDataDAO domainDataDao;
@Autowired
- ApprovalTypeDAO approvalTypeDAO;
+ ApprovalTypeDAO approvalTypeDao;
@Autowired
- ScheduleApprovalDAO scheduleApprovalDAO;
+ ScheduleApprovalDAO scheduleApprovalDao;
protected Schedule validateAndAddScheduleRequest(OptimizedScheduleMessage scheduleMessage,
List<DomainData> domainData) throws CMSException {
messageValidations(scheduleMessage);
- Schedule sch = scheduleDAO.findByDomainScheduleID(scheduleMessage.getDomain(), scheduleMessage.getScheduleId());
+ Schedule sch = scheduleDao.findByDomainScheduleId(scheduleMessage.getDomain(), scheduleMessage.getScheduleId());
if (sch != null) {
throw new CMSAlreadyExistsException(scheduleMessage.getDomain(), scheduleMessage.getScheduleId());
@@ -91,13 +91,13 @@ public class BaseSchedulerServiceImpl {
sch.setOptimizerAttemptsToSchedule(0);
sch.setScheduleInfo(scheduleMessage.getSchedulingData().toString());
sch.setStatus(CMSStatusEnum.PendingSchedule.toString());
- scheduleDAO.save(sch);
+ scheduleDao.save(sch);
for (DomainData dd : domainData) {
dd.setUuid(UUID.randomUUID());
sch.addDomainData(dd);
- domainDataDAO.save(dd);
+ domainDataDao.save(dd);
}
- scheduleDAO.save(sch);
+ scheduleDao.save(sch);
return sch;
}
@@ -111,7 +111,7 @@ public class BaseSchedulerServiceImpl {
}
protected void deleteScheduleRequest(String domain, String scheduleId) throws CMSException {
- Schedule sch = scheduleDAO.findByDomainScheduleID(domain, scheduleId);
+ Schedule sch = scheduleDao.findByDomainScheduleId(domain, scheduleId);
if (sch == null) {
throw new CMSNotFoundException(domain, scheduleId);
}
@@ -127,14 +127,14 @@ public class BaseSchedulerServiceImpl {
default:
sch.setStatus(CMSStatusEnum.Deleted.toString());
}
- scheduleDAO.save(sch);
+ scheduleDao.save(sch);
}
protected Schedule processApproval(Schedule sch, String domain, ApprovalMessage approvalMessage)
throws CMSException {
String scheduleId = sch.getScheduleId();
ApprovalType approvalType =
- approvalTypeDAO.findByDomainAndType(domain, approvalMessage.getApprovalType().toString());
+ approvalTypeDao.findByDomainAndType(domain, approvalMessage.getApprovalType().toString());
if (approvalType == null) {
throw new CMSException(Status.BAD_REQUEST, LogMessages.INVALID_ATTRIBUTE, "approvalType",
approvalMessage.getApprovalType().toString());
@@ -169,7 +169,7 @@ public class BaseSchedulerServiceImpl {
sa.setStatus(approvalMessage.getApprovalStatus().toString());
sa.setSchedule(sch);
sch.addScheduleApproval(sa);
- scheduleDAO.save(sch);
+ scheduleDao.save(sch);
if (sa.getStatus().equals(ApprovalStatusEnum.Rejected.toString())) {
sch.setStatus(CMSStatusEnum.Rejected.toString());
} else {
@@ -177,7 +177,7 @@ public class BaseSchedulerServiceImpl {
sch.setStatus(CMSStatusEnum.Accepted.toString());
}
}
- scheduleDAO.save(sch);
+ scheduleDao.save(sch);
return sch;
}
@@ -188,7 +188,7 @@ public class BaseSchedulerServiceImpl {
// for
// logging
- List<ApprovalType> approvalTypes = approvalTypeDAO.findByDomain(schedule.getDomain());
+ List<ApprovalType> approvalTypes = approvalTypeDao.findByDomain(schedule.getDomain());
for (ApprovalType at : approvalTypes) {
UUID type = at.getUuid();
Integer count = at.getApprovalCount();
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmsoOptimizerCallbackImpl.java b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmsoOptimizerCallbackImpl.java
index 6abb6bb..6a7b1b3 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmsoOptimizerCallbackImpl.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmsoOptimizerCallbackImpl.java
@@ -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);
}
/**
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmsoServiceImpl.java b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmsoServiceImpl.java
index 9b3785a..7ffd606 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmsoServiceImpl.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmsoServiceImpl.java
@@ -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);
}
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CommonServiceImpl.java b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CommonServiceImpl.java
index 52a0928..750d0a7 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CommonServiceImpl.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CommonServiceImpl.java
@@ -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");
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/HealthCheckImpl.java b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/HealthCheckImpl.java
index 6785646..79094d3 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/HealthCheckImpl.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/HealthCheckImpl.java
@@ -69,7 +69,7 @@ public class HealthCheckImpl implements HealthCheck {
CmsoOptimizerClient optimizerClient;
@Autowired
- ApprovalTypeDAO approvalTypeDAO;
+ ApprovalTypeDAO approvalTypeDao;
@Autowired
Environment env;
@@ -127,7 +127,7 @@ public class HealthCheckImpl implements HealthCheck {
String url = env.getProperty("spring.datasource.url");
hcc.setUrl(url);
try {
- approvalTypeDAO.findByDomain("HealthCheck");
+ approvalTypeDao.findByDomain("HealthCheck");
hcc.setHealthy(true);
hcc.setStatus("OK");
} catch (Exception e) {
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/ApprovalMessage.java b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/ApprovalMessage.java
index f038905..b8e45fc 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/ApprovalMessage.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/ApprovalMessage.java
@@ -1,6 +1,6 @@
/*
- * Copyright � 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright � 2018 IBM.
+ * Copyright © 2017-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.
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/CMSInfo.java b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/CMSInfo.java
index 3d104d2..d39798f 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/CMSInfo.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/CMSInfo.java
@@ -1,6 +1,6 @@
/*
- * Copyright � 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright � 2018 IBM.
+ * Copyright © 2017-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.
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/CMSMessage.java b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/CMSMessage.java
index cd8c946..9e236e2 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/CMSMessage.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/CMSMessage.java
@@ -1,6 +1,6 @@
/*
- * Copyright � 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright � 2018 IBM.
+ * Copyright © 2017-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.
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/ChangeWindowMessage.java b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/ChangeWindowMessage.java
index 071ab8f..ef0862a 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/ChangeWindowMessage.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/ChangeWindowMessage.java
@@ -1,6 +1,6 @@
/*
- * Copyright � 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright � 2018 IBM.
+ * Copyright © 2017-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.
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/CmDetailsMessage.java b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/CmDetailsMessage.java
index a526065..b5aabf5 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/CmDetailsMessage.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/CmDetailsMessage.java
@@ -1,6 +1,6 @@
/*
- * Copyright � 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright � 2018 IBM.
+ * Copyright © 2017-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.
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/test/loopback/TicketMgtLoopbackService.java b/cmso-service/src/main/java/org/onap/optf/cmso/test/loopback/TicketMgtLoopbackService.java
index f329cfc..495d686 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/test/loopback/TicketMgtLoopbackService.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/test/loopback/TicketMgtLoopbackService.java
@@ -1,5 +1,5 @@
/*
- * Copyright � 2017-2018 AT&T Intellectual Property. Modifications Copyright � 2018 IBM.
+ * Copyright © 2017-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
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/ticketmgt/TmStatusClient.java b/cmso-service/src/main/java/org/onap/optf/cmso/ticketmgt/TmStatusClient.java
index 3d13b6f..a7ae5ed 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/ticketmgt/TmStatusClient.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/ticketmgt/TmStatusClient.java
@@ -111,7 +111,7 @@ public class TmStatusClient {
}
Map<GroupAuditStatus, List<ChangeManagementGroup>> groupStatus =
new HashMap<GroupAuditStatus, List<ChangeManagementGroup>>();
- List<ChangeManagementGroup> groups = cmGroupDao.findBySchedulesID(uuid);
+ List<ChangeManagementGroup> groups = cmGroupDao.findBySchedulesId(uuid);
// Close tickets for completed VNFs
for (ChangeManagementGroup group : groups) {