/*
* 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;
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;
* 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,
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();
}
+ /**
+ * 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 {
}
+ /**
+ * 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));
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) {
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"),
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;
/*
* 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;
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();
}
/*
* 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;
/*
* 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;
//
//
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;
}
return message;
}
+ public String getMessage(String... arguments) {
+ return EELFResourceManager.format((EELFResolvableErrorEnum) value, arguments);
+ }
+
+
@Override
public Status getStatus() {
return status;
return metric;
}
- public String getMessage(String... arguments) {
- return EELFResourceManager.format((EELFResolvableErrorEnum) value, arguments);
- }
-
public void setValue(Enum<?> value) {
this.value = value;
}
/*
* 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.
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;
}
}
+ /**
+ * Gets the user.
+ *
+ * @param request the request
+ * @return the user
+ */
public static String getUser(HttpServletRequest request) {
String user = "";
String header = request.getHeader("Authorization");
/*
* 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.
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();
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);
/*
* 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.
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);
}
}
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());
/*
* 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;
/*
* 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;
/*
* 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.
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() {
return objectMapper;
}
+ /**
+ * Instantiates a new jersey configuration.
+ */
@Autowired
public JerseyConfiguration( /* LogRequestFilter lrf */ ) {
register(HealthCheckImpl.class);
register(CMSOContainerFilters.class);
}
+ /**
+ * Jersey client.
+ *
+ * @return the client
+ */
@Bean
public Client jerseyClient() {
ClientConfig client = new ClientConfig();
/*
* 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;
* limitations under the License.
* ============LICENSE_END=========================================================
*/
+
package org.onap.optf.ticketmgt;
public class SpringProfiles {
* limitations under the License.
* ============LICENSE_END=========================================================
*/
+
package org.onap.optf.ticketmgt.aaf;
import java.io.IOException;
import org.springframework.stereotype.Component;
/**
- * AAF authorization filter
+ * AAF authorization filter.
*/
@Component
@Value("${permission.instance}")
String instance;
+ /**
+ * Instantiates a new aaf authorization filter.
+ */
public AafAuthorizationFilter() {
this.setOrder(FilterPriority.AAF_AUTHORIZATION.getPriority());
* 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;
import org.springframework.stereotype.Component;
/**
- * AAF authentication filter
+ * AAF authentication filter.
*/
@Component
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"));
* 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() {
* limitations under the License.
* ============LICENSE_END=========================================================
*/
+
package org.onap.optf.ticketmgt.aaf;
import java.io.IOException;
/*******************************************************************************
- *
+ *
* 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 {
/*******************************************************************************
- *
+ *
* 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.
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";
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;
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;
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
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"),
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;
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);
}
/*
* 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.
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);
String majorVersion = requestContext.getUriInfo().getPath();
if (majorVersion != null) {
- if (majorVersion.startsWith("dispatch/"))
+ if (majorVersion.startsWith("dispatch/")) {
return;
+ }
majorVersion = majorVersion.replaceAll("/.*$", "");
}
if (!MessageHeaders.validateMajorVersion(majorVersion)) {
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);
/*
* 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.
@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;
/*
* 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.
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"),
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}")
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"),
@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),
/*
* 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.
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");
/*
* 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.
@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);
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);
}
/*
* 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.
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.")
}
+ @Override
public String toString() {
ObjectMapper mapper = new ObjectMapper();
try {
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(
/*
* 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.
this.endTime = endTime;
}
+ /**
+ * To string.
+ *
+ * @return the string
+ */
+ @Override
public String toString() {
ObjectMapper mapper = new ObjectMapper();
try {
/*******************************************************************************
- *
+ *
* 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;
/*
* 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.
this.status = status;
}
+ @Override
public String toString() {
ObjectMapper mapper = new ObjectMapper();
try {
/*
* 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.
this.components.add(components);
}
+ @Override
public String toString() {
ObjectMapper mapper = new ObjectMapper();
try {
/*
* 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.
}
+ @Override
public String toString() {
ObjectMapper mapper = new ObjectMapper();
try {
/*******************************************************************************
- *
+ *
* 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 {
this.changeDetails = changeDetails;
}
+ @Override
public String toString() {
ObjectMapper mapper = new ObjectMapper();
try {