diff options
Diffstat (limited to 'cmso-ticketmgt')
34 files changed, 554 insertions, 286 deletions
diff --git a/cmso-ticketmgt/src/main/java/org/onap/observations/Mdc.java b/cmso-ticketmgt/src/main/java/org/onap/observations/Mdc.java index 32aa60c..41fd3df 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/observations/Mdc.java +++ b/cmso-ticketmgt/src/main/java/org/onap/observations/Mdc.java @@ -1,32 +1,33 @@ /* * Copyright © 2019 AT&T Intellectual Property. - * + * * 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.observations; import static com.att.eelf.configuration.Configuration.MDC_BEGIN_TIMESTAMP; @@ -39,6 +40,7 @@ import static com.att.eelf.configuration.Configuration.MDC_RESPONSE_DESC; import static com.att.eelf.configuration.Configuration.MDC_STATUS_CODE; import static com.att.eelf.configuration.Configuration.MDC_TARGET_ENTITY; import static com.att.eelf.configuration.Configuration.MDC_TARGET_SERVICE_NAME; + import com.att.eelf.utils.Stopwatch; import java.net.URI; import java.util.Date; @@ -58,8 +60,13 @@ import org.slf4j.MDC; * EELF logging MDC fields not defined in the MDC Configuration (i.e. MDC_ALERT_SEVERITY) **/ public class Mdc { + + /** The Constant SERVICE_NAME. */ public static final String SERVICE_NAME = "CSS-Scheduler"; + /** + * The Enum Enum. + */ public enum Enum { // BeginTimestamp, // EndTimeStamp, @@ -92,54 +99,105 @@ public class Mdc { Timer, } + /** + * Gets the caller. + * + * @param back the back + * @return the caller + */ public static String getCaller(int back) { StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace(); return stackTraceElements[back].getClassName() + "." + stackTraceElements[back].getMethodName(); } + /** + * Sets the caller. + * + * @param back the new caller + */ public static void setCaller(int back) { String caller = MDC.get(Enum.ClassName.name()); - if (caller == null) + if (caller == null) { MDC.put(Enum.ClassName.name(), getCaller(back)); + } } - public static void setObservation(ObservationInterface o) { - MDC.put(Enum.CustomField4.name(), o.name()); + /** + * Sets the observation. + * + * @param obs the new observation + */ + public static void setObservation(ObservationInterface obs) { + MDC.put(Enum.CustomField4.name(), obs.name()); } + /** + * Clear caller. + */ public static void clearCaller() { MDC.remove(Enum.ClassName.name()); } + /** + * Save. + * + * @return the map + */ public static Map<String, String> save() { Map<String, String> save = MDC.getCopyOfContextMap(); return save; } + /** + * Restore. + * + * @param mdcSave the mdc save + */ public static void restore(Map<String, String> mdcSave) { MDC.clear(); - for (String name : mdcSave.keySet()) + for (String name : mdcSave.keySet()) { MDC.put(name, mdcSave.get(name)); + } } + /** + * Sets the request id if not set. + * + * @param requestId the new request id if not set + */ public static void setRequestIdIfNotSet(String requestId) { if (MDC.get(MDC_KEY_REQUEST_ID) == null || MDC.get(MDC_KEY_REQUEST_ID).equals("")) { setRequestId(requestId); } } + /** + * Sets the request id. + * + * @param requestId the new request id + */ public static void setRequestId(String requestId) { MDC.put(MDC_KEY_REQUEST_ID, requestId); } + /** + * Metric start. + * + * @param requestContext the request context + */ public static void metricStart(ClientRequestContext requestContext) { MDC.put(MDC_BEGIN_TIMESTAMP, Stopwatch.isoFormatter.format(new Date())); MDC.put(MDC_END_TIMESTAMP, MDC.get(MDC_BEGIN_TIMESTAMP)); setPartnerTargetFromUri(requestContext.getUri()); } + /** + * Metric end. + * + * @param response the response + */ public static void metricEnd(ClientResponseContext response) { Date now = new Date(); @@ -149,13 +207,19 @@ public class Mdc { } + /** + * Audit start. + * + * @param requestContext the request context + * @param servletRequest the servlet request + */ public static void auditStart(ContainerRequestContext requestContext, HttpServletRequest servletRequest) { MDC.put(MDC_BEGIN_TIMESTAMP, Stopwatch.isoFormatter.format(new Date())); MDC.put(MDC_END_TIMESTAMP, MDC.get(MDC_BEGIN_TIMESTAMP)); MDC.put(MDC_REMOTE_HOST, servletRequest.getRemoteHost()); MDC.put(Enum.ClassName.name(), getCaller(4)); MultivaluedMap<String, String> headers = requestContext.getHeaders(); - String transactionId = (String) headers.getFirst(HeadersEnum.TransactionID.toString()); + String transactionId = headers.getFirst(HeadersEnum.TransactionID.toString()); if (transactionId != null) { setRequestId(transactionId); } else { @@ -164,6 +228,12 @@ public class Mdc { } + /** + * Audit end. + * + * @param requestContext the request context + * @param response the response + */ public static void auditEnd(ContainerRequestContext requestContext, ContainerResponseContext response) { Date now = new Date(); // MDC.put(MDC_BEGIN_TIMESTAMP, Stopwatch.isoFormatter.format(now)); @@ -185,10 +255,15 @@ public class Mdc { MDC.put(MDC_STATUS_CODE, completed); } - public static void setEvent(String requestID) { + /** + * Sets the event. + * + * @param requestId the new event + */ + public static void setEvent(String requestId) { MDC.put(MDC_BEGIN_TIMESTAMP, Stopwatch.isoFormatter.format(new Date())); MDC.put(MDC_END_TIMESTAMP, MDC.get(MDC_BEGIN_TIMESTAMP)); - setRequestId(requestID); + setRequestId(requestId); } private static void setPartnerTargetFromUri(URI uri) { diff --git a/cmso-ticketmgt/src/main/java/org/onap/observations/MessageHeaders.java b/cmso-ticketmgt/src/main/java/org/onap/observations/MessageHeaders.java index c936444..f140aec 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/observations/MessageHeaders.java +++ b/cmso-ticketmgt/src/main/java/org/onap/observations/MessageHeaders.java @@ -35,7 +35,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"), @@ -50,51 +57,98 @@ public class MessageHeaders { this.text = text; } + /** + * 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-ticketmgt/src/main/java/org/onap/observations/Observation.java b/cmso-ticketmgt/src/main/java/org/onap/observations/Observation.java index 83b8f8d..8d053bf 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/observations/Observation.java +++ b/cmso-ticketmgt/src/main/java/org/onap/observations/Observation.java @@ -1,32 +1,33 @@ /* * Copyright © 2019 AT&T Intellectual Property. - * + * * 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.observations; import com.att.eelf.configuration.EELFLogger; @@ -41,73 +42,86 @@ public class Observation { private static EELFLogger errors = EELFManager.getInstance().getErrorLogger(); private static EELFLogger debug = EELFManager.getInstance().getDebugLogger(); + /** + * Report. + * + * @param obs the obs + * @param exc the exc + * @param arguments the arguments + */ // ************************************************************************************************* - public static void report(ObservationInterface o, Exception e, String... arguments) { + public static void report(ObservationInterface obs, Exception exc, String... arguments) { Mdc.setCaller(4); - Mdc.setObservation(o); - if (o.getAudit()) { - audit.info(o, e, arguments); + Mdc.setObservation(obs); + if (obs.getAudit()) { + audit.info(obs, exc, arguments); } - if (o.getMetric()) { - metrics.info(o, e, arguments); + if (obs.getMetric()) { + metrics.info(obs, exc, arguments); } - Level l = o.getLevel(); - switch (l.toInt()) { + Level lev = obs.getLevel(); + switch (lev.toInt()) { case Level.WARN_INT: - errors.warn(o, arguments); - debug.debug(o, e, arguments); + errors.warn(obs, arguments); + debug.debug(obs, exc, arguments); break; case Level.INFO_INT: - log.info(o, e, arguments); - debug.debug(o, e, arguments); + log.info(obs, exc, arguments); + debug.debug(obs, exc, arguments); break; case Level.ERROR_INT: - errors.error(o, arguments); - debug.debug(o, e, arguments); + errors.error(obs, arguments); + debug.debug(obs, exc, arguments); break; case Level.TRACE_INT: - debug.trace(o, e, arguments); + debug.trace(obs, exc, arguments); break; case Level.DEBUG_INT: - debug.debug(o, e, arguments); + debug.debug(obs, exc, arguments); break; default: - log.info(o, e, arguments); + log.info(obs, exc, arguments); } Mdc.clearCaller(); } - public static void report(ObservationInterface o, String... arguments) { + /** + * Report. + * + * @param obs the obs + * @param arguments the arguments + */ + public static void report(ObservationInterface obs, String... arguments) { Mdc.setCaller(4); - Mdc.setObservation(o); - if (o.getAudit()) { - audit.info(o, arguments); + Mdc.setObservation(obs); + if (obs.getAudit()) { + audit.info(obs, arguments); } - if (o.getMetric()) { - metrics.info(o, arguments); + if (obs.getMetric()) { + metrics.info(obs, arguments); } - Level l = o.getLevel(); - switch (l.toInt()) { + Level lev = obs.getLevel(); + switch (lev.toInt()) { case Level.WARN_INT: - errors.warn(o, arguments); - debug.debug(o, arguments); + errors.warn(obs, arguments); + debug.debug(obs, arguments); break; case Level.INFO_INT: - log.info(o, arguments); - debug.debug(o, arguments); + log.info(obs, arguments); + debug.debug(obs, arguments); break; case Level.ERROR_INT: - errors.error(o, arguments); - debug.debug(o, arguments); + errors.error(obs, arguments); + debug.debug(obs, arguments); break; case Level.TRACE_INT: - debug.debug(o, arguments); + debug.debug(obs, arguments); break; case Level.DEBUG_INT: - debug.debug(o, arguments); + debug.debug(obs, arguments); break; default: - log.info(o, arguments); + log.info(obs, arguments); } Mdc.clearCaller(); } diff --git a/cmso-ticketmgt/src/main/java/org/onap/observations/ObservationInterface.java b/cmso-ticketmgt/src/main/java/org/onap/observations/ObservationInterface.java index 7a16a3f..ebe657a 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/observations/ObservationInterface.java +++ b/cmso-ticketmgt/src/main/java/org/onap/observations/ObservationInterface.java @@ -1,32 +1,33 @@ /* * Copyright © 2019 AT&T Intellectual Property. - * + * * 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.observations; import com.att.eelf.i18n.EELFResolvableErrorEnum; diff --git a/cmso-ticketmgt/src/main/java/org/onap/observations/ObservationObject.java b/cmso-ticketmgt/src/main/java/org/onap/observations/ObservationObject.java index f41c134..8544047 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/observations/ObservationObject.java +++ b/cmso-ticketmgt/src/main/java/org/onap/observations/ObservationObject.java @@ -1,32 +1,33 @@ /* * Copyright © 2019 AT&T Intellectual Property. - * + * * 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.observations; import com.att.eelf.i18n.EELFResolvableErrorEnum; @@ -44,24 +45,30 @@ public class ObservationObject implements ObservationInterface { // // private Enum<?> value = null; - private Level level = null;; + private Level level = null; private String message = null; private Status status = null; private String domain = null; private Boolean metric = false; private Boolean audit = false; - public ObservationObject(ObservationInterface o) { - this.value = o.getValue(); - this.level = o.getLevel(); - this.message = o.getMessage(); - this.status = o.getStatus(); - this.domain = o.getDomain(); - this.metric = o.getMetric(); - this.audit = o.getAudit(); + /** + * Instantiates a new observation object. + * + * @param obs the o + */ + public ObservationObject(ObservationInterface obs) { + this.value = obs.getValue(); + this.level = obs.getLevel(); + this.message = obs.getMessage(); + this.status = obs.getStatus(); + this.domain = obs.getDomain(); + this.metric = obs.getMetric(); + this.audit = obs.getAudit(); } + @Override public Enum<?> getValue() { return value; } @@ -71,6 +78,11 @@ public class ObservationObject implements ObservationInterface { return message; } + public String getMessage(String... arguments) { + return EELFResourceManager.format((EELFResolvableErrorEnum) value, arguments); + } + + @Override public Status getStatus() { return status; @@ -101,10 +113,6 @@ public class ObservationObject implements ObservationInterface { return metric; } - public String getMessage(String... arguments) { - return EELFResourceManager.format((EELFResolvableErrorEnum) value, arguments); - } - public void setValue(Enum<?> value) { this.value = value; } diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/cmso/common/BasicAuthenticatorFilter.java b/cmso-ticketmgt/src/main/java/org/onap/optf/cmso/common/BasicAuthenticatorFilter.java index e02a47b..6b0275e 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/optf/cmso/common/BasicAuthenticatorFilter.java +++ b/cmso-ticketmgt/src/main/java/org/onap/optf/cmso/common/BasicAuthenticatorFilter.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. @@ -46,6 +46,12 @@ public class BasicAuthenticatorFilter implements ClientRequestFilter { 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; @@ -68,6 +74,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-ticketmgt/src/main/java/org/onap/optf/cmso/common/PropertiesManagement.java b/cmso-ticketmgt/src/main/java/org/onap/optf/cmso/common/PropertiesManagement.java index 77fdb11..bcd9ca1 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/optf/cmso/common/PropertiesManagement.java +++ b/cmso-ticketmgt/src/main/java/org/onap/optf/cmso/common/PropertiesManagement.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. @@ -41,28 +41,44 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; +/** + * 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(); @@ -71,6 +87,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); diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/cmso/common/exceptions/CMSException.java b/cmso-ticketmgt/src/main/java/org/onap/optf/cmso/common/exceptions/CMSException.java index 0ab80a0..e8b5e03 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/optf/cmso/common/exceptions/CMSException.java +++ b/cmso-ticketmgt/src/main/java/org/onap/optf/cmso/common/exceptions/CMSException.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. @@ -46,12 +46,20 @@ public class CMSException extends Exception { protected ObservationInterface messageCode; protected Status status; + /** + * Instantiates a new CMS exception. + * + * @param status the status + * @param messageCode the message code + * @param args the args + */ public CMSException(Status status, ObservationInterface messageCode, String... args) { super(EELFResourceManager.format(messageCode, args)); this.status = status; this.messageCode = messageCode; - for (String arg : args) + for (String arg : args) { variables.add(arg); + } requestError = new CMSRequestError(messageCode.name(), getMessage(), variables); } diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/Application.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/Application.java index 7392e2b..cf0b0a8 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/Application.java +++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/Application.java @@ -73,11 +73,11 @@ public class Application extends SpringBootServletInitializer { } public static void main(String[] args) { - initMDCData(); + initMdcData(); SpringApplication.run(Application.class, args); } - protected static void initMDCData() { + protected static void initMdcData() { MDC.clear(); try { MDC.put(Configuration.MDC_SERVER_FQDN, InetAddress.getLocalHost().getHostName()); diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/ApplicationPropertiesFiles.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/ApplicationPropertiesFiles.java index 0fd1c45..f11f737 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/ApplicationPropertiesFiles.java +++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/ApplicationPropertiesFiles.java @@ -1,33 +1,34 @@ /* * Copyright © 2018-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. * See the License for the specific language governing permissions and * limitations under the License. */ + package org.onap.optf.ticketmgt; import org.springframework.context.annotation.Configuration; diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/AuthProvider.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/AuthProvider.java index 6749b72..4a066d7 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/AuthProvider.java +++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/AuthProvider.java @@ -1,33 +1,34 @@ /* * Copyright © 2018 AT&T Intellectual Property. * Modifications Copyright © 2019 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.ticketmgt; import java.util.ArrayList; diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/JerseyConfiguration.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/JerseyConfiguration.java index 46c99ee..c4fe51a 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/JerseyConfiguration.java +++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/JerseyConfiguration.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. @@ -59,6 +59,11 @@ import org.springframework.stereotype.Component; public class JerseyConfiguration extends ResourceConfig { private static final Logger log = Logger.getLogger(JerseyConfiguration.class.getName()); + /** + * Object mapper. + * + * @return the object mapper + */ @Bean @Primary public ObjectMapper objectMapper() { @@ -70,6 +75,9 @@ public class JerseyConfiguration extends ResourceConfig { return objectMapper; } + /** + * Instantiates a new jersey configuration. + */ @Autowired public JerseyConfiguration( /* LogRequestFilter lrf */ ) { register(HealthCheckImpl.class); @@ -86,6 +94,11 @@ public class JerseyConfiguration extends ResourceConfig { register(CMSOContainerFilters.class); } + /** + * Jersey client. + * + * @return the client + */ @Bean public Client jerseyClient() { ClientConfig client = new ClientConfig(); diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/SecurityConfig.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/SecurityConfig.java index 8abccf0..09e1c8e 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/SecurityConfig.java +++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/SecurityConfig.java @@ -1,33 +1,34 @@ /* * 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.ticketmgt; import org.springframework.beans.factory.annotation.Autowired; diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/SpringProfiles.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/SpringProfiles.java index b73959d..1ca525e 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/SpringProfiles.java +++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/SpringProfiles.java @@ -17,6 +17,7 @@ * limitations under the License. * ============LICENSE_END========================================================= */ + package org.onap.optf.ticketmgt; public class SpringProfiles { diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/aaf/AafAuthorizationFilter.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/aaf/AafAuthorizationFilter.java index 9f1f2d1..ffbd94e 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/aaf/AafAuthorizationFilter.java +++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/aaf/AafAuthorizationFilter.java @@ -17,6 +17,7 @@ * limitations under the License. * ============LICENSE_END========================================================= */ + package org.onap.optf.ticketmgt.aaf; import java.io.IOException; @@ -35,7 +36,7 @@ import org.springframework.context.annotation.PropertySource; import org.springframework.stereotype.Component; /** - * AAF authorization filter + * AAF authorization filter. */ @Component @@ -49,6 +50,9 @@ public class AafAuthorizationFilter extends OrderedRequestContextFilter { @Value("${permission.instance}") String instance; + /** + * Instantiates a new aaf authorization filter. + */ public AafAuthorizationFilter() { this.setOrder(FilterPriority.AAF_AUTHORIZATION.getPriority()); diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/aaf/AafFilter.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/aaf/AafFilter.java index 4d6c44f..c0c8106 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/aaf/AafFilter.java +++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/aaf/AafFilter.java @@ -17,8 +17,8 @@ * limitations under the License. * ============LICENSE_END========================================================= */ -package org.onap.optf.ticketmgt.aaf; +package org.onap.optf.ticketmgt.aaf; import java.io.IOException; import java.util.Properties; @@ -38,7 +38,7 @@ import org.springframework.context.annotation.Profile; import org.springframework.stereotype.Component; /** - * AAF authentication filter + * AAF authentication filter. */ @Component @@ -47,6 +47,12 @@ public class AafFilter extends OrderedRequestContextFilter { private final CadiFilter cadiFilter; + /** + * Instantiates a new aaf filter. + * + * @throws IOException Signals that an I/O exception has occurred. + * @throws ServletException the servlet exception + */ public AafFilter() throws IOException, ServletException { Properties cadiProperties = new Properties(); cadiProperties.load(Application.class.getClassLoader().getResourceAsStream("cadi.properties")); diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/aaf/FilterPriority.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/aaf/FilterPriority.java index 4b9bd9d..f1dff2c 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/aaf/FilterPriority.java +++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/aaf/FilterPriority.java @@ -17,19 +17,18 @@ * limitations under the License. * ============LICENSE_END========================================================= */ + package org.onap.optf.ticketmgt.aaf; import org.springframework.core.Ordered; public enum FilterPriority { AAF_AUTHENTICATION(Ordered.HIGHEST_PRECEDENCE), AAF_AUTHORIZATION(Ordered.HIGHEST_PRECEDENCE + 1); // higher number - // = lower - // priority private final int priority; - FilterPriority(final int p) { - priority = p; + FilterPriority(final int pri) { + priority = pri; } public int getPriority() { diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/aaf/ResponseFormatter.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/aaf/ResponseFormatter.java index 16dd74e..b9b222c 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/aaf/ResponseFormatter.java +++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/aaf/ResponseFormatter.java @@ -17,6 +17,7 @@ * limitations under the License. * ============LICENSE_END========================================================= */ + package org.onap.optf.ticketmgt.aaf; import java.io.IOException; diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/common/Availability.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/common/Availability.java index c650354..0003de8 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/common/Availability.java +++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/common/Availability.java @@ -1,33 +1,34 @@ /******************************************************************************* - * + * * Copyright © 2019 AT&T Intellectual Property. - * + * * 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.ticketmgt.common; public enum Availability { diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/common/LogMessages.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/common/LogMessages.java index be7b4c9..b007074 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/common/LogMessages.java +++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/common/LogMessages.java @@ -1,27 +1,27 @@ /******************************************************************************* - * + * * Copyright © 2019 AT&T Intellectual Property. - * + * * 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. @@ -89,9 +89,9 @@ public enum LogMessages implements ObservationInterface { private final Boolean metric; - private LogMessages(String message, Status code, Level l) { + private LogMessages(String message, Status code, Level lev) { defaultMessage = message; - level = l; + level = lev; status = code; this.defaultId = this.name(); this.defaultResolution = "No resolution needed"; @@ -100,9 +100,9 @@ public enum LogMessages implements ObservationInterface { this.metric = false; } - private LogMessages(String message, Status code, Level l, Boolean audit, Boolean metric) { + private LogMessages(String message, Status code, Level lev, Boolean audit, Boolean metric) { defaultMessage = message; - level = l; + level = lev; status = code; this.audit = audit; this.metric = metric; @@ -111,8 +111,8 @@ public enum LogMessages implements ObservationInterface { this.defaultAction = "No action is required"; } - private LogMessages(String message, Status code, Level l, String id, String resolution, String action) { - level = l; + private LogMessages(String message, Status code, Level lev, String id, String resolution, String action) { + level = lev; status = code; defaultMessage = message; this.defaultId = id; @@ -126,6 +126,11 @@ public enum LogMessages implements ObservationInterface { EELFResourceManager.loadMessageBundle("logmessages"); } + /** + * Gen properties. + * + * @return the string + */ public String genProperties() { // Use this to regenerate properties file. The desire to change messages without updating code is // well understood, but the developer should be able to code the defaults without having to update 2 @@ -181,7 +186,12 @@ public enum LogMessages implements ObservationInterface { return metric; } - public static void main(String argv[]) { + /** + * The main method. + * + * @param argv the arguments + */ + public static void main(String[] argv) { System.out.println(LogMessages.UNEXPECTED_EXCEPTION.genProperties()); try { Files.write(Paths.get("src/main/resources/logmessages.properties"), diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/filters/CMSOClientFilters.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/filters/CMSOClientFilters.java index c013453..54b1b38 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/filters/CMSOClientFilters.java +++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/filters/CMSOClientFilters.java @@ -32,6 +32,7 @@ package org.onap.optf.ticketmgt.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; @@ -72,9 +73,11 @@ public class CMSOClientFilters implements ClientRequestFilter, ClientResponseFil 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-ticketmgt/src/main/java/org/onap/optf/ticketmgt/filters/CMSOContainerFilters.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/filters/CMSOContainerFilters.java index 162a6ba..4f6b8e7 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/filters/CMSOContainerFilters.java +++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/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. @@ -71,7 +71,7 @@ public class CMSOContainerFilters implements ContainerRequestFilter, ContainerRe 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); @@ -96,8 +96,9 @@ public class CMSOContainerFilters implements ContainerRequestFilter, ContainerRe String majorVersion = requestContext.getUriInfo().getPath(); if (majorVersion != null) { - if (majorVersion.startsWith("dispatch/")) + if (majorVersion.startsWith("dispatch/")) { return; + } majorVersion = majorVersion.replaceAll("/.*$", ""); } if (!MessageHeaders.validateMajorVersion(majorVersion)) { @@ -107,12 +108,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); diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/AdminToolImpl.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/AdminToolImpl.java index f619711..249779a 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/AdminToolImpl.java +++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/AdminToolImpl.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. @@ -54,8 +54,9 @@ public class AdminToolImpl implements AdminTool { @Override public Response exec(String apiVersion, String id) { log.info("AdminTool.exec entered " + uri.getPath()); - if (id.length() < 4) + if (id.length() < 4) { return Response.ok("").build(); + } String encrypted = PropertiesManagement.getEncryptedValue(id); Response response = Response.ok(encrypted).build(); return response; diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/AvailabilityInterface.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/AvailabilityInterface.java index cf9c269..3360927 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/AvailabilityInterface.java +++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/AvailabilityInterface.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. @@ -65,8 +65,10 @@ public interface AvailabilityInterface { consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON) @ApiOperation(value = "Request Active Tickets", notes = "API to support conflict avoidance. Retrieves the active ticket data for the " - + "passed criteria to detemine availability of passed elements within the passed time window." - + "\nIf the request results in asynchronous processging, IN_PROGRESS status will be returned and the " + + "passed criteria to detemine availability of passed elements" + + " within the passed time window." + + "\nIf the request results in asynchronous processging, IN_PROGRESS" + + " status will be returned and the " + "optimizer will begin to poll the request until COMPLETED.", response = ActiveTicketsResponse.class) @ApiResponses(value = {@ApiResponse(code = 200, message = "OK"), @@ -75,7 +77,8 @@ public interface AvailabilityInterface { public Response getActiveTickets( @ApiParam(value = "v1") @PathParam("apiVersion") @PathVariable( value = "v1") @DefaultValue("v1") String apiVersion, - @ApiParam(value = "Active ticket criteria (elements and change windows).") ActiveTicketsRequest activeTicketsRequest); + @ApiParam(value = "Active ticket criteria (elements and change windows).") + ActiveTicketsRequest activeTicketsRequest); @GET @Path("/activetickets/{id}") @@ -84,7 +87,8 @@ public interface AvailabilityInterface { consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON) @ApiOperation(value = "Poll Active Tickets Request", notes = "Poll for the status of the request id. Optimizser will " - + " poll until status is COMPLETED and issue acknowledge (DELETE) API to acknowledge the " + + " poll until status is COMPLETED and issue acknowledge" + + " (DELETE) API to acknowledge the " + "receipt of the response.", response = ActiveTicketsResponse.class) @ApiResponses(value = {@ApiResponse(code = 200, message = "OK"), @@ -101,8 +105,10 @@ public interface AvailabilityInterface { @RequestMapping(value = "/{apiVersion}/activetickets/{id}", method = RequestMethod.DELETE, consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON) @ApiOperation(value = "Acknowledge Active Tickets Response", notes = "API call used to acknowledge the receipt" - + " of a COMPLETED asynchronous request to enable the Ticket Management service to remove it from their cache." - + " The service may remove from the cache on the poll request. The optimizer will treat Not found reponse on as normal.", + + " of a COMPLETED asynchronous request to enable the Ticket Management service" + + " to remove it from their cache." + + " The service may remove from the cache on the poll request. The optimizer will" + + " treat Not found reponse on as normal.", response = ActiveTicketsResponse.class) @ApiResponses(value = {@ApiResponse(code = 204, message = "OK"), @ApiResponse(code = 404, message = "Not found", response = CMSRequestError.class), diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/HealthCheckImpl.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/HealthCheckImpl.java index efc57ec..72b80bb 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/HealthCheckImpl.java +++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/HealthCheckImpl.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. @@ -65,24 +65,32 @@ public class HealthCheckImpl implements HealthCheck { HealthCheckMessage hc = new HealthCheckMessage(); hc.setHealthy(true); - addToHealthCheckMessage(hc, this.healthCheck()); + //addToHealthCheckMessage(hc, this.healthCheckDb()); - if (hc.getHealthy()) + if (hc.getHealthy()) { response = Response.ok().entity(hc).build(); - else + } + else { response = Response.status(Response.Status.BAD_REQUEST).entity(hc).build(); + } return response; } private void addToHealthCheckMessage(HealthCheckMessage hc, HealthCheckComponent hcc) { - if (!hcc.getHealthy()) + if (!hcc.getHealthy()) { hc.setHealthy(false); + } hc.setHostname(System.getenv("HOSTNAME")); hc.addComponent(hcc); } - public HealthCheckComponent healthCheck() { + /** + * Health check. + * + * @return the health check component + */ + public HealthCheckComponent healthCheckDb() { HealthCheckComponent hcc = new HealthCheckComponent(); hcc.setName("Ticket Management Database"); String url = env.getProperty("spring.datasource.url"); diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/TicketManagement.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/TicketManagement.java index 96c2ada..16346bf 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/TicketManagement.java +++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/TicketManagement.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. @@ -101,7 +101,8 @@ public interface TicketManagement { @ApiResponse(code = 500, message = "Unexpected Runtime error", response = Exception.class)}) public Response deleteScheduleRequest( @ApiParam(value = "v1") @PathParam("apiVersion") @DefaultValue("v1") String apiVersion, - @ApiParam(value = "Ticket id to uniquely identify the ticket being deleted.") @PathParam("id") String id); + @ApiParam(value = "Ticket id to uniquely identify the ticket being deleted.") + @PathParam("id") String id); @@ -122,7 +123,8 @@ public interface TicketManagement { allowMultiple = true) @QueryParam("startTime") String startTime, @ApiParam(value = "Finish time <low>,<high>", allowMultiple = true) @QueryParam("finishTime") String finishTime, - @ApiParam(value = "Maximum number of tickets to return") @QueryParam("maxTickets") Integer maxTickets, + @ApiParam(value = "Maximum number of tickets to return") + @QueryParam("maxTickets") Integer maxTickets, @ApiParam(value = "Return tickets > last id") @QueryParam("lastId") String lastId); } diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ActiveTicketsRequest.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ActiveTicketsRequest.java index 34093f9..4955e24 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ActiveTicketsRequest.java +++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ActiveTicketsRequest.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. @@ -51,7 +51,8 @@ public class ActiveTicketsRequest implements Serializable { private String requestId; @ApiModelProperty( - value = "Implementation specific name value pairs provided to be passed to Ticket Management query .") + value = "Implementation specific name value pairs provided" + + " to be passed to Ticket Management query .") private List<NameValue> commonData; @ApiModelProperty(value = "Lists of desired change windows for which TicketData will be returned.") @@ -100,6 +101,7 @@ public class ActiveTicketsRequest implements Serializable { } + @Override public String toString() { ObjectMapper mapper = new ObjectMapper(); try { diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ActiveTicketsResponse.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ActiveTicketsResponse.java index 579f36a..bad6eac 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ActiveTicketsResponse.java +++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ActiveTicketsResponse.java @@ -55,7 +55,8 @@ public class ActiveTicketsResponse implements Serializable { private String requestId; @ApiModelProperty( - value = "List of TicketData for the requested elements. A single ticket may apply to more than 1 passed elementId.") + value = "List of TicketData for the requested elements." + + " A single ticket may apply to more than 1 passed elementId.") private List<TicketData> elements = new ArrayList<>(); @ApiModelProperty( diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ChangeWindow.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ChangeWindow.java index 31a49de..55b6523 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ChangeWindow.java +++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ChangeWindow.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. @@ -70,6 +70,12 @@ public class ChangeWindow implements Serializable { this.endTime = endTime; } + /** + * To string. + * + * @return the string + */ + @Override public String toString() { ObjectMapper mapper = new ObjectMapper(); try { diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ElementCriteria.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ElementCriteria.java index 0043dd3..babceb7 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ElementCriteria.java +++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/ElementCriteria.java @@ -1,33 +1,34 @@ /******************************************************************************* - * + * * Copyright © 2019 AT&T Intellectual Property. - * + * * 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.ticketmgt.service.rs.models; import io.swagger.annotations.ApiModel; diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/HealthCheckComponent.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/HealthCheckComponent.java index dafe38e..cb88d7a 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/HealthCheckComponent.java +++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/HealthCheckComponent.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. @@ -80,6 +80,7 @@ public class HealthCheckComponent implements Serializable { this.status = status; } + @Override public String toString() { ObjectMapper mapper = new ObjectMapper(); try { diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/HealthCheckMessage.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/HealthCheckMessage.java index e36f54e..6f9a733 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/HealthCheckMessage.java +++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/HealthCheckMessage.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. @@ -96,6 +96,7 @@ public class HealthCheckMessage implements Serializable { this.components.add(components); } + @Override public String toString() { ObjectMapper mapper = new ObjectMapper(); try { diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/NameValue.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/NameValue.java index c5c53b2..29cf86d 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/NameValue.java +++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/NameValue.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. @@ -71,6 +71,7 @@ public class NameValue implements Serializable { } + @Override public String toString() { ObjectMapper mapper = new ObjectMapper(); try { diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/TicketData.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/TicketData.java index 486034f..e2c58c5 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/TicketData.java +++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/models/TicketData.java @@ -1,47 +1,48 @@ /******************************************************************************* - * + * * Copyright © 2019 AT&T Intellectual Property. - * + * * 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.ticketmgt.service.rs.models; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import org.onap.optf.ticketmgt.common.Availability; -import org.springframework.format.annotation.DateTimeFormat; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import org.onap.optf.ticketmgt.common.Availability; +import org.springframework.format.annotation.DateTimeFormat; @ApiModel(value = "Ticket Data", description = "Change Management Ticket Information.") public class TicketData implements Serializable { @@ -117,6 +118,7 @@ public class TicketData implements Serializable { this.changeDetails = changeDetails; } + @Override public String toString() { ObjectMapper mapper = new ObjectMapper(); try { |