--- /dev/null
+
+cadi_loglevel=DEBUG
+cadi_prop_files=src/main/resources/aaf/org.onap.oof.props
+
loopback.mso.requestId=dummy123\r
\r
so.polling.interval.ms=10000\r
-#mso.user=cmso@onap.org\r
-#mso.pass=enc:bfodXf8qRfCqMvlxVBYNWQ==\r
\r
## loopback settings\r
so.url=http://localhost:8080/cmso/v1/loopbacktest/onap/so/infra/orchestrationRequests/v7\r
-so.user=cmso@onap.org\r
-so.pass=enc:bfodXf8qRfCqMvlxVBYNWQ==\r
+so.user=oof@oof.onap.org\r
+so.pass=enc:vfxQdJ1mgdcI7S6SPrzNaw==\r
\r
-mechid.user=cmso@onap.org\r
-mechid.pass=enc:bfodXf8qRfCqMvlxVBYNWQ==\r
+mechid.user=oof@oof.onap.org\r
+mechid.pass=enc:vfxQdJ1mgdcI7S6SPrzNaw==\r
\r
cmso.dispatch.url=http://localhost:8089\r
<?xml version="1.0" encoding="UTF-8"?>\r
-<!-- \r
- Copyright © 2017-2018 AT&T Intellectual Property.\r
- Modifications Copyright © 2018 IBM.\r
- \r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
- \r
- http://www.apache.org/licenses/LICENSE-2.0\r
- \r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
- \r
- \r
- Unless otherwise specified, all documentation contained herein is licensed\r
- under the Creative Commons License, Attribution 4.0 Intl. (the "License");\r
- you may not use this documentation except in compliance with the License.\r
- You may obtain a copy of the License at\r
- \r
- https://creativecommons.org/licenses/by/4.0/\r
- \r
- Unless required by applicable law or agreed to in writing, documentation\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
+<!--\r
+\r
+ ============LICENSE_START=======================================================\r
+ org.onap.optf.cmso\r
+ ================================================================================\r
+ Copyright © 2017-2019 AT&T Intellectual Property. All rights reserved.\r
+ ================================================================================\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+ ============LICENSE_END=========================================================\r
+\r
-->\r
\r
+\r
<project xmlns="http://maven.apache.org/POM/4.0.0"\r
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\r
<modelVersion>4.0.0</modelVersion>\r
\r
- <parent>\r
- <groupId>org.onap.optf.cmso</groupId>\r
- <artifactId>cmso</artifactId>\r
- <version>1.0.1-SNAPSHOT</version>\r
- </parent>\r
+ <parent>\r
+ <groupId>org.onap.optf.cmso</groupId>\r
+ <artifactId>cmso</artifactId>\r
+ <version>1.0.1-SNAPSHOT</version>\r
+ </parent>\r
\r
<groupId>org.onap.optf.cmso</groupId>\r
<artifactId>cmso-service</artifactId>\r
\r
<properties>\r
<maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>\r
- \r
+\r
<cmso.project.version>${project.version}</cmso.project.version>\r
<cmso.build.timestamp>${maven.build.timestamp}</cmso.build.timestamp>\r
- \r
+\r
<service.name>cmso</service.name>\r
<release-tag>Casablanca</release-tag>\r
<name.space>org.onap.optf.cmso</name.space>\r
<maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>\r
<mariadb.version>2.2.1</mariadb.version>\r
<swagger.directory>${basedir}/src/main/resources/swagger-ui/dist</swagger.directory>\r
+ <aaf.version>2.1.4</aaf.version>\r
\r
<!-- Sonar -->\r
<ilib.version>2.0.7</ilib.version>\r
<artifactId>springfox-swagger-ui</artifactId>\r
<version>${springfox.swagger2.version}</version>\r
</dependency>\r
- <!-- <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> \r
- </dependency> -->\r
<dependency>\r
<groupId>org.quartz-scheduler</groupId>\r
<artifactId>quartz</artifactId>\r
</dependency>\r
\r
<dependency>\r
- <groupId>joda-time</groupId>\r
- <artifactId>joda-time</artifactId>\r
- <version>2.8.1</version>\r
- </dependency>\r
+ <groupId>joda-time</groupId>\r
+ <artifactId>joda-time</artifactId>\r
+ </dependency>\r
<dependency>\r
- <groupId>org.apache.commons</groupId>\r
- <artifactId>commons-lang3</artifactId>\r
- <version>3.8.1</version>\r
+ <groupId>org.apache.commons</groupId>\r
+ <artifactId>commons-text</artifactId>\r
+ <version>1.6</version>\r
</dependency>\r
<!-- Testing Dependencies -->\r
<!-- <dependency> <groupId>org.powermock</groupId> <artifactId>powermock-api-mockito2</artifactId> \r
<groupId>org.jacoco</groupId>\r
<artifactId>jacoco-maven-plugin</artifactId>\r
<version>0.8.1</version>\r
- <scope>test</scope>\r
+ <scope>test</scope>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>org.onap.aaf.authz</groupId>\r
+ <artifactId>aaf-cadi-aaf</artifactId>\r
+ <version>${aaf.version}</version>\r
</dependency>\r
</dependencies>\r
\r
</configuration>\r
</execution>\r
</executions>\r
- </plugin> \r
+ </plugin>\r
<plugin>\r
<artifactId>exec-maven-plugin</artifactId>\r
<groupId>org.codehaus.mojo</groupId>\r
</executions>\r
</plugin>\r
<plugin>\r
- <groupId>io.fabric8</groupId>\r
- <artifactId>docker-maven-plugin</artifactId>\r
- <version>0.26.0</version>\r
- <configuration>\r
- <verbose>true</verbose>\r
- <apiVersion>1.23</apiVersion>\r
- <images>\r
- <image>\r
- <name>onap/optf-cmso-service</name>\r
- <alias>onap-optf-cmso-service</alias>\r
- <build>\r
- <cleanup>true</cleanup>\r
- <tags>\r
- <tag>latest</tag>\r
- <tag>${project.docker.latesttagtimestamp.version}</tag>\r
- <tag>${project.docker.latesttag.version}</tag> \r
- </tags>\r
- <dockerFile>${project.basedir}/src/main/docker/Dockerfile</dockerFile>\r
- <assembly>\r
- <descriptor>${project.basedir}/src/main/docker/assembly/cmso-files.xml</descriptor>\r
- <name>onap-cmso</name>\r
- </assembly>\r
- </build>\r
- </image>\r
- </images>\r
- </configuration>\r
- <executions>\r
- <execution>\r
- <id>generate-images</id>\r
- <phase>install</phase>\r
- <goals>\r
- <goal>build</goal>\r
- </goals>\r
- </execution>\r
- <execution>\r
- <id>push-images</id>\r
- <phase>deploy</phase>\r
- <goals>\r
- <goal>build</goal>\r
- <goal>push</goal>\r
- </goals>\r
- <configuration>\r
- <image>onap/optf-cmso-service:%l</image>\r
- </configuration>\r
- </execution>\r
- </executions>\r
+ <groupId>io.fabric8</groupId>\r
+ <artifactId>docker-maven-plugin</artifactId>\r
+ <version>0.26.0</version>\r
+ <configuration>\r
+ <verbose>true</verbose>\r
+ <apiVersion>1.23</apiVersion>\r
+ <images>\r
+ <image>\r
+ <name>onap/optf-cmso-service</name>\r
+ <alias>onap-optf-cmso-service</alias>\r
+ <build>\r
+ <cleanup>true</cleanup>\r
+ <tags>\r
+ <tag>latest</tag>\r
+ <tag>${project.docker.latesttagtimestamp.version}</tag>\r
+ <tag>${project.docker.latesttag.version}</tag>\r
+ </tags>\r
+ <dockerFile>${project.basedir}/src/main/docker/Dockerfile</dockerFile>\r
+ <assembly>\r
+ <descriptor>${project.basedir}/src/main/docker/assembly/cmso-files.xml</descriptor>\r
+ <name>onap-cmso</name>\r
+ </assembly>\r
+ </build>\r
+ </image>\r
+ </images>\r
+ </configuration>\r
+ <executions>\r
+ <execution>\r
+ <id>generate-images</id>\r
+ <phase>install</phase>\r
+ <goals>\r
+ <goal>build</goal>\r
+ </goals>\r
+ </execution>\r
+ <execution>\r
+ <id>push-images</id>\r
+ <phase>deploy</phase>\r
+ <goals>\r
+ <goal>build</goal>\r
+ <goal>push</goal>\r
+ </goals>\r
+ <configuration>\r
+ <image>onap/optf-cmso-service:%l</image>\r
+ </configuration>\r
+ </execution>\r
+ </executions>\r
</plugin>\r
</plugins>\r
<!-- mention the logback.xml location through system property or environment \r
<include>**/*</include>\r
</includes>\r
</resource>\r
+ <resource>\r
+ <directory>etc/config</directory>\r
+ <filtering>true</filtering>\r
+ <includes>\r
+ <include>**/*</include>\r
+ </includes>\r
+ </resource>\r
<resource>\r
<directory>${basedir}/truststore</directory>\r
<targetPath>${basedir}/target/truststore</targetPath>\r
-<!--
- ============LICENSE_START=======================================================
- ECOMP CMSO
- ================================================================================
- Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
- ================================================================================
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy 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.
- ============LICENSE_END=========================================================
- -->
+<!-- ============LICENSE_START=======================================================
+ ECOMP CMSO ================================================================================
+ Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. ================================================================================
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ use this file except in compliance with the License. You may obtain a copy
+ 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. ============LICENSE_END========================================================= -->
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1"
<directory>data</directory>
<outputDirectory>/data</outputDirectory>
</fileSet>
+ <fileSet>
+ <directory>${project.basedir}/src/main/resources</directory>
+ <outputDirectory>./resources</outputDirectory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>${project.basedir}/etc/config</directory>
+ <outputDirectory>./</outputDirectory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </fileSet>
+
</fileSets>
</assembly>
#!/bin/sh
+
+VM_ARGS="${VM_ARGS} -Dserver.local.startpath=${RESOURCES_HOME}"
+
echo "VM_ARGS="${VM_ARGS}
java -Djava.security.egd=file:/dev/./urandom ${VM_ARGS} -Xms256m -Xmx1024m -jar ./app.jar
--- /dev/null
+#!/bin/sh
+echo "VM_ARGS="${VM_ARGS}
+
+java -Djava.security.egd=file:/dev/./urandom ${VM_ARGS} -Xms256m -Xmx1024m -jar ./app.jar
--- /dev/null
+/*
+ * 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_END_TIMESTAMP;
+import static com.att.eelf.configuration.Configuration.MDC_INSTANCE_UUID;
+import static com.att.eelf.configuration.Configuration.MDC_KEY_REQUEST_ID;
+import static com.att.eelf.configuration.Configuration.MDC_PARTNER_NAME;
+import static com.att.eelf.configuration.Configuration.MDC_REMOTE_HOST;
+import static com.att.eelf.configuration.Configuration.MDC_RESPONSE_CODE;
+import static com.att.eelf.configuration.Configuration.MDC_RESPONSE_DESC;
+import static com.att.eelf.configuration.Configuration.MDC_SERVER_FQDN;
+import static com.att.eelf.configuration.Configuration.MDC_SERVER_IP_ADDRESS;
+import static com.att.eelf.configuration.Configuration.MDC_SERVICE_INSTANCE_ID;
+import static com.att.eelf.configuration.Configuration.MDC_SERVICE_NAME;
+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 java.net.InetAddress;
+import java.net.URI;
+import java.util.Date;
+import java.util.Map;
+import java.util.UUID;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.client.ClientRequestContext;
+import javax.ws.rs.client.ClientResponseContext;
+import javax.ws.rs.container.ContainerRequestContext;
+import javax.ws.rs.container.ContainerResponseContext;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response.StatusType;
+
+import org.onap.optf.cmso.filters.MessageHeaders.HeadersEnum;
+import org.quartz.JobExecutionContext;
+import org.slf4j.MDC;
+
+import com.att.eelf.utils.Stopwatch;
+
+/**
+ * ECOMP EELF logging MDC fields not defined in the MDC Configuration (i.e.
+ * MDC_ALERT_SEVERITY)
+ **/
+public class Mdc {
+ public static final String SERVICE_NAME = "CSS-Scheduler";
+ public enum Enum {
+ // BeginTimestamp,
+ // EndTimeStamp,
+ // RequestId,
+ // ServiceInstanceId,
+ VirtualServerName,
+ // ServiceName,
+ // PartnerName,
+ // StatusCOde,
+ // ResponseCode,
+ // ResponseDescription,
+ // InstanceUUID,
+ // AlertSeverity,
+ // ServerIPAddress,
+ // ElapsedTime,
+ // ServerFQDN,
+ // RemoteHost,
+ ClassName, Unused,
+ // ProcessKey,
+ CustomField1, CustomField2, CustomField3, CustomField4,
+ // TargetVirtualEntity,
+ // TargetEntity,
+ // TargetServiceName,
+ ErrorCode, ErrorDescription, Timer,
+ }
+
+ public static String getCaller(int back)
+ {
+ StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace();
+ return stackTraceElements[back].getClassName() + "." + stackTraceElements[back].getMethodName();
+ }
+
+ public static void setCaller(int back)
+ {
+ String caller = MDC.get(Enum.ClassName.name());
+ if (caller == null)
+ MDC.put(Enum.ClassName.name(), getCaller(back));
+ }
+
+ public static void setObservation(ObservationInterface o)
+ {
+ MDC.put(Enum.CustomField4.name(), o.name());
+ }
+
+ public static void clearCaller()
+ {
+ MDC.remove(Enum.ClassName.name());
+ }
+
+ public static void quartzJobBegin(JobExecutionContext context)
+ {
+ MDC.clear();
+ MDC.put(MDC_BEGIN_TIMESTAMP, Stopwatch.isoFormatter.format(new Date()));
+ MDC.put(MDC_INSTANCE_UUID, UUID.randomUUID().toString());
+ try{ MDC.put(MDC_SERVER_FQDN, InetAddress.getLocalHost().getHostName()); } catch (Exception e){ MDC.put(MDC_SERVER_FQDN, e.getMessage());}
+ try{ MDC.put(MDC_SERVER_IP_ADDRESS, InetAddress.getLocalHost().getHostAddress()); } catch (Exception e){ MDC.put(MDC_SERVER_FQDN, e.getMessage());}
+ MDC.put(MDC_SERVICE_INSTANCE_ID, "UNKNOWN");
+ MDC.put(MDC_SERVICE_NAME, SERVICE_NAME);
+ MDC.put(Enum.ClassName.name(), getCaller(3));
+ }
+
+ public static void quartzJobEnd(JobExecutionContext context)
+ {
+ MDC.put(MDC_END_TIMESTAMP, Stopwatch.isoFormatter.format(new Date()));
+ MDC.put(Enum.ClassName.name(), getCaller(3));
+ }
+
+ public static Map<String, String> save()
+ {
+ Map<String, String> save = MDC.getCopyOfContextMap();
+ return save;
+ }
+
+ public static void restore(Map<String, String> mdcSave)
+ {
+ MDC.clear();
+ for (String name : mdcSave.keySet())
+ MDC.put(name, mdcSave.get(name));
+ }
+
+
+
+ public static void setRequestIdIfNotSet(String requestId) {
+ if (MDC.get(MDC_KEY_REQUEST_ID) == null || MDC.get(MDC_KEY_REQUEST_ID).equals(""))
+ {
+ setRequestId(requestId);
+ }
+ }
+
+ public static void setRequestId(String requestId) {
+ MDC.put(MDC_KEY_REQUEST_ID, requestId);
+ }
+
+ 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());
+ }
+
+ public static void metricEnd(ClientResponseContext response)
+ {
+
+ Date now = new Date();
+ //MDC.put(MDC_BEGIN_TIMESTAMP, Stopwatch.isoFormatter.format(now));
+ MDC.put(MDC_END_TIMESTAMP, Stopwatch.isoFormatter.format(now));
+ setResponseInfo(response.getStatusInfo());
+
+ }
+ 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());
+ if (transactionId != null)
+ {
+ setRequestId(transactionId);
+ }
+ else
+ {
+ setRequestId(UUID.randomUUID().toString());
+ }
+
+ }
+
+ public static void auditEnd(ContainerRequestContext requestContext, ContainerResponseContext response)
+ {
+ Date now = new Date();
+ //MDC.put(MDC_BEGIN_TIMESTAMP, Stopwatch.isoFormatter.format(now));
+ MDC.put(MDC_END_TIMESTAMP, Stopwatch.isoFormatter.format(now));
+ MDC.put(Enum.ClassName.name(), getCaller(4));
+
+ setResponseInfo(response.getStatusInfo());
+
+ }
+
+ private static void setResponseInfo(StatusType statusInfo)
+ {
+ Integer status = statusInfo.getStatusCode();
+ String completed = "ERROR";
+ if (status >=200 && status < 300)
+ {
+ completed = "COMPLETE";
+ }
+ MDC.put(MDC_RESPONSE_CODE, status.toString());
+ MDC.put(MDC_RESPONSE_DESC, statusInfo.getReasonPhrase());
+ MDC.put(MDC_STATUS_CODE, completed);
+ }
+
+ 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);
+ }
+
+ private static void setPartnerTargetFromUri(URI uri)
+ {
+ try
+ {
+ MDC.put(MDC_PARTNER_NAME, uri.getHost());
+ MDC.put(MDC_TARGET_ENTITY, uri.getScheme() + "://" + uri.getHost() + ":" + uri.getPort());
+ MDC.put(MDC_TARGET_SERVICE_NAME, uri.getPath());
+ }
+ catch (Exception e)
+ {
+ MDC.put(MDC_PARTNER_NAME, "UNKNOWN");
+ MDC.put(MDC_TARGET_ENTITY, "UNKNOWN");
+ MDC.put(MDC_TARGET_SERVICE_NAME, "UNKNOWN");
+ }
+ }
+
+
+}
\ No newline at end of file
--- /dev/null
+/*
+ * 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 org.apache.log4j.Level;
+import org.onap.optf.cmso.Application;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+
+
+public class Observation
+{
+ private static EELFLogger log = EELFManager.getInstance().getLogger(Application.class);
+ private static EELFLogger metrics = EELFManager.getInstance().getMetricsLogger();
+ private static EELFLogger audit = EELFManager.getInstance().getAuditLogger();
+ private static EELFLogger errors = EELFManager.getInstance().getErrorLogger();
+ private static EELFLogger debug = EELFManager.getInstance().getDebugLogger();
+
+ //*************************************************************************************************
+ public static void report(ObservationInterface o, Exception e, String ...arguments)
+ {
+ Mdc.setCaller(4);
+ Mdc.setObservation(o);
+ if (o.getAudit())
+ {
+ audit.info(o, e, arguments);
+ }
+ if (o.getMetric())
+ {
+ metrics.info(o, e, arguments);
+ }
+ Level l = o.getLevel();
+ switch (l.toInt())
+ {
+ case Level.WARN_INT:
+ errors.warn(o, arguments);
+ debug.debug(o, e, arguments);
+ break;
+ case Level.INFO_INT:
+ log.info(o, e, arguments);
+ debug.debug(o, e, arguments);
+ break;
+ case Level.ERROR_INT:
+ errors.error(o, arguments);
+ debug.debug(o, e, arguments);
+ break;
+ case Level.TRACE_INT:
+ debug.trace(o, e, arguments);
+ break;
+ case Level.DEBUG_INT:
+ debug.debug(o, e, arguments);
+ break;
+ default:
+ log.info(o, e, arguments);
+ }
+ Mdc.clearCaller();
+ }
+
+ public static void report(ObservationInterface o, String ...arguments)
+ {
+ Mdc.setCaller(4);
+ Mdc.setObservation(o);
+ if (o.getAudit())
+ {
+ audit.info(o, arguments);
+ }
+ if (o.getMetric())
+ {
+ metrics.info(o, arguments);
+ }
+ Level l = o.getLevel();
+ switch (l.toInt())
+ {
+ case Level.WARN_INT:
+ errors.warn(o, arguments);
+ debug.debug(o, arguments);
+ break;
+ case Level.INFO_INT:
+ log.info(o, arguments);
+ debug.debug(o, arguments);
+ break;
+ case Level.ERROR_INT:
+ errors.error(o, arguments);
+ debug.debug(o, arguments);
+ break;
+ case Level.TRACE_INT:
+ debug.debug(o, arguments);
+ break;
+ case Level.DEBUG_INT:
+ debug.debug(o, arguments);
+ break;
+ default:
+ log.info(o, arguments);
+ }
+ Mdc.clearCaller();
+ }
+
+}
--- /dev/null
+/*
+ * 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 javax.ws.rs.core.Response.Status;
+
+import org.apache.log4j.Level;
+
+import com.att.eelf.i18n.EELFResolvableErrorEnum;
+
+public interface ObservationInterface extends EELFResolvableErrorEnum
+{
+ public Enum<?> getValue();
+ public Level getLevel();
+ public String getMessage();
+ public Status getStatus();
+ public String getDomain();
+ public String name();
+ public Boolean getAudit();
+ public Boolean getMetric();
+}
\ No newline at end of file
--- /dev/null
+/*
+ * 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 javax.ws.rs.core.Response.Status;
+
+import org.apache.log4j.Level;
+
+import com.att.eelf.i18n.EELFResolvableErrorEnum;
+import com.att.eelf.i18n.EELFResourceManager;
+
+
+public class ObservationObject implements ObservationInterface
+{
+
+ //*************************************************************************************************
+ // Interface class that matches the ObservationInteface pattern
+ // This will be used in case we decide to provide external overrides and we need to instantiate
+ // For now, we'll just use the Enum itself.
+ //
+ //
+ private Enum<?> value = 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();
+
+ }
+ public Enum<?> getValue() {return value;}
+ @Override
+ public String getMessage() {return message;}
+ @Override
+ public Status getStatus() {return status;}
+ @Override
+ public String getDomain() {return domain;}
+
+ @Override
+ public Level getLevel() {
+ return level;
+ }
+ @Override
+ public String name() {
+ return value.name();
+ }
+ @Override
+ public Boolean getAudit() {
+ return audit;
+ }
+ @Override
+ public Boolean getMetric() {
+ return metric;
+ }
+
+ public String getMessage(String ...arguments) {
+ return EELFResourceManager.format((EELFResolvableErrorEnum)value, arguments);
+ }
+ public void setValue(Enum<?> value) {
+ this.value = value;
+ }
+ public void setLevel(Level level) {
+ this.level = level;
+ }
+ public void setMessage(String message) {
+ this.message = message;
+ }
+ public void setStatus(Status status) {
+ this.status = status;
+ }
+
+
+}
package org.onap.optf.cmso;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Profile;
import org.springframework.core.env.Environment;
import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import java.util.ArrayList;
@Component
+@Profile(SpringProfiles.PROPRIETARY__AUTHENTICATION)
+
public class AuthProvider
implements AuthenticationProvider {
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Profile;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
@Configuration
@EnableWebSecurity
@ComponentScan("org.onap.optf")
+@Profile(SpringProfiles.PROPRIETARY__AUTHENTICATION)
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
--- /dev/null
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.optf.cmso
+ * ================================================================================
+ * Copyright © 2019 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.optf.cmso;
+
+public class SpringProfiles
+{
+
+ public static final String AAF_AUTHENTICATION = "aaf-auth";
+ public static final String PROPRIETARY__AUTHENTICATION = "proprietary-auth";
+
+ private SpringProfiles(){}
+}
--- /dev/null
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.optf.cmso
+ * ================================================================================
+ * Copyright © 2019 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.optf.cmso.aaf;
+
+import java.io.IOException;
+import java.util.List;
+
+import javax.servlet.FilterChain;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.onap.aaf.cadi.CadiWrap;
+import org.onap.aaf.cadi.Permission;
+import org.onap.observations.Observation;
+import org.onap.optf.cmso.SpringProfiles;
+import org.onap.optf.cmso.common.LogMessages;
+import org.onap.optf.cmso.common.exceptions.CMSException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.web.servlet.filter.OrderedRequestContextFilter;
+import org.springframework.context.annotation.Profile;
+import org.springframework.stereotype.Component;
+
+/**
+ * AAF authorization filter
+ */
+
+@Component
+@Profile(SpringProfiles.AAF_AUTHENTICATION)
+public class AafAuthorizationFilter extends OrderedRequestContextFilter {
+
+ @Autowired
+ AafUserRoleProperties userRoleProperties;
+
+ public AafAuthorizationFilter() {
+ this.setOrder(FilterPriority.AAF_AUTHORIZATION.getPriority());
+
+
+ }
+
+ @Override
+ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws IOException, ServletException {
+ try
+ {
+ if (request instanceof CadiWrap)
+ {
+ CadiWrap cw = (CadiWrap)request;
+ List<Permission> perms = cw.getPermissions(cw.getUserPrincipal());
+ if (userRoleProperties.processPermissions(request, perms))
+ {
+ filterChain.doFilter(request,response);
+ }
+ else
+ {
+ Observation.report(LogMessages.UNAUTHORIZED);
+ ResponseFormatter.errorResponse(request, response,
+ new CMSException(LogMessages.UNAUTHORIZED.getStatus(),
+ LogMessages.UNAUTHORIZED, ""));
+ }
+ }
+ else
+ {
+ throw new Exception();
+ }
+ }
+ catch (Exception e)
+ {
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());
+ ResponseFormatter.errorResponse(request, response,
+ new CMSException(LogMessages.UNAUTHORIZED.getStatus(),
+ LogMessages.UNAUTHORIZED, ""));
+ }
+ }
+}
--- /dev/null
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.optf.cmso
+ * ================================================================================
+ * Copyright © 2019 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.optf.cmso.aaf;
+
+
+import java.io.IOException;
+import java.util.Properties;
+
+import javax.servlet.FilterChain;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.onap.aaf.cadi.PropAccess;
+import org.onap.aaf.cadi.filter.CadiFilter;
+import org.onap.observations.Observation;
+import org.onap.optf.cmso.Application;
+import org.onap.optf.cmso.SpringProfiles;
+import org.onap.optf.cmso.common.LogMessages;
+import org.onap.optf.cmso.common.exceptions.CMSException;
+import org.springframework.boot.web.servlet.filter.OrderedRequestContextFilter;
+import org.springframework.context.annotation.Profile;
+import org.springframework.stereotype.Component;
+
+/**
+ * AAF authentication filter
+ */
+
+@Component
+@Profile(SpringProfiles.AAF_AUTHENTICATION)
+public class AafFilter extends OrderedRequestContextFilter {
+
+ private final CadiFilter cadiFilter;
+
+ public AafFilter() throws IOException, ServletException {
+ Properties cadiProperties = new Properties();
+ cadiProperties.load(Application.class.getClassLoader().getResourceAsStream("cadi.properties"));
+ cadiFilter = new CadiFilter(new PropAccess(cadiProperties));
+ this.setOrder(FilterPriority.AAF_AUTHENTICATION.getPriority());
+ }
+
+ @Override
+ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws IOException, ServletException {
+ cadiFilter.doFilter(request, response, filterChain);
+ if(response.getStatus() ==401){
+ Observation.report(LogMessages.UNAUTHENTICATED);
+ ResponseFormatter.errorResponse(request, response,
+ new CMSException(LogMessages.UNAUTHENTICATED.getStatus(),
+ LogMessages.UNAUTHENTICATED, ""));
+ }
+ }
+
+
+}
--- /dev/null
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.optf.cmso
+ * ================================================================================
+ * Copyright © 2019 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.optf.cmso.aaf;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.onap.aaf.cadi.aaf.AAFPermission;
+
+
+public class AafPerm
+{
+ private String type;
+ private String instance;
+ private String action;
+ private Set<String> actions = new HashSet<>();
+
+ public String getAction() {
+ return action;
+ }
+ public void setAction(String action) {
+ this.action = action;
+ String list[] = action.split(",");
+ for (String a : list)
+ actions.add(a);
+ }
+ public String getType() {
+ return type;
+ }
+ public void setType(String type) {
+ this.type = type;
+ }
+ public String getInstance() {
+ return instance;
+ }
+ public void setInstance(String instance) {
+ this.instance = instance;
+ }
+
+ public Set<String> getActions() {
+ return actions;
+ }
+ public void setActions(Set<String> actions) {
+ this.actions = actions;
+ }
+ public boolean matches(AAFPermission userPerm)
+ {
+ if (type.equals(userPerm.getType()))
+ {
+ if (userPerm.getInstance().equals("*") || instance.equals("*") || userPerm.getInstance().equals(instance))
+ {
+ for (String userAction : userPerm.getAction().split(","))
+ {
+ if (userAction.equals("*") || actions.contains("*") || actions.contains(userAction))
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+}
--- /dev/null
+/*
+ * 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.cmso.aaf;
+
+import org.onap.optf.cmso.SpringProfiles;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Profile;
+import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
+import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
+
+@Configuration
+@EnableWebSecurity
+@ComponentScan("org.onap.optf")
+@Profile(SpringProfiles.AAF_AUTHENTICATION)
+public class AafSecurityConfig extends WebSecurityConfigurerAdapter {
+
+
+ @Override
+ protected void configure(AuthenticationManagerBuilder auth) throws Exception {
+
+ }
+
+ @Override
+ protected void configure(HttpSecurity http) throws Exception {
+
+ http.csrf().disable();
+
+ }
+}
\ No newline at end of file
--- /dev/null
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.optf.cmso
+ * ================================================================================
+ * Copyright © 2019 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.optf.cmso.aaf;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class AafUserRole
+{
+ private String url = "";
+ private String pathParts[] = {};
+ private String perm = "";
+ private String method = "";
+ private List<AafPerm> aafPerms = new ArrayList<>();
+
+ public AafUserRole(String url, String perm)
+ {
+ this.setUrl(url);
+ this.setPerm(perm);
+ pathParts = url.split("\\/");
+
+ String[] perms = perm.split(",");
+ for (String p : perms)
+ {
+ String parts[] = p.split(" ");
+ if (parts.length == 2)
+ method = parts[1];
+ else
+ method = "ALL";
+
+ String[] list = parts[0].split("\\|");
+ if (list.length == 3)
+ {
+ AafPerm aafPerm = new AafPerm();
+ aafPerm.setAction(list[2]);
+ aafPerm.setInstance(list[1]);
+ aafPerm.setType(list[0]);
+ aafPerms.add(aafPerm);
+ }
+ }
+ }
+ public String getUrl() {
+ return url;
+ }
+ public void setUrl(String url) {
+ this.url = url;
+ }
+ public String getPerm() {
+ return perm;
+ }
+ public void setPerm(String perm) {
+ this.perm = perm;
+ }
+ public List<AafPerm> getAafPerms() {
+ return aafPerms;
+ }
+ public void setAafPerms(List<AafPerm> aafPerms) {
+ this.aafPerms = aafPerms;
+ }
+
+ public boolean matches(String path, String matchMethod)
+ {
+ if (!this.method.equalsIgnoreCase("ALL")
+ && !this.method.equals("*")
+ && !this.method.equals(matchMethod))
+ return false;
+ List<String> inNodes = new ArrayList<>();
+ List<String> matchNodes = new ArrayList<>();
+ String[] pathList = path.split("\\/");
+ for (String n : pathList)
+ {
+ inNodes.add(n);
+ }
+ for (String n : pathParts)
+ {
+ matchNodes.add(n);
+ }
+
+ while (!inNodes.isEmpty() && !matchNodes.isEmpty())
+ {
+ String inNode = inNodes.remove(0);
+ String matchNode = matchNodes.get(0);
+ if (matchNode.equals(inNode) || matchNode.equals("*"))
+ {
+ matchNodes.remove(0);
+ }
+ else
+ {
+ if (!matchNode.equals("**"))
+ {
+ return false;
+ }
+ }
+ }
+
+ //
+ if (inNodes.isEmpty() && matchNodes.isEmpty())
+ return true;
+
+ // We have incoming nodes remaining, see if we can wildcard them
+ if (matchNodes.size() == 1)
+ {
+ if (matchNodes.get(0).equals("**"))
+ return true;
+ if (inNodes.size() == 1 && matchNodes.get(0).equals("*"))
+ return true;
+ }
+ return false;
+ }
+}
--- /dev/null
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.optf.cmso
+ * ================================================================================
+ * Copyright © 2019 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.optf.cmso.aaf;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import javax.annotation.PostConstruct;
+import javax.servlet.http.HttpServletRequest;
+
+import org.onap.aaf.cadi.Permission;
+import org.onap.aaf.cadi.aaf.AAFPermission;
+import org.onap.observations.Observation;
+import org.onap.optf.cmso.SpringProfiles;
+import org.onap.optf.cmso.common.LogMessages;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Profile;
+import org.springframework.core.env.Environment;
+import org.springframework.stereotype.Component;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+/**
+ *
+ * This class uses a properties file to map URL patterns/method to AAF Permissions (AafPerm)
+ * @author jf9860
+ *
+ */
+@Component
+@Profile(SpringProfiles.AAF_AUTHENTICATION)
+public class AafUserRoleProperties
+{
+ @Autowired
+ Environment env;
+
+ private List<AafUserRole> list = new ArrayList<>();
+
+ @PostConstruct
+ public void initializePermissions()
+ {
+ String userRolePropertiesName = env.getProperty("aaf.user.roles", "src/main/resources/aaf/AAFUserRoles.properties");
+ Properties props = new Properties();
+ try
+ {
+ props.load(new FileInputStream(new File(userRolePropertiesName)));
+ }
+ catch (Exception e)
+ {
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());
+ }
+ for (Object url : props.keySet())
+ {
+ Object value = props.get(url);
+ list.add(new AafUserRole((String)url, (String)value));
+ }
+ }
+
+ public List<AafUserRole> getForUrlMethod(String url, String method)
+ {
+ List<AafUserRole> userRoleList = new ArrayList<>();
+ for (AafUserRole aur : list)
+ {
+ if (aur.matches(url, method))
+ {
+ userRoleList.add(aur);
+ }
+ }
+ return userRoleList;
+ }
+
+ public boolean processPermissions(HttpServletRequest request, List<Permission> userPerms)
+ {
+ try
+ {
+ // Get list of perms that match incoming URL. May be more than 1...
+ // Users perms must match all that match URL
+ List<AafUserRole> perms = getForUrlMethod(request.getRequestURI(), request.getMethod());
+ ObjectMapper om = new ObjectMapper();
+ int tested = 0;
+ int passed = 0;
+ for (AafUserRole perm : perms)
+ {
+ for (AafPerm test : perm.getAafPerms())
+ {
+ tested++;
+ for (Permission userPerm: userPerms)
+ {
+
+ if (test.matches((AAFPermission)userPerm))
+ {
+ passed++;
+ break;
+ }
+ }
+ }
+ }
+ // All permissions must be OK
+ if (tested > 0 && tested == passed)
+ return true;
+ else
+ return false;
+ }
+ catch (Exception e)
+ {
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());
+ }
+ return false;
+ }
+}
--- /dev/null
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.optf.cmso
+ * ================================================================================
+ * Copyright © 2019 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.optf.cmso.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;
+ }
+
+ public int getPriority() { return priority; }
+}
--- /dev/null
+/**
+ * ============LICENSE_START=======================================================
+ * org.onap.optf.cmso
+ * ================================================================================
+ * Copyright © 2019 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy 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.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.optf.cmso.aaf;
+
+import java.io.IOException;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.ws.rs.core.MediaType;
+
+import org.onap.optf.cmso.common.exceptions.CMSException;
+
+class ResponseFormatter {
+
+ private static final String ACCEPT_HEADER = "accept";
+
+ static void errorResponse(HttpServletRequest request, HttpServletResponse response, CMSException error) throws IOException {
+ String accept = request.getHeader(ACCEPT_HEADER) == null ? MediaType.APPLICATION_JSON : request.getHeader(ACCEPT_HEADER);
+ response.setStatus(error.getStatus().getStatusCode());
+ response.getWriter().write(error.getRequestError().toString());
+ response.getWriter().flush();
+ response.getWriter().close();
+ }
+
+}
/*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright © 2018 IBM.\r
+ * Copyright © 2017-2019 AT&T Intellectual Property.\r
+ * Modifications Copyright © 2018 IBM.\r
* \r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
import java.io.IOException;\r
import java.nio.file.Files;\r
import java.nio.file.Paths;\r
+\r
+import javax.ws.rs.core.Response.Status;\r
+\r
+import org.apache.log4j.Level;\r
+import org.onap.observations.ObservationInterface;\r
+\r
import com.att.eelf.configuration.EELFManager;\r
-import com.att.eelf.i18n.EELFResolvableErrorEnum;\r
import com.att.eelf.i18n.EELFResourceManager;\r
\r
-public enum LogMessages implements EELFResolvableErrorEnum {\r
-\r
- // Let developer provide the initial properties here.\r
- // We can merge them to logmessages.properties when we need to.\r
- SEARCH_SCHEDULE_REQUEST_DETAILS("Search Schedule Request Details {0} from {1}: {2}"), SEARCH_SCHEDULE_REQUEST(\r
- "Search Schedule Request {0} from {1}: {2} : {3}"), CREATE_SCHEDULE_REQUEST(\r
- "Create Schedule Request {0} from {1}: {2} : {3}"), DELETE_SCHEDULE_REQUEST(\r
- "Delete Schedule Request {0} from {1}: {2} : {3}"), GET_SCHEDULE_REQUEST_INFO(\r
- "Get Schedule Request Info {0} from {1}: {2} : {3}"), PROCESS_OPTIMIZER_CALLBACK(\r
- "Change management optimizer callback {0} from {1}: {2} "), APPROVE_SCHEDULE_REQUEST(\r
- "Approve Schedule Request {0} from {1}: {2} : {3}"), SCHEDULE_ALREADY_EXISTS(\r
- "Schedule already exists domain={0} schedule id={1}"), SCHEDULE_NOT_FOUND(\r
- "Schedule not found domain={0} schedule id={1}"), INVALID_ATTRIBUTE(\r
- "Invalid attribute {0}={1}"), MISSING_REQUIRED_ATTRIBUTE(\r
- "Missing required attribute '{0}'"), INVALID_REQUEST(\r
- "The input data structure is incorrect"), REQUEST_TIMED_OUT(\r
- "Request timed out."), UNEXPECTED_EXCEPTION(\r
- "Unexpected exception encountered during processing. Please contact support : {0}"), AUTHORIZATION_FAILED(\r
- "Authorization Failed"), UNDEFINED_DOMAIN_DATA_ATTRIBUTE(\r
- "Domain data attribute not defined domain={0} name={1} value={2}"), UNDEFINED_FILTER_ATTRIBUTE(\r
- "Undefined filter attribute {0}"), INVALID_DATE_FILTER(\r
- "Invalid date filter provided {0}=(1}"), OPTIMIZER_QUARTZ_JOB(\r
- "Quartz scheduling of OptimizerQuartzJob: {0}"), OPTIMIZER_EXCEPTION(\r
- "Exception making client call to optimizer {0}"), OPTIMIZER_CALLBACK_STATE_ERROR(\r
- "Optimizer callback on schedule in invalid state. Should be {0} but was {1}."), CHANGE_MANAGEMENT_GROUP_NOT_FOUND(\r
- "ChangeManagementGroup not found on optimizer callback scheduleId={0} groupId={1}"), UNABLE_TO_ALLOCATE_VNF_TIMESLOTS(\r
- "Unable to allocate VNF timeslots with Optimizer results startTime={0}, latestStartTime={1}, totalDuration={2}, concurrency={3} nvfs={4}"), UNABLE_TO_LOCATE_SCHEDULE_DETAIL(\r
- "Unable to locate ChangeManagementSchedule for VNF. scheduleId={0}, groupId={1}, vnfName={2}"), CM_JOB(\r
- "Quartz scheduling of CmJob: {0}"), CM_QUARTZ_JOB(\r
- "Quartz scheduling of CmQuartzJob: {0}"), NOT_PENDING_APPROVAL(\r
- "Approval request received for schedule that is not in Pending Approval state: domain={0} scheduleId={1} state={3}"), SCHEDULE_PAST_DUE(\r
- "Attempt to dispatch an event that is Past due scheduleId={0}, vnf={1}, now={2}, startTime={3}"), MSO_POLLING_MISSING_SCHEDULE(\r
- "Attempt to poll MSO for request id {1} for missing ChangeManagementSchedule id={0}"), MSO_STATUS_JOB(\r
- "Polling MSO {0} for requestId={1} for id={2}"), UNEXPECTED_RESPONSE(\r
- "Unexpected response from {0} HTTP Status={1} : {2}"), SCHEDULE_STATUS_JOB(\r
- "Quartz scheduling of ScheduleStatusJob: {0}"), CM_TICKET_NOT_APPROVED(\r
- "Attempt to dispatch a change management event that has no TM Ticket approved. scheduleId={0} VNF Name={1} TM ChangeId={2} Status={3} Approval Status={4}"), MULTIPLE_GROUPS_NOT_SUPPORTED(\r
- "Multiple groups not supported on immediate requests"), TM_CREATE_CHANGE_RECORD(\r
- "TM Create Change Record:{0} : Schedule ID: {1}"), TM_LIST(\r
- "TM list:{0} : URL : {1}"), TM_API(\r
- "TM API Call: URL : {0}"), UNABLE_TO_CREATE_CHANGE_TICKET(\r
- "Unable to create change ticket in TM: Schedule ID: {0} : Reason : {1}"), TM_UPDATE_CHECKLIST(\r
- "TM Fetch Checklist:{0} : Schedule ID: {1} : Change Id : {2} : URL : {3}"), OPTIMIZER_REQUEST(\r
- "Optimi Request:{0} : Schedule ID: {1} : URL : {2}"), TM_CLOSE_CHANGE_RECORD(\r
- "TM Close Change Record:{0} : Schedule ID: {1} : Change Id : {2}"), UNABLE_TO_CLOSE_CHANGE_TICKET(\r
- "Unable to close change ticket in TM: Schedule ID: {0} : changeid: {1} : Reason: {2}"), CANNOT_CANCEL_IN_PROGRESS(\r
- "Cannot delete/cancel a schedule with events in progress."), UNABLE_TO_PARSE_SCHEDULING_INFO(\r
- "Cannot parse scheduling info."), UNABLE_TO_LOCATE_CHANGE_RECORD(\r
- "Unable to locate TM change record {2} to check status before displacth of {1} for schedulId={0}"), INVALID_CHANGE_WINDOW(\r
- "Change window end time {1} must be after start time {0}"), NODE_LIST_CONTAINS_EMTPY_NODE(\r
- "vnfDetails node list contains at least one empty node."), SO_API(\r
- "SO Poll Request {0}"), EXPECTED_EXCEPTION(\r
- "Expected exception encountered during processing. Make Sonar happy: {0}"), TM_UPDATE_CHANGE_RECORD(\r
- "TM Update Change Record:{0} : Schedule ID: {1} : Change Id : {2} : URL : {3}"), UNABLE_TO_UPDATE_CHANGE_TICKET(\r
- "Unable to update change ticket in TM: Schedule ID: {0} : changeid: {1} : Reason: {2}"),;\r
+public enum LogMessages implements ObservationInterface {\r
\r
- private final String defaultId;\r
- private final String defaultMessage;\r
- private final String defaultResolution;\r
- private final String defaultAction;\r
+ SEARCH_SCHEDULE_REQUEST_DETAILS("Search Schedule Request Details {0} from {1}: {2}", Status.OK, Level.INFO),\r
+ SEARCH_SCHEDULE_REQUEST("Search Schedule Request {0} from {1}: {2} : {3}", Status.OK, Level.INFO),\r
+ CREATE_SCHEDULE_REQUEST("Create Schedule Request {0} from {1}: {2} : {3}", Status.OK, Level.INFO),\r
+ DELETE_SCHEDULE_REQUEST("Delete Schedule Request {0} from {1}: {2} : {3}", Status.OK, Level.INFO),\r
+ GET_SCHEDULE_REQUEST_INFO("Get Schedule Request Info {0} from {1}: {2} : {3}", Status.OK, Level.INFO),\r
+ PROCESS_OPTIMIZER_CALLBACK("Change management optimizer callback {0} from {1}: {2} ", Status.OK, Level.INFO),\r
+ APPROVE_SCHEDULE_REQUEST("Approve Schedule Request {0} from {1}: {2} : {3}", Status.OK, Level.INFO),\r
+ SCHEDULE_ALREADY_EXISTS("Schedule already exists domain={0} schedule id={1}", Status.OK, Level.INFO),\r
+ SCHEDULE_NOT_FOUND("Schedule not found domain={0} schedule id={1}", Status.BAD_REQUEST, Level.INFO),\r
+ INVALID_ATTRIBUTE("Invalid attribute {0}={1}", Status.BAD_REQUEST, Level.INFO),\r
+ MISSING_REQUIRED_ATTRIBUTE("Missing required attribute '{0}'", Status.BAD_REQUEST, Level.INFO),\r
+ INVALID_REQUEST("The input data structure is incorrect", Status.BAD_REQUEST, Level.INFO),\r
+ REQUEST_TIMED_OUT("Request timed out.", Status.INTERNAL_SERVER_ERROR, Level.ERROR),\r
+ UNEXPECTED_EXCEPTION("Unexpected exception encountered during processing. Please contact support : {0}", Status.INTERNAL_SERVER_ERROR, Level.ERROR),\r
+ UNDEFINED_DOMAIN_DATA_ATTRIBUTE("Domain data attribute not defined domain={0} name={1} value={2}", Status.BAD_REQUEST, Level.INFO),\r
+ UNDEFINED_FILTER_ATTRIBUTE("Undefined filter attribute {0}", Status.BAD_REQUEST, Level.INFO),\r
+ INVALID_DATE_FILTER("Invalid date filter provided {0}=(1}", Status.BAD_REQUEST, Level.INFO),\r
+ OPTIMIZER_QUARTZ_JOB("Quartz scheduling of OptimizerQuartzJob: {0}", Status.OK, Level.INFO),\r
+ OPTIMIZER_EXCEPTION("Exception making client call to optimizer {0}", Status.INTERNAL_SERVER_ERROR, Level.ERROR),\r
+ OPTIMIZER_CALLBACK_STATE_ERROR("Optimizer callback on schedule in invalid state. Should be {0} but was {1}.", Status.INTERNAL_SERVER_ERROR, Level.ERROR),\r
+ CHANGE_MANAGEMENT_GROUP_NOT_FOUND("ChangeManagementGroup not found on optimizer callback scheduleId={0} groupId={1}", Status.NOT_FOUND, Level.INFO),\r
+ INCOMING_MESSAGE("Incoming message method={0} path={1}", Status.OK, Level.INFO, true, false),\r
+ INCOMING_MESSAGE_RESPONSE("Message response method={0} path={1} status={2}", Status.OK, Level.INFO, true, false),\r
+ OUTGOING_MESSAGE("Outgoing message method={0} path={1}", Status.OK, Level.INFO, true, false),\r
+ OUTGOING_MESSAGE_RETURNED("Outgoing message returned method={0} path={1} status={2}", Status.OK, Level.INFO, true, false),\r
\r
- private LogMessages(String message) {\r
- defaultMessage = message;\r
- this.defaultId = this.name();\r
- this.defaultResolution = "No resolution needed";\r
- this.defaultAction = "No action is required";\r
- }\r
+ // TODO: Review the status and level of the remaining enums \r
+ UNABLE_TO_ALLOCATE_VNF_TIMESLOTS("Unable to allocate VNF timeslots with Optimizer results startTime={0}, latestStartTime={1}, totalDuration={2}, concurrency={3} nvfs={4}", Status.OK, Level.INFO),\r
+ UNABLE_TO_LOCATE_SCHEDULE_DETAIL("Unable to locate ChangeManagementSchedule for VNF. scheduleId={0}, groupId={1}, vnfName={2}", Status.OK, Level.INFO),\r
+ CM_JOB("Quartz scheduling of CmJob: {0}", Status.OK, Level.INFO),\r
+ CM_QUARTZ_JOB("Quartz scheduling of CmQuartzJob: {0}", Status.OK, Level.INFO),\r
+ NOT_PENDING_APPROVAL("Approval request received for schedule that is not in Pending Approval state: domain={0} scheduleId={1} state={3}", Status.OK, Level.INFO),\r
+ SCHEDULE_PAST_DUE("Attempt to dispatch an event that is Past due scheduleId={0}, vnf={1}, now={2}, startTime={3}", Status.OK, Level.INFO),\r
+ MSO_POLLING_MISSING_SCHEDULE("Attempt to poll MSO for request id {1} for missing ChangeManagementSchedule id={0}", Status.OK, Level.INFO),\r
+ MSO_STATUS_JOB("Polling MSO {0} for requestId={1} for id={2}", Status.OK, Level.INFO),\r
+ UNEXPECTED_RESPONSE("Unexpected response from {0} HTTP Status={1} : {2}", Status.OK, Level.INFO),\r
+ SCHEDULE_STATUS_JOB("Quartz scheduling of ScheduleStatusJob: {0}", Status.OK, Level.INFO),\r
+ CM_TICKET_NOT_APPROVED("Attempt to dispatch a change management event that has no TM Ticket approved. scheduleId={0} VNF Name={1} TM ChangeId={2} Status={3} Approval Status={4}", Status.OK, Level.INFO),\r
+ MULTIPLE_GROUPS_NOT_SUPPORTED("Multiple groups not supported on immediate requests", Status.OK, Level.INFO),\r
+ TM_CREATE_CHANGE_RECORD("TM Create Change Record:{0} : Schedule ID: {1}", Status.OK, Level.INFO),\r
+ TM_LIST("TM list:{0} : URL : {1}", Status.OK, Level.INFO),\r
+ TM_API("TM API Call: URL : {0}", Status.OK, Level.INFO),\r
+ UNABLE_TO_CREATE_CHANGE_TICKET("Unable to create change ticket in TM: Schedule ID: {0} : Reason : {1}", Status.OK, Level.INFO),\r
+ TM_UPDATE_CHECKLIST("TM Fetch Checklist:{0} : Schedule ID: {1} : Change Id : {2} : URL : {3}", Status.OK, Level.INFO),\r
+ OPTIMIZER_REQUEST("Optimi Request:{0} : Schedule ID: {1} : URL : {2}", Status.OK, Level.INFO),\r
+ TM_CLOSE_CHANGE_RECORD("TM Close Change Record:{0} : Schedule ID: {1} : Change Id : {2}", Status.OK, Level.INFO),\r
+ UNABLE_TO_CLOSE_CHANGE_TICKET("Unable to close change ticket in TM: Schedule ID: {0} : changeid: {1} : Reason: {2}", Status.OK, Level.INFO),\r
+ CANNOT_CANCEL_IN_PROGRESS("Cannot delete/cancel a schedule with events in progress.", Status.OK, Level.INFO),\r
+ UNABLE_TO_PARSE_SCHEDULING_INFO("Cannot parse scheduling info.", Status.OK, Level.INFO),\r
+ UNABLE_TO_LOCATE_CHANGE_RECORD("Unable to locate TM change record {2} to check status before displacth of {1} for schedulId={0}", Status.OK, Level.INFO),\r
+ INVALID_CHANGE_WINDOW("Change window end time {1} must be after start time {0}", Status.OK, Level.INFO),\r
+ NODE_LIST_CONTAINS_EMTPY_NODE("vnfDetails node list contains at least one empty node.", Status.OK, Level.INFO),\r
+ SO_API("SO Poll Request {0}", Status.OK, Level.INFO),\r
+ EXPECTED_EXCEPTION("Expected exception encountered during processing. {0}", Status.OK, Level.INFO),\r
+ TM_UPDATE_CHANGE_RECORD("TM Update Change Record:{0} : Schedule ID: {1} : Change Id : {2} : URL : {3}", Status.OK, Level.INFO),\r
+ UNABLE_TO_UPDATE_CHANGE_TICKET("Unable to update change ticket in TM: Schedule ID: {0} : changeid: {1} : Reason: {2}", Status.OK, Level.INFO),\r
+ UNAUTHORIZED("Authorization failed.", Status.FORBIDDEN, Level.INFO),\r
+ UNAUTHENTICATED("Authentication failed.", Status.UNAUTHORIZED, Level.INFO), \r
+ UNRECOGNIZED_MSO_STATUS("Unrecognized status returned by MSO {0}", Status.INTERNAL_SERVER_ERROR, Level.ERROR),\r
+ UNABLE_TO_PARSE_MSO_RESPONSE("Unable to parse status message from MSO {0} : {1}", Status.INTERNAL_SERVER_ERROR, Level.ERROR),\r
+ ;\r
+ private final String defaultId;\r
+ private final String defaultMessage;\r
+ private final String defaultResolution;\r
+ private final String defaultAction;\r
\r
- private LogMessages(String message, String id, String resolution, String action) {\r
- defaultMessage = message;\r
- this.defaultId = id;\r
- this.defaultResolution = resolution;\r
- this.defaultAction = action;\r
- }\r
+ private final Status status;\r
+ private final Level level;\r
+ private final Boolean audit;\r
+ private final Boolean metric;\r
\r
- static {\r
- EELFResourceManager.loadMessageBundle("logmessages");\r
- }\r
+ \r
+ private LogMessages(String message, Status code, Level l)\r
+ {\r
+ defaultMessage = message;\r
+ level=l;\r
+ status = code;\r
+ this.defaultId = this.name();\r
+ this.defaultResolution = "No resolution needed";\r
+ this.defaultAction = "No action is required";\r
+ this.audit = false;\r
+ this.metric = false;\r
+ }\r
\r
- public String genProperties() {\r
- // Use this to regenerate properties file. The desire to change messages without\r
- // updating code is\r
- // well understood, but the developer should be able to code the defaults\r
- // without having to update 2 different files and\r
- // get it wrong.\r
- StringBuilder sb = new StringBuilder();\r
- sb.append("# Generated from ").append(this.getClass().getName()).append("\n");\r
- for (LogMessages lm : values()) {\r
- sb.append(lm.name());\r
- sb.append(" ").append(lm.defaultId);\r
- sb.append("|").append(lm.defaultMessage);\r
- sb.append("|").append(lm.defaultResolution);\r
- sb.append("|").append(lm.defaultAction);\r
- sb.append("\n");\r
- }\r
- return sb.toString();\r
- }\r
+ private LogMessages(String message, Status code, Level l, Boolean audit, Boolean metric)\r
+ {\r
+ defaultMessage = message;\r
+ level=l;\r
+ status = code;\r
+ this.audit = audit;\r
+ this.metric = metric;\r
+ this.defaultId = this.name();\r
+ this.defaultResolution = "No resolution needed";\r
+ this.defaultAction = "No action is required";\r
+ }\r
+ \r
+ private LogMessages(String message, Status code, Level l, String id, String resolution, String action)\r
+ {\r
+ level=l;\r
+ status = code;\r
+ defaultMessage = message;\r
+ this.defaultId = id;\r
+ this.defaultResolution = resolution;\r
+ this.defaultAction = action;\r
+ this.audit = false;\r
+ this.metric = false;\r
+ }\r
+ \r
+ static {\r
+ EELFResourceManager.loadMessageBundle("logmessages");\r
+ }\r
+ \r
+ public String genProperties()\r
+ {\r
+ // Use this to regenerate properties file. The desire to change messages without updating code is\r
+ // well understood, but the developer should be able to code the defaults without having to update 2 different files and \r
+ // get it wrong. \r
+ StringBuilder sb = new StringBuilder();\r
+ sb.append("# Generated from ").append(this.getClass().getName()).append("\n");\r
+ for (LogMessages lm : values())\r
+ {\r
+ sb.append(lm.name());\r
+ sb.append(" ").append(lm.defaultId);\r
+ sb.append("|").append(lm.defaultMessage);\r
+ sb.append("|").append(lm.defaultResolution);\r
+ sb.append("|").append(lm.defaultAction);\r
+ sb.append("\n");\r
+ }\r
+ return sb.toString();\r
+ }\r
\r
- public static void main(String argv[]) {\r
- System.out.println(LogMessages.CREATE_SCHEDULE_REQUEST.genProperties());\r
- try {\r
- Files.write(Paths.get("src/main/resources/logmessages.properties"),\r
- LogMessages.CREATE_SCHEDULE_REQUEST.genProperties().getBytes());\r
- } catch (IOException e) {\r
- EELFManager.getInstance().getDebugLogger().debug("Failed to update properties file.", e);\r
+ \r
+ // interface methods\r
+ @Override\r
+ public Level getLevel() {return level;}\r
+ @Override\r
+ public String getMessage() {return defaultMessage;}\r
+ @Override\r
+ public Status getStatus() {return status;}\r
+ @Override\r
+ public Enum<?> getValue() {return this;}\r
+ @Override\r
+ public String getDomain() {return this.getClass().getSimpleName();}\r
+ @Override\r
+ public Boolean getAudit() { return audit; }\r
+ @Override\r
+ public Boolean getMetric() { return metric; }\r
+ \r
+ public static void main(String argv[])\r
+ {\r
+ System.out.println(LogMessages.UNEXPECTED_EXCEPTION.genProperties());\r
+ try \r
+ {\r
+ Files.write(Paths.get("src/main/resources/logmessages.properties"), LogMessages.UNEXPECTED_EXCEPTION.genProperties().getBytes());\r
+ } \r
+ catch (IOException e) \r
+ {\r
+ EELFManager.getInstance().getDebugLogger().debug("Failed to update properties file.", e);\r
\r
- }\r
+ }\r
+ StringBuilder sb = new StringBuilder();\r
+ sb.append("<html><body><h1>Cell Site Selection Scheduler mS Observations</h1>\n<table border=\"1\">\n<tr>");\r
+ sb.append("<td>Code</td> ");\r
+ sb.append("<td>Log Level</td> ");\r
+ sb.append("<td>Message</td> ");\r
+ sb.append("</tr>\n");\r
+ for (LogMessages m : LogMessages.values())\r
+ {\r
+ if (m.level == Level.ERROR || m.level == Level.WARN || m.level == Level.FATAL)\r
+ {\r
+ sb.append("<tr>");\r
+ sb.append("<td>").append(m.name()).append("</td> ");\r
+ sb.append("<td>").append(m.level).append("</td> ");\r
+ sb.append("<td>").append(m.defaultMessage).append("</td> ");\r
+ sb.append("</tr>\n");\r
+ }\r
+ }\r
+ try \r
+ {\r
+ Files.write(Paths.get("logmessages.html"), sb.toString().getBytes());\r
+ } \r
+ catch (IOException e) \r
+ {\r
+ EELFManager.getInstance().getDebugLogger().debug("Failed to update properties html file.", e);\r
\r
- }\r
+ }\r
+ \r
+ }\r
\r
}\r
/*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright © 2018 IBM.\r
+ * Copyright © 2017-2019 AT&T Intellectual Property.\r
+ * Modifications Copyright © 2018 IBM.\r
* \r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
package org.onap.optf.cmso.dispatcher;\r
\r
import java.util.Map;\r
+\r
import javax.ws.rs.client.Client;\r
import javax.ws.rs.client.ClientBuilder;\r
import javax.ws.rs.client.Invocation;\r
import javax.ws.rs.client.WebTarget;\r
import javax.ws.rs.core.MediaType;\r
import javax.ws.rs.core.Response;\r
+\r
+import org.onap.observations.Mdc;\r
import org.onap.optf.cmso.common.BasicAuthenticatorFilter;\r
import org.onap.optf.cmso.common.LogMessages;\r
-import org.onap.optf.cmso.common.Mdc;\r
import org.onap.optf.cmso.common.PropertiesManagement;\r
import org.onap.optf.cmso.eventq.DispatchedEventList;\r
+import org.onap.optf.cmso.filters.CMSOClientFilters;\r
import org.onap.optf.cmso.model.dao.ChangeManagementGroupDAO;\r
import org.onap.optf.cmso.model.dao.ChangeManagementScheduleDAO;\r
import org.onap.optf.cmso.model.dao.ScheduleDAO;\r
import org.springframework.beans.factory.annotation.Autowired;\r
import org.springframework.core.env.Environment;\r
import org.springframework.stereotype.Component;\r
+\r
import com.att.eelf.configuration.EELFLogger;\r
import com.att.eelf.configuration.EELFManager;\r
\r
String pass = pm.getProperty("mechid.pass", "");\r
Client client = ClientBuilder.newClient();\r
client.register(new BasicAuthenticatorFilter(user, pass));\r
+ client.register(new CMSOClientFilters());\r
WebTarget target = client.target(url);\r
Invocation.Builder invocationBuilder = target.request(MediaType.APPLICATION_JSON);\r
Response response = null;\r
try {\r
- Mdc.metricStart(id.toString(), url);\r
response = invocationBuilder.get();\r
- Mdc.metricEnd(response);\r
metrics.info(LogMessages.CM_JOB, id.toString());\r
switch (response.getStatus()) {\r
case 200:\r
/*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright © 2018 IBM.\r
+ * Copyright © 2017-2019 AT&T Intellectual Property.\r
+ * Modifications Copyright © 2018 IBM.\r
* \r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
\r
package org.onap.optf.cmso.dispatcher.rs;\r
\r
-import java.util.UUID;\r
import javax.servlet.http.HttpServletRequest;\r
import javax.ws.rs.core.Response;\r
import javax.ws.rs.core.UriInfo;\r
+\r
import org.onap.optf.cmso.common.LogMessages;\r
-import org.onap.optf.cmso.common.Mdc;\r
import org.onap.optf.cmso.dispatcher.DispatchJob;\r
import org.onap.optf.cmso.optimizer.CMSOptimizerClient;\r
import org.onap.optf.cmso.sostatus.MsoStatusClient;\r
import org.springframework.beans.factory.annotation.Autowired;\r
import org.springframework.stereotype.Controller;\r
import org.springframework.transaction.annotation.Transactional;\r
+\r
import com.att.eelf.configuration.EELFLogger;\r
import com.att.eelf.configuration.EELFManager;\r
\r
@Override\r
@Transactional\r
public Response dispatchSchedule(Integer id, UriInfo uri, HttpServletRequest request) {\r
- Mdc.begin(request, UUID.randomUUID().toString());\r
- log.info("dispatchVID entered {}", id);\r
+ debug.debug("dispatchSchedule entered {}" , id);\r
try {\r
dispatchJob.execute(id);\r
} catch (Exception e) {\r
debug.error(e.getMessage(), e);\r
}\r
Response response = Response.ok().build();\r
- Mdc.end(response);\r
- audit.info("dispatchVID");\r
return response;\r
}\r
\r
@Override\r
@Transactional\r
public Response dispatchOptimizer(Integer id, UriInfo uri, HttpServletRequest request) {\r
- Mdc.begin(request, UUID.randomUUID().toString());\r
- log.info("Dispatch.exec entered {}", id);\r
+ debug.debug("dispatchOptimizer entered {}", id);\r
try {\r
sniroClient.scheduleSniroOptimization(id);\r
} catch (Exception e) {\r
debug.error(e.getMessage(), e);\r
}\r
Response response = Response.ok().build();\r
- Mdc.end(response);\r
audit.info("dispatchSNIRO");\r
return response;\r
}\r
@Override\r
@Transactional\r
public Response dispatchScheduleStatus(Integer id, UriInfo uri, HttpServletRequest request) {\r
- Mdc.begin(request, UUID.randomUUID().toString());\r
- log.info("Dispatch.exec entered {}", id);\r
+ debug.debug("dispatchScheduleStatus entered {}", id);\r
try {\r
tmStatusClient.checkStatus(id);\r
} catch (Exception e) {\r
debug.error(e.getMessage(), e);\r
}\r
Response response = Response.ok().build();\r
- Mdc.end(response);\r
- audit.info("dispatchScheduleStatus");\r
return response;\r
}\r
\r
@Override\r
@Transactional\r
public Response dispatchSoStatus(Integer id, UriInfo uri, HttpServletRequest request) {\r
- Mdc.begin(request, UUID.randomUUID().toString());\r
- log.info("Dispatch.exec entered {}", id);\r
+ debug.debug("dispatchSoStatus entered {}", id);\r
try {\r
msoStatusClient.execute(id);\r
} catch (Exception e) {\r
debug.error(e.getMessage(), e);\r
}\r
Response response = Response.ok().build();\r
- Mdc.end(response);\r
- audit.info("dispatchMsoStatus");\r
return response;\r
}\r
\r
/*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright © 2018 IBM.\r
+ * Copyright © 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright © 2018 IBM.\r
* \r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
\r
package org.onap.optf.cmso.eventq;\r
\r
+import org.onap.observations.Mdc;\r
import org.onap.optf.cmso.common.LogMessages;\r
-import org.onap.optf.cmso.common.Mdc;\r
import org.onap.optf.cmso.model.dao.ChangeManagementScheduleDAO;\r
import org.quartz.DisallowConcurrentExecution;\r
import org.quartz.JobExecutionContext;\r
/*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright © 2018 IBM.\r
+ * Copyright © 2017-2019 AT&T Intellectual Property.\r
+ * Modifications Copyright © 2018 IBM.\r
* \r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
package org.onap.optf.cmso.filters;\r
\r
import static com.att.eelf.configuration.Configuration.MDC_KEY_REQUEST_ID;\r
+\r
import java.io.IOException;\r
+\r
import javax.ws.rs.client.ClientRequestContext;\r
import javax.ws.rs.client.ClientRequestFilter;\r
import javax.ws.rs.client.ClientResponseContext;\r
import javax.ws.rs.client.ClientResponseFilter;\r
import javax.ws.rs.core.MultivaluedMap;\r
+\r
+import org.onap.observations.Mdc;\r
+import org.onap.observations.Observation;\r
+import org.onap.optf.cmso.common.LogMessages;\r
import org.onap.optf.cmso.filters.MessageHeaders.HeadersEnum;\r
import org.onap.optf.cmso.service.rs.CMSOServiceImpl;\r
import org.slf4j.MDC;\r
import org.springframework.stereotype.Component;\r
+\r
import com.att.eelf.configuration.EELFLogger;\r
import com.att.eelf.configuration.EELFManager;\r
\r
\r
@Override\r
public void filter(ClientRequestContext requestContext, ClientResponseContext responseContext) throws IOException {\r
- // On the way back\r
- log.info("SchedulerClientFilters.filter(r,r)");\r
+ // On the way back\r
+ Mdc.metricEnd(responseContext);\r
+ Mdc.setCaller(17);\r
+ Observation.report(LogMessages.OUTGOING_MESSAGE_RETURNED, \r
+ requestContext.getMethod(),\r
+ requestContext.getUri().getPath().toString(),\r
+ responseContext.getStatusInfo().toString());\r
}\r
\r
@Override\r
public void filter(ClientRequestContext requestContext) throws IOException {\r
- // On the way out\r
- log.info("SchedulerClientFilters.filter(r)" + requestContext.getUri().getPath());\r
+ // On the way out \r
+ Mdc.metricStart(requestContext);\r
+ Mdc.setCaller(17);\r
+ Observation.report(LogMessages.OUTGOING_MESSAGE, \r
+ requestContext.getMethod(),\r
+ requestContext.getUri().getPath().toString());\r
MultivaluedMap<String, Object> headers = requestContext.getHeaders();\r
\r
String transactionId = (String) headers.getFirst(MessageHeaders.HeadersEnum.TransactionID.toString());\r
/*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright © 2018 IBM.\r
+ * Copyright © 2017-2019 AT&T Intellectual Property.\r
+ * Modifications Copyright © 2018 IBM.\r
* \r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
\r
import java.io.IOException;\r
import java.util.UUID;\r
+\r
import javax.annotation.Priority;\r
+import javax.servlet.http.HttpServletRequest;\r
import javax.ws.rs.WebApplicationException;\r
import javax.ws.rs.container.ContainerRequestContext;\r
import javax.ws.rs.container.ContainerRequestFilter;\r
import javax.ws.rs.container.ContainerResponseContext;\r
import javax.ws.rs.container.ContainerResponseFilter;\r
+import javax.ws.rs.core.Context;\r
import javax.ws.rs.core.MultivaluedMap;\r
import javax.ws.rs.core.Response;\r
import javax.ws.rs.core.Response.ResponseBuilder;\r
import javax.ws.rs.ext.Provider;\r
+\r
+import org.onap.observations.Mdc;\r
+import org.onap.observations.Observation;\r
import org.onap.optf.cmso.common.LogMessages;\r
import org.onap.optf.cmso.filters.MessageHeaders.HeadersEnum;\r
-import org.onap.optf.cmso.service.rs.CMSOServiceImpl;\r
import org.springframework.stereotype.Component;\r
-import com.att.eelf.configuration.EELFLogger;\r
-import com.att.eelf.configuration.EELFManager;\r
\r
@Priority(1)\r
@Provider\r
@Component\r
public class CMSOContainerFilters implements ContainerRequestFilter, ContainerResponseFilter {\r
- private static EELFLogger log = EELFManager.getInstance().getLogger(CMSOServiceImpl.class);\r
+\r
+\r
+ @Context\r
+ private HttpServletRequest servletRequest;\r
\r
@Override\r
public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext)\r
throws IOException {\r
try {\r
- log.info("SchedulerContainerFilters.filter(r,r)");\r
+ Mdc.auditEnd(requestContext, responseContext);\r
+ Observation.report(LogMessages.INCOMING_MESSAGE_RESPONSE, \r
+ requestContext.getMethod(),\r
+ requestContext.getUriInfo().getPath().toString(),\r
+ responseContext.getStatusInfo().toString());\r
MultivaluedMap<String, String> reqHeaders = requestContext.getHeaders();\r
MultivaluedMap<String, Object> respHeaders = responseContext.getHeaders();\r
String minorVersion = (String) reqHeaders.getFirst(HeadersEnum.MinorVersion.toString());\r
\r
} catch (Exception e) {\r
if (e instanceof WebApplicationException) {\r
- log.info(LogMessages.EXPECTED_EXCEPTION, e.getMessage());\r
+ Observation.report(LogMessages.EXPECTED_EXCEPTION, e.getMessage());\r
} else {\r
- log.info(LogMessages.UNEXPECTED_EXCEPTION, e.getMessage());\r
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e.getMessage());\r
}\r
}\r
}\r
public void filter(ContainerRequestContext requestContext) throws IOException {\r
try {\r
// On the way in\r
- log.info("SchedulerContainerFilters.filter(r) path={} ", requestContext.getUriInfo().getPath().toString());\r
+ Mdc.auditStart(requestContext, servletRequest);\r
+ Observation.report(LogMessages.INCOMING_MESSAGE, \r
+ requestContext.getMethod(),\r
+ requestContext.getUriInfo().getPath().toString());\r
\r
String majorVersion = requestContext.getUriInfo().getPath();\r
if (majorVersion != null) {\r
}\r
} catch (Exception e) {\r
if (e instanceof WebApplicationException) {\r
- log.info(LogMessages.EXPECTED_EXCEPTION, e.getMessage());\r
+ Observation.report(LogMessages.EXPECTED_EXCEPTION, e.getMessage());\r
throw e;\r
} else {\r
- log.info(LogMessages.UNEXPECTED_EXCEPTION, e.getMessage());\r
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e.getMessage());\r
}\r
}\r
\r
/*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright © 2018 IBM.\r
+ * Copyright © 2017-2019 AT&T Intellectual Property.\r
+ * Modifications Copyright © 2018 IBM.\r
* \r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
import java.util.List;\r
import java.util.Map;\r
import java.util.UUID;\r
+\r
import javax.ws.rs.ProcessingException;\r
import javax.ws.rs.client.Client;\r
import javax.ws.rs.client.ClientBuilder;\r
import javax.ws.rs.client.WebTarget;\r
import javax.ws.rs.core.MediaType;\r
import javax.ws.rs.core.Response;\r
+\r
+import org.onap.observations.Mdc;\r
+import org.onap.observations.Observation;\r
import org.onap.optf.cmso.common.BasicAuthenticatorFilter;\r
import org.onap.optf.cmso.common.CMSStatusEnum;\r
import org.onap.optf.cmso.common.LogMessages;\r
-import org.onap.optf.cmso.common.Mdc;\r
import org.onap.optf.cmso.common.PropertiesManagement;\r
import org.onap.optf.cmso.filters.CMSOClientFilters;\r
import org.onap.optf.cmso.model.Schedule;\r
import org.springframework.core.env.Environment;\r
import org.springframework.stereotype.Component;\r
import org.springframework.transaction.annotation.Transactional;\r
+\r
import com.att.eelf.configuration.EELFLogger;\r
import com.att.eelf.configuration.EELFManager;\r
import com.fasterxml.jackson.databind.ObjectMapper;\r
\r
@Component\r
public class CMSOptimizerClient {\r
- private static EELFLogger log = EELFManager.getInstance().getLogger(CMSOptimizerClient.class);\r
- private static EELFLogger metrics = EELFManager.getInstance().getMetricsLogger();\r
- private static EELFLogger errors = EELFManager.getInstance().getErrorLogger();\r
private static EELFLogger debug = EELFManager.getInstance().getDebugLogger();\r
\r
@Autowired\r
}\r
buildRequest(cmReq, info, schedule, snirocallbackurl);\r
} catch (Exception e) {\r
- errors.error(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
schedule.setStatus(CMSStatusEnum.OptimizationFailed.toString());\r
schedule.setOptimizerMessage("Unexpected exception: " + e.getMessage());\r
updateScheduleStatus(schedule);\r
updateScheduleStatus(schedule);\r
debug.debug("SNIRO url / user: " + snirourl + " / " + username);\r
debug.debug("SNIRO Request: " + new ObjectMapper().writeValueAsString(cmReq));\r
- log.info(LogMessages.OPTIMIZER_REQUEST, "Begin", schedule.getScheduleId(), snirourl);\r
- Mdc.metricStart(schedule.getScheduleId(), snirourl);\r
+ Observation.report(LogMessages.OPTIMIZER_REQUEST, "Begin", schedule.getScheduleId(), snirourl);\r
Response response = invocationBuilder.post(Entity.json(cmReq));\r
-\r
- Mdc.metricEnd(response);\r
- metrics.info(LogMessages.OPTIMIZER_REQUEST, "End", schedule.getScheduleId(), snirourl);\r
- log.info(LogMessages.OPTIMIZER_REQUEST, "End", schedule.getScheduleId(), snirourl);\r
+ Observation.report(LogMessages.OPTIMIZER_REQUEST, "End", schedule.getScheduleId(), snirourl);\r
switch (response.getStatus()) {\r
case 202:\r
debug.debug("Successfully scheduled optimization: " + schedule.getScheduleId());\r
tries++;\r
schedule.setOptimizerAttemptsToSchedule(tries);\r
updateScheduleStatus(schedule);\r
- errors.error(LogMessages.OPTIMIZER_EXCEPTION, message);\r
+ Observation.report(LogMessages.OPTIMIZER_EXCEPTION, message);\r
return true;\r
}\r
\r
updateScheduleStatus(schedule);\r
/// Got processing error response\r
// may be transient, wait for next cycle.\r
- errors.error(LogMessages.OPTIMIZER_EXCEPTION, message);\r
+ Observation.report(LogMessages.OPTIMIZER_EXCEPTION, message);\r
// Wait until next cycle and try again.\r
return false;\r
}\r
updateScheduleStatus(schedule);\r
// Getting invalid response from SNIRO.\r
// May be data related.\r
- errors.error(LogMessages.OPTIMIZER_EXCEPTION, e, e.getMessage());\r
+ Observation.report(LogMessages.OPTIMIZER_EXCEPTION, e, e.getMessage());\r
return false;\r
\r
} catch (ProcessingException e) {\r
schedule.setStatus(CMSStatusEnum.PendingSchedule.toString());\r
updateScheduleStatus(schedule);\r
/// Cannot connect to SNIRO\r
- errors.error(LogMessages.OPTIMIZER_EXCEPTION, e, e.getMessage());\r
+ Observation.report(LogMessages.OPTIMIZER_EXCEPTION, e, e.getMessage());\r
// Wait until next cycle\r
return false;\r
}\r
} catch (Exception e) {\r
- errors.error(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
\r
} finally {\r
Mdc.restore(mdcSave);\r
// We may have an issue when upgrading....\r
// Perhaps We create ChangeManagementSchedulingInfoV1, ...V2, etc.\r
// ANd try them one after another....\r
- errors.error(LogMessages.UNEXPECTED_EXCEPTION, e, "Unable to parse message. Format changed?");\r
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, "Unable to parse message. Format changed?");\r
schedule.setOptimizerStatus("Failed to parse SNIRO request");\r
schedule.setOptimizerDateTimeMillis(System.currentTimeMillis());\r
schedule.setStatus(CMSStatusEnum.OptimizationFailed.toString());\r
\r
Client client = ClientBuilder.newClient();\r
client.register(new BasicAuthenticatorFilter(username, password));\r
+ client.register(new CMSOClientFilters());\r
+\r
WebTarget sniroTarget = client.target(snirourl);\r
Invocation.Builder invocationBuilder = sniroTarget.request(MediaType.APPLICATION_JSON);\r
debug.debug("SNIRO url / user: " + snirourl + " / " + username);\r
- log.info(LogMessages.OPTIMIZER_REQUEST, "Begin", "healthcheck", snirourl);\r
- Mdc.metricStart("healthcjeck", snirourl);\r
+ Observation.report(LogMessages.OPTIMIZER_REQUEST, "Begin", "healthcheck", snirourl);\r
Response response = invocationBuilder.post(Entity.json(cmReq));\r
- Mdc.metricEnd(response);\r
- metrics.info(LogMessages.OPTIMIZER_REQUEST, "End", "healthcheck", snirourl);\r
- log.info(LogMessages.OPTIMIZER_REQUEST, "End", "healthcheck", snirourl);\r
+ Observation.report(LogMessages.OPTIMIZER_REQUEST, "End", "healthcheck", snirourl);\r
String message = response.getStatus() + ":" + response.readEntity(String.class);\r
switch (response.getStatus()) {\r
case 202:\r
break;\r
}\r
} catch (Exception e) {\r
- errors.error(LogMessages.UNEXPECTED_EXCEPTION, e.toString());\r
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e.toString());\r
hcc.setStatus(e.toString());\r
} finally {\r
Mdc.restore(mdcSave);\r
/*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright © 2018 IBM.\r
+ * Copyright © 2017-2019 AT&T Intellectual Property.\r
+ * Modifications Copyright © 2018 IBM.\r
* \r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
import javax.ws.rs.client.WebTarget;\r
import javax.ws.rs.core.MediaType;\r
import javax.ws.rs.core.Response;\r
+\r
+import org.onap.observations.Mdc;\r
import org.onap.optf.cmso.common.BasicAuthenticatorFilter;\r
import org.onap.optf.cmso.common.CMSStatusEnum;\r
import org.onap.optf.cmso.common.DomainsEnum;\r
import org.onap.optf.cmso.common.LogMessages;\r
-import org.onap.optf.cmso.common.Mdc;\r
import org.onap.optf.cmso.common.PropertiesManagement;\r
+import org.onap.optf.cmso.filters.CMSOClientFilters;\r
import org.onap.optf.cmso.model.Schedule;\r
import org.onap.optf.cmso.model.dao.ScheduleDAO;\r
import org.quartz.DisallowConcurrentExecution;\r
String pass = pm.getProperty("mechid.pass", "");\r
Client client = ClientBuilder.newClient();\r
client.register(new BasicAuthenticatorFilter(user, pass));\r
+ client.register(new CMSOClientFilters());\r
WebTarget target = client.target(url);\r
Invocation.Builder invocationBuilder = target.request(MediaType.APPLICATION_JSON);\r
Response response = null;\r
- Mdc.metricStart(id.toString(), url);\r
response = invocationBuilder.get();\r
- Mdc.metricEnd(response);\r
- metrics.info(LogMessages.OPTIMIZER_QUARTZ_JOB, id.toString());\r
switch (response.getStatus()) {\r
case 200:\r
log.info("Returned from dispatch call");\r
/*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright © 2018 IBM.\r
+ * Copyright © 2017-2019 AT&T Intellectual Property.\r
+ * Modifications Copyright © 2018 IBM.\r
* \r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
import javax.servlet.http.HttpServletRequest;\r
import javax.ws.rs.core.Response;\r
import javax.ws.rs.core.UriInfo;\r
-import org.onap.optf.cmso.common.Mdc;\r
+\r
+import org.onap.observations.Mdc;\r
import org.onap.optf.cmso.common.PropertiesManagement;\r
import org.springframework.beans.factory.annotation.Autowired;\r
import org.springframework.stereotype.Controller;\r
\r
@Override\r
public Response exec(String apiVersion, String id, UriInfo uri, HttpServletRequest request) {\r
- Mdc.begin(request, UUID.randomUUID().toString());\r
log.info("AdminTool.exec entered");\r
if (id.length() < 4)\r
return Response.ok("").build();\r
String encrypted = pm.getEncryptedValue(id);\r
Response response = Response.ok(encrypted).build();\r
- Mdc.end(response);\r
- audit.info("AdminTool");\r
return response;\r
}\r
\r
/*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright © 2018 IBM.\r
+ * Copyright © 2017-2019 AT&T Intellectual Property.\r
+ * Modifications Copyright © 2018 IBM.\r
* \r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
import org.joda.time.DateTime;\r
import org.joda.time.format.DateTimeFormat;\r
import org.joda.time.format.ISODateTimeFormat;\r
+import org.onap.observations.Mdc;\r
import org.onap.optf.cmso.common.CMSStatusEnum;\r
import org.onap.optf.cmso.common.DomainsEnum;\r
import org.onap.optf.cmso.common.LogMessages;\r
-import org.onap.optf.cmso.common.Mdc;\r
import org.onap.optf.cmso.common.exceptions.CMSException;\r
import org.onap.optf.cmso.common.exceptions.CMSNotFoundException;\r
import org.onap.optf.cmso.model.ChangeManagementGroup;\r
public Response sniroCallback(String apiVersion, CMOptimizerResponse sniroResponse, UriInfo uri,\r
HttpServletRequest request) {\r
Response response = null;\r
- Mdc.begin(request, sniroResponse.getTransactionId());\r
log.info(LogMessages.PROCESS_OPTIMIZER_CALLBACK, "Received", request.getRemoteAddr(), "");\r
log.info(LogMessages.OPTIMIZER_REQUEST, "Callback received", sniroResponse.getTransactionId(),\r
uri.getAbsolutePath().toString());\r
response = Response.serverError().entity(e.getMessage()).build();\r
} finally {\r
}\r
- Mdc.end(response);\r
- log.info(LogMessages.OPTIMIZER_REQUEST, "Callback completed", sniroResponse.getTransactionId(),\r
- uri.getAbsolutePath().toString());\r
- audit.info(LogMessages.PROCESS_OPTIMIZER_CALLBACK, "Returned", request.getRemoteAddr(),\r
- response.getStatusInfo().toString());\r
- metrics.info(LogMessages.PROCESS_OPTIMIZER_CALLBACK, "Returned", request.getRemoteAddr(),\r
- response.getStatusInfo().toString());\r
return response;\r
}\r
\r
/*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright © 2018 IBM.\r
+ * Copyright © 2017-2019 AT&T Intellectual Property.\r
+ * Modifications Copyright © 2018 IBM.\r
* \r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
import java.util.Map;\r
import java.util.Set;\r
import java.util.TimeZone;\r
-import java.util.UUID;\r
+\r
import javax.servlet.http.HttpServletRequest;\r
import javax.ws.rs.core.MultivaluedMap;\r
import javax.ws.rs.core.Response;\r
import javax.ws.rs.core.Response.Status;\r
import javax.ws.rs.core.UriInfo;\r
+\r
import org.joda.time.DateTime;\r
+import org.onap.observations.Observation;\r
import org.onap.optf.cmso.common.ApprovalStatusEnum;\r
import org.onap.optf.cmso.common.ApprovalTypesEnum;\r
import org.onap.optf.cmso.common.CMSStatusEnum;\r
import org.onap.optf.cmso.common.DomainsEnum;\r
import org.onap.optf.cmso.common.LogMessages;\r
-import org.onap.optf.cmso.common.Mdc;\r
import org.onap.optf.cmso.common.exceptions.CMSException;\r
import org.onap.optf.cmso.common.exceptions.CMSNotFoundException;\r
import org.onap.optf.cmso.eventq.CMSQueueJob;\r
import org.springframework.stereotype.Controller;\r
import org.springframework.transaction.annotation.Transactional;\r
import org.springframework.transaction.interceptor.TransactionAspectSupport;\r
+\r
import com.att.eelf.configuration.EELFLogger;\r
import com.att.eelf.configuration.EELFManager;\r
\r
@Controller\r
public class CMSOServiceImpl extends BaseSchedulerServiceImpl implements CMSOService {\r
- private static EELFLogger log = EELFManager.getInstance().getLogger(CMSOServiceImpl.class);\r
- private static EELFLogger metrics = EELFManager.getInstance().getMetricsLogger();\r
- private static EELFLogger audit = EELFManager.getInstance().getAuditLogger();\r
- private static EELFLogger errors = EELFManager.getInstance().getErrorLogger();\r
private static EELFLogger debug = EELFManager.getInstance().getDebugLogger();\r
\r
@Autowired\r
String scheduleName, String userId, String status, String createDateTime, String optimizerStatus,\r
String workflowName, UriInfo uri, HttpServletRequest request) {\r
\r
- Mdc.begin(request, UUID.randomUUID().toString());\r
- log.info(LogMessages.SEARCH_SCHEDULE_REQUEST, "Received", request.getRemoteAddr(), uri.toString(), "");\r
+ Observation.report(LogMessages.SEARCH_SCHEDULE_REQUEST, "Received", request.getRemoteAddr(), uri.toString(), "");\r
Response response = null;\r
List<Schedule> schedules = new ArrayList<Schedule>();\r
try {\r
- log.info("Timezone=" + TimeZone.getDefault());\r
- MultivaluedMap<String, String> qp = uri.getQueryParameters();\r
+ debug.debug("Timezone={}", TimeZone.getDefault());\r
StringBuilder where = new StringBuilder();\r
int maxRows = 0;\r
+ //MultivaluedMap<String, String> qp = uri.getQueryParameters();\r
// buildWhere(qp, where);\r
List<ScheduleQuery> list = scheduleQueryDAO.searchSchedules(where.toString(), maxRows);\r
if (list == null || !list.iterator().hasNext()) {\r
}\r
response = Response.ok(schedules.toArray(new Schedule[schedules.size()])).build();\r
} catch (CMSException e) {\r
- debug.debug(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
- log.info(e.getMessage());\r
+ Observation.report(LogMessages.EXPECTED_EXCEPTION, e, e.getMessage());\r
response = Response.status(e.getStatus()).entity(e.getRequestError()).build();\r
} catch (Exception e) {\r
- errors.error(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
- debug.debug(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
response = Response.serverError().build();\r
}\r
\r
- Mdc.end(response);\r
- log.info(LogMessages.SEARCH_SCHEDULE_REQUEST, "Returned", request.getRemoteAddr(), schedules.toString(),\r
- response.getStatusInfo().toString());\r
- audit.info(LogMessages.SEARCH_SCHEDULE_REQUEST, "Returned", request.getRemoteAddr(), schedules.toString(),\r
- response.getStatusInfo().toString());\r
- metrics.info(LogMessages.SEARCH_SCHEDULE_REQUEST, "Returned", request.getRemoteAddr(), schedules.toString(),\r
+ Observation.report(LogMessages.SEARCH_SCHEDULE_REQUEST, "Returned", request.getRemoteAddr(), schedules.toString(),\r
response.getStatusInfo().toString());\r
return response;\r
}\r
@Transactional\r
public Response createScheduleRequest(String apiVersion, String scheduleId, CMSMessage scheduleMessage,\r
HttpServletRequest request) {\r
- Mdc.begin(request, scheduleId);\r
- log.info(LogMessages.CREATE_SCHEDULE_REQUEST, "Received", request.getRemoteAddr(), scheduleId,\r
+ Observation.report(LogMessages.CREATE_SCHEDULE_REQUEST, "Received", request.getRemoteAddr(), scheduleId,\r
scheduleMessage.toString());\r
Response response = null;\r
try {\r
if (immediate) {\r
createChangeManagementImmediate(schedule, scheduleMessage);\r
\r
- // *******************************************************************************************\r
- // This flush does nothing because JPA is expecting\r
- // JtaTransactionCoordinatorImpl\r
- // rather than\r
- // JdbcResourceLocalTransactionCoordinatorImpl\r
- // (it does an instance of and JdbcResourceLocalTransactionCoordinatorImpl\r
- // fails)\r
- // SO the automatic approval and creation of tickets cannot\r
- // rely retrieving the entities from the Schedule entity as the SQL has not yet\r
- // executed.\r
- // Under future flow, they can because the data is committed in a separate\r
- // transaction\r
- // Three choices\r
- // 1. Pass domainData through all of the methods. ***\r
- // 2. Re-structre the code to have @Transactionals which would break the top\r
- // level rollback strategy\r
- // 3. Debug JPA (Still worth doing, maybe some kind of goofy parameter.)\r
- TransactionAspectSupport.currentTransactionStatus().flush();\r
-\r
// Create automatic approval\r
ApprovalMessage am = new ApprovalMessage();\r
am.setApprovalStatus(ApprovalStatusEnum.Accepted);\r
}\r
response = Response.accepted().build();\r
} catch (CMSException e) {\r
- debug.debug(LogMessages.EXPECTED_EXCEPTION, e, e.getMessage());\r
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();\r
- log.info(e.getMessage());\r
+ Observation.report(LogMessages.EXPECTED_EXCEPTION, e, e.getMessage());\r
response = Response.status(e.getStatus()).entity(e.getRequestError()).build();\r
- Mdc.end(response);\r
- audit.info(LogMessages.CREATE_SCHEDULE_REQUEST, "Returned", request.getRemoteAddr(), scheduleId, "");\r
} catch (Exception e) {\r
- errors.error(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();\r
response = Response.serverError().build();\r
- Mdc.end(response);\r
- audit.info(LogMessages.CREATE_SCHEDULE_REQUEST, "Returned", request.getRemoteAddr(), scheduleId, "");\r
}\r
- Mdc.end(response);\r
- log.info(LogMessages.CREATE_SCHEDULE_REQUEST, "Returned", request.getRemoteAddr(), scheduleId,\r
- response.getStatusInfo().toString());\r
- audit.info(LogMessages.CREATE_SCHEDULE_REQUEST, "Returned", request.getRemoteAddr(), scheduleId,\r
- response.getStatusInfo().toString());\r
- metrics.info(LogMessages.CREATE_SCHEDULE_REQUEST, "Returned", request.getRemoteAddr(), scheduleId,\r
+ Observation.report(LogMessages.CREATE_SCHEDULE_REQUEST, "Returned", request.getRemoteAddr(), scheduleId,\r
response.getStatusInfo().toString());\r
return response;\r
}\r
} catch (CMSException e) {\r
throw e;\r
} catch (Exception e) {\r
- errors.error(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
throw new CMSException(Status.INTERNAL_SERVER_ERROR, LogMessages.UNEXPECTED_EXCEPTION, e.getMessage());\r
}\r
// If we got here, there are no change windows....\r
try {\r
CmDomainDataEnum.valueOf(name);\r
} catch (Exception e) {\r
- log.warn(LogMessages.UNDEFINED_DOMAIN_DATA_ATTRIBUTE, DomainsEnum.ChangeManagement.name(), name,\r
+ Observation.report(LogMessages.UNDEFINED_DOMAIN_DATA_ATTRIBUTE, DomainsEnum.ChangeManagement.name(), name,\r
value);\r
}\r
}\r
@Override\r
@Transactional\r
public Response deleteScheduleRequest(String apiVersion, String scheduleId, HttpServletRequest request) {\r
- Mdc.begin(request, scheduleId);\r
Response response = null;\r
- log.info(LogMessages.DELETE_SCHEDULE_REQUEST, "Received", request.getRemoteAddr(), scheduleId, "");\r
+ Observation.report(LogMessages.DELETE_SCHEDULE_REQUEST, "Received", request.getRemoteAddr(), scheduleId, "");\r
try {\r
Schedule schedule = scheduleDAO.findByDomainScheduleID(DomainsEnum.ChangeManagement.toString(), scheduleId);\r
if (schedule == null) {\r
response = Response.noContent().build();\r
} catch (CMSException e) {\r
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();\r
- log.info(e.getMessage());\r
+ Observation.report(LogMessages.EXPECTED_EXCEPTION, e, e.getMessage());\r
response = Response.status(e.getStatus()).entity(e.getRequestError()).build();\r
} catch (Exception e) {\r
- errors.error(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
- debug.debug(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();\r
response = Response.serverError().build();\r
}\r
- Mdc.end(response);\r
- log.info(LogMessages.DELETE_SCHEDULE_REQUEST, "Returned", request.getRemoteAddr(), scheduleId,\r
- response.getStatusInfo().toString());\r
- audit.info(LogMessages.DELETE_SCHEDULE_REQUEST, "Returned", request.getRemoteAddr(), scheduleId,\r
- response.getStatusInfo().toString());\r
- metrics.info(LogMessages.DELETE_SCHEDULE_REQUEST, "Returned", request.getRemoteAddr(), scheduleId,\r
+ Observation.report(LogMessages.DELETE_SCHEDULE_REQUEST, "Returned", request.getRemoteAddr(), scheduleId,\r
response.getStatusInfo().toString());\r
return response;\r
}\r
@Override\r
public Response getScheduleRequestInfo(String apiVersion, String scheduleId, HttpServletRequest request) {\r
Response response = null;\r
- Mdc.begin(request, scheduleId);\r
- log.info(LogMessages.GET_SCHEDULE_REQUEST_INFO, "Received", request.getRemoteAddr(), scheduleId, "");\r
+ Observation.report(LogMessages.GET_SCHEDULE_REQUEST_INFO, "Received", request.getRemoteAddr(), scheduleId, "");\r
Schedule schedule = null;\r
try {\r
schedule = scheduleDAO.findByDomainScheduleID(DomainsEnum.ChangeManagement.toString(), scheduleId);\r
}\r
response = Response.ok().entity(schedule).build();\r
} catch (CMSException e) {\r
- log.info(e.getMessage());\r
- debug.debug(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
+ Observation.report(LogMessages.EXPECTED_EXCEPTION, e, e.getMessage());\r
response = Response.status(e.getStatus()).entity(e.getRequestError()).build();\r
} catch (Exception e) {\r
- errors.error(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
- debug.debug(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
response = Response.serverError().build();\r
}\r
- Mdc.end(response);\r
- audit.info(LogMessages.GET_SCHEDULE_REQUEST_INFO, "Returned", request.getRemoteAddr(), scheduleId,\r
- response.getStatusInfo().toString());\r
- metrics.info(LogMessages.GET_SCHEDULE_REQUEST_INFO, "Returned", request.getRemoteAddr(), scheduleId,\r
- response.getStatusInfo().toString());\r
- log.info(LogMessages.GET_SCHEDULE_REQUEST_INFO, "Returned", request.getRemoteAddr(), scheduleId,\r
+ Observation.report(LogMessages.GET_SCHEDULE_REQUEST_INFO, "Returned", request.getRemoteAddr(), scheduleId,\r
response.getStatusInfo().toString());\r
return response;\r
}\r
public Response approveScheduleRequest(String apiVersion, String scheduleId, ApprovalMessage approval,\r
HttpServletRequest request) {\r
Response response = null;\r
- Mdc.begin(request, scheduleId);\r
- log.info(LogMessages.APPROVE_SCHEDULE_REQUEST, "Received", request.getRemoteAddr(), scheduleId,\r
+ Observation.report(LogMessages.APPROVE_SCHEDULE_REQUEST, "Received", request.getRemoteAddr(), scheduleId,\r
approval.toString());\r
try {\r
String domain = DomainsEnum.ChangeManagement.toString();\r
response = Response.noContent().build();\r
} catch (CMSException e) {\r
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();\r
- log.info(e.getMessage());\r
+ Observation.report(LogMessages.EXPECTED_EXCEPTION, e, e.getMessage());\r
response = Response.status(e.getStatus()).entity(e.getRequestError()).build();\r
} catch (Exception e) {\r
- errors.error(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();\r
response = Response.serverError().build();\r
}\r
- Mdc.end(response);\r
- log.info(LogMessages.APPROVE_SCHEDULE_REQUEST, "Returned", request.getRemoteAddr(), scheduleId, "");\r
- audit.info(LogMessages.APPROVE_SCHEDULE_REQUEST, "Returned", request.getRemoteAddr(), scheduleId,\r
- response.getStatusInfo().toString());\r
- metrics.info(LogMessages.APPROVE_SCHEDULE_REQUEST, "Returned", request.getRemoteAddr(), scheduleId,\r
- response.getStatusInfo().toString());\r
+ Observation.report(LogMessages.APPROVE_SCHEDULE_REQUEST, "Returned", request.getRemoteAddr(), scheduleId, "");\r
return response;\r
}\r
\r
Integer maxSchedules, String lastScheduleId, Integer concurrencyLimit, UriInfo uri,\r
HttpServletRequest request) {\r
\r
- Mdc.begin(request, UUID.randomUUID().toString());\r
Response response = null;\r
- log.info(LogMessages.SEARCH_SCHEDULE_REQUEST_DETAILS, "Received", request.getRemoteAddr(),\r
+ Observation.report(LogMessages.SEARCH_SCHEDULE_REQUEST_DETAILS, "Received", request.getRemoteAddr(),\r
uri.getRequestUri().getQuery());\r
List<CmDetailsMessage> schedules = new ArrayList<CmDetailsMessage>();\r
\r
try {\r
- log.info("Timezone=" + TimeZone.getDefault());\r
+ debug.debug("Timezone={}" , TimeZone.getDefault());\r
MultivaluedMap<String, String> qp = uri.getQueryParameters();\r
StringBuilder where = new StringBuilder();\r
int maxRows = 0;\r
}\r
response = Response.ok(schedules.toArray(new CmDetailsMessage[schedules.size()])).build();\r
} catch (CMSException e) {\r
- debug.debug(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
- log.info(e.getMessage());\r
+ Observation.report(LogMessages.EXPECTED_EXCEPTION, e, e.getMessage());\r
response = Response.status(e.getStatus()).entity(e.getRequestError()).build();\r
} catch (Exception e) {\r
- errors.error(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
- debug.debug(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
response = Response.serverError().build();\r
}\r
- Mdc.end(response);\r
- log.info(LogMessages.SEARCH_SCHEDULE_REQUEST_DETAILS, "Returned", request.getRemoteAddr(),\r
- response.getStatusInfo().toString());\r
- audit.info(LogMessages.SEARCH_SCHEDULE_REQUEST_DETAILS, "Returned", request.getRemoteAddr(),\r
- response.getStatusInfo().toString());\r
- metrics.info(LogMessages.SEARCH_SCHEDULE_REQUEST_DETAILS, "Returned", request.getRemoteAddr(),\r
+ Observation.report(LogMessages.SEARCH_SCHEDULE_REQUEST_DETAILS, "Returned", request.getRemoteAddr(),\r
response.getStatusInfo().toString());\r
return response;\r
\r
package org.onap.optf.cmso.service.rs;\r
\r
import java.util.List;\r
-import java.util.UUID;\r
+\r
import javax.servlet.http.HttpServletRequest;\r
import javax.ws.rs.core.Response;\r
import javax.ws.rs.core.UriInfo;\r
-import org.onap.optf.cmso.common.Mdc;\r
+\r
import org.onap.optf.cmso.model.ApprovalType;\r
import org.onap.optf.cmso.model.dao.ApprovalTypeDAO;\r
import org.onap.optf.cmso.optimizer.CMSOptimizerClient;\r
import org.springframework.beans.factory.annotation.Autowired;\r
import org.springframework.core.env.Environment;\r
import org.springframework.stereotype.Controller;\r
+\r
import com.att.eelf.configuration.EELFLogger;\r
import com.att.eelf.configuration.EELFManager;\r
\r
@Controller\r
public class HealthCheckImpl implements HealthCheck {\r
- private static EELFLogger log = EELFManager.getInstance().getLogger(HealthCheckImpl.class);\r
- private static EELFLogger audit = EELFManager.getInstance().getAuditLogger();\r
+ private static EELFLogger debug = EELFManager.getInstance().getDebugLogger();\r
\r
@Autowired\r
TmClient tmClient;\r
\r
@Override\r
public Response healthCheck(String apiVersion, Boolean checkInterfaces, UriInfo uri, HttpServletRequest request) {\r
- Mdc.begin(request, UUID.randomUUID().toString());\r
- log.info("Entered healthcheck");\r
+ debug.debug("Entered healthcheck");\r
Response response = null;\r
HealthCheckMessage hc = new HealthCheckMessage();\r
hc.setHealthy(true);\r
response = Response.ok().entity(hc).build();\r
else\r
response = Response.status(Response.Status.BAD_REQUEST).entity(hc).build();\r
- Mdc.end(response);\r
- audit.info("Healthcheck healthy={0}", hc.getHealthy().toString());\r
return response;\r
}\r
\r
/*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\r
+ * Copyright © 2017-2019 AT&T Intellectual Property.\r
* Modifications Copyright © 2018 IBM.\r
* \r
* Licensed under the Apache License, Version 2.0 (the "License");\r
import java.text.SimpleDateFormat;\r
import java.util.Date;\r
import java.util.Map;\r
+\r
import javax.ws.rs.ProcessingException;\r
import javax.ws.rs.client.Client;\r
import javax.ws.rs.client.ClientBuilder;\r
import javax.ws.rs.client.WebTarget;\r
import javax.ws.rs.core.MediaType;\r
import javax.ws.rs.core.Response;\r
+\r
+import org.onap.observations.Mdc;\r
+import org.onap.observations.Observation;\r
import org.onap.optf.cmso.common.BasicAuthenticatorFilter;\r
import org.onap.optf.cmso.common.CMSStatusEnum;\r
import org.onap.optf.cmso.common.LogMessages;\r
-import org.onap.optf.cmso.common.Mdc;\r
import org.onap.optf.cmso.common.PropertiesManagement;\r
import org.onap.optf.cmso.filters.CMSOClientFilters;\r
import org.onap.optf.cmso.model.ChangeManagementSchedule;\r
import org.springframework.core.env.Environment;\r
import org.springframework.stereotype.Component;\r
import org.springframework.transaction.annotation.Transactional;\r
+\r
import com.att.eelf.configuration.EELFLogger;\r
import com.att.eelf.configuration.EELFManager;\r
import com.fasterxml.jackson.databind.ObjectMapper;\r
\r
@Component\r
public class MsoStatusClient {\r
- private static EELFLogger log = EELFManager.getInstance().getLogger(MsoStatusClient.class);\r
- private static EELFLogger errors = EELFManager.getInstance().getErrorLogger();\r
private static EELFLogger debug = EELFManager.getInstance().getDebugLogger();\r
- private static EELFLogger metrics = EELFManager.getInstance().getMetricsLogger();\r
\r
@Autowired\r
ChangeManagementScheduleDAO cmScheduleDAO;\r
try {\r
ChangeManagementSchedule cmSchedule = cmScheduleDAO.lockOne(id);\r
if (cmSchedule == null) {\r
- log.warn(LogMessages.MSO_POLLING_MISSING_SCHEDULE, id.toString());\r
+ Observation.report(LogMessages.MSO_POLLING_MISSING_SCHEDULE, id.toString());\r
return;\r
}\r
poll(cmSchedule);\r
} catch (Exception e) {\r
- errors.error(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
}\r
debug.debug(LogMessages.MSO_STATUS_JOB, "Exited", id.toString());\r
}\r
Invocation.Builder invocationBuilder = target.request(MediaType.APPLICATION_JSON);\r
Response response = null;\r
cmSchedule.setMsoTimeMillis(System.currentTimeMillis());\r
- Mdc.metricStart(requestId, url);\r
response = invocationBuilder.get();\r
- Mdc.metricEnd(response);\r
- metrics.info(LogMessages.SO_API, requestId);\r
switch (response.getStatus()) {\r
case 200: {\r
String respString = response.readEntity(String.class);\r
try {\r
msoStatus = MSO_STATUS.valueOf(resp.getRequestState());\r
} catch (Exception e) {\r
- errors.error("Unregcognized status from MSO: " + resp.getRequestState());\r
+ Observation.report(LogMessages.UNRECOGNIZED_MSO_STATUS, resp.getRequestState());\r
}\r
long finishTime = getFinishTime(resp);\r
switch (msoStatus) {\r
}\r
}\r
} catch (ProcessingException e) {\r
- debug.debug(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
- errors.error(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
// Probably a transient error... Keep polling\r
cmSchedule.setMsoTimeMillis(System.currentTimeMillis());\r
cmSchedule.setMsoStatus("ConnectionException");\r
cmSchedule.setMsoMessage("Could not call MSO:" + e.getMessage());\r
} catch (Exception e) {\r
- debug.debug(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
- errors.error(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
// Probably a transient error... Keep polling\r
cmSchedule.setMsoTimeMillis(System.currentTimeMillis());\r
cmSchedule.setMsoStatus("Exception");\r
Date dateTime = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss z").parse(timestr);\r
finishTime = dateTime.getTime();\r
} catch (Exception e) {\r
- debug.debug(LogMessages.UNEXPECTED_EXCEPTION, e, "Unable to parse MSO fisnish timestamp: " + timestr);\r
- errors.error(LogMessages.UNEXPECTED_EXCEPTION, e, "Unable to parse MSO fisnish timestamp: " + timestr);\r
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, "Unable to parse MSO finish timestamp: " + timestr);\r
}\r
}\r
return finishTime;\r
om.treeToValue(requestStatus, MsoOrchestrationQueryResponse.class);\r
return msoResponse;\r
} catch (Exception e) {\r
- log.warn("Exception parsing MSO response", e);\r
- log.warn("MSO response:\n" + resp);\r
+ Observation.report(LogMessages.UNABLE_TO_PARSE_MSO_RESPONSE, e, e.getMessage(), resp);\r
}\r
return null;\r
}\r
\r
Client client = ClientBuilder.newClient();\r
client.register(new BasicAuthenticatorFilter(user, pass));\r
+ client.register(new CMSOClientFilters());\r
+\r
WebTarget target = client.target(url);\r
Invocation.Builder invocationBuilder = target.request(MediaType.APPLICATION_JSON);\r
Response response = null;\r
try {\r
- Mdc.metricStart(requestId, url);\r
response = invocationBuilder.get();\r
- Mdc.metricEnd(response);\r
- metrics.info(LogMessages.SO_API, requestId);\r
switch (response.getStatus()) {\r
case 200:\r
case 204:\r
/*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright © 2018 IBM.\r
+ * Copyright © 2017-2019 AT&T Intellectual Property.\r
+ * Modifications Copyright © 2018 IBM.\r
* \r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
\r
package org.onap.optf.cmso.sostatus;\r
\r
+import org.onap.observations.Mdc;\r
import org.onap.optf.cmso.common.LogMessages;\r
-import org.onap.optf.cmso.common.Mdc;\r
import org.onap.optf.cmso.model.ChangeManagementSchedule;\r
import org.onap.optf.cmso.model.dao.ChangeManagementScheduleDAO;\r
import org.quartz.DisallowConcurrentExecution;\r
/*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright © 2018 IBM.\r
+ * Copyright © 2017-2019 AT&T Intellectual Property.\r
+ * Modifications Copyright © 2018 IBM.\r
* \r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
\r
import java.util.List;\r
import java.util.Map;\r
+\r
import javax.ws.rs.client.Client;\r
import javax.ws.rs.client.ClientBuilder;\r
import javax.ws.rs.client.Invocation;\r
import javax.ws.rs.client.WebTarget;\r
import javax.ws.rs.core.MediaType;\r
import javax.ws.rs.core.Response;\r
+\r
+import org.onap.observations.Mdc;\r
+import org.onap.observations.Observation;\r
import org.onap.optf.cmso.common.BasicAuthenticatorFilter;\r
import org.onap.optf.cmso.common.DomainsEnum;\r
import org.onap.optf.cmso.common.LogMessages;\r
-import org.onap.optf.cmso.common.Mdc;\r
import org.onap.optf.cmso.common.PropertiesManagement;\r
+import org.onap.optf.cmso.filters.CMSOClientFilters;\r
import org.onap.optf.cmso.model.ChangeManagementSchedule;\r
import org.onap.optf.cmso.model.Schedule;\r
import org.onap.optf.cmso.model.dao.ChangeManagementScheduleDAO;\r
import org.springframework.beans.factory.annotation.Autowired;\r
import org.springframework.core.env.Environment;\r
import org.springframework.stereotype.Component;\r
+\r
import com.att.eelf.configuration.EELFLogger;\r
import com.att.eelf.configuration.EELFManager;\r
\r
@Component\r
@DisallowConcurrentExecution\r
public class ScheduleStatusJob implements Job {\r
- private static EELFLogger log = EELFManager.getInstance().getLogger(ScheduleStatusJob.class);\r
- private static EELFLogger errors = EELFManager.getInstance().getErrorLogger();\r
private static EELFLogger debug = EELFManager.getInstance().getDebugLogger();\r
- private static EELFLogger metrics = EELFManager.getInstance().getMetricsLogger();\r
\r
@Autowired\r
ScheduleDAO scheduleDAO;\r
dispatchMso(s.getId());\r
}\r
} catch (Exception e) {\r
- errors.error(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
}\r
try {\r
\r
dispatchScheduleStatusChecker(s.getId());\r
}\r
} catch (Exception e) {\r
- errors.error(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
}\r
debug.debug(LogMessages.SCHEDULE_STATUS_JOB, "Exited");\r
}\r
String pass = pm.getProperty("mechid.pass", "");\r
Client client = ClientBuilder.newClient();\r
client.register(new BasicAuthenticatorFilter(user, pass));\r
+ client.register(CMSOClientFilters.class);\r
WebTarget target = client.target(url);\r
Invocation.Builder invocationBuilder = target.request(MediaType.APPLICATION_JSON);\r
Response response = null;\r
try {\r
- Mdc.metricStart(id.toString(), url);\r
response = invocationBuilder.get();\r
- Mdc.metricEnd(response);\r
- metrics.info(LogMessages.SCHEDULE_STATUS_JOB, id.toString());\r
switch (response.getStatus()) {\r
case 200:\r
- log.info("Returned from dispatch call");\r
+ debug.debug("Returned from dispatch call");\r
break;\r
case 400: // Bad request\r
default: {\r
}\r
}\r
} catch (Exception e) {\r
- debug.debug(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
- errors.error(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
}\r
} catch (Exception e) {\r
- debug.debug(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
- errors.error(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
} finally {\r
Mdc.restore(mdcSave);\r
}\r
String pass = pm.getProperty("mechid.pass", "");\r
Client client = ClientBuilder.newClient();\r
client.register(new BasicAuthenticatorFilter(user, pass));\r
+ client.register(CMSOClientFilters.class);\r
WebTarget target = client.target(url);\r
Invocation.Builder invocationBuilder = target.request(MediaType.APPLICATION_JSON);\r
Response response = null;\r
try {\r
- Mdc.metricStart(id.toString(), url);\r
response = invocationBuilder.get();\r
- Mdc.metricEnd(response);\r
- metrics.info(LogMessages.SCHEDULE_STATUS_JOB, id.toString());\r
switch (response.getStatus()) {\r
case 200:\r
- log.info("Returned from dispatch call");\r
+ debug.debug("Returned from dispatch call");\r
break;\r
case 400: // Bad request\r
default: {\r
}\r
}\r
} catch (Exception e) {\r
- debug.debug(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
- errors.error(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
}\r
} catch (Exception e) {\r
- debug.debug(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
- errors.error(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
} finally {\r
Mdc.restore(mdcSave);\r
}\r
/*\r
- * Copyright © 2017-2018 AT&T Intellectual Property.\r
- * Modifications Copyright © 2018 IBM.\r
+ * Copyright © 2017-2018 AT&T Intellectual Property.\r
+ * Modifications Copyright © 2018 IBM.\r
* \r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
import java.util.List;\r
import java.util.Map;\r
import java.util.UUID;\r
+\r
import javax.ws.rs.ProcessingException;\r
import javax.ws.rs.client.Client;\r
import javax.ws.rs.client.ClientBuilder;\r
import javax.ws.rs.core.MediaType;\r
import javax.ws.rs.core.Response;\r
import javax.ws.rs.core.Response.Status;\r
-import org.apache.commons.lang3.text.StrSubstitutor;\r
+\r
+import org.apache.commons.text.StringSubstitutor;\r
import org.joda.time.format.ISODateTimeFormat;\r
+import org.onap.observations.Mdc;\r
+import org.onap.observations.Observation;\r
import org.onap.optf.cmso.common.BasicAuthenticatorFilter;\r
import org.onap.optf.cmso.common.CmHelpers;\r
import org.onap.optf.cmso.common.LogMessages;\r
-import org.onap.optf.cmso.common.Mdc;\r
import org.onap.optf.cmso.common.PropertiesManagement;\r
import org.onap.optf.cmso.common.exceptions.CMSException;\r
import org.onap.optf.cmso.filters.CMSOClientFilters;\r
import org.springframework.beans.factory.annotation.Autowired;\r
import org.springframework.core.env.Environment;\r
import org.springframework.stereotype.Component;\r
+\r
import com.att.eelf.configuration.EELFLogger;\r
import com.att.eelf.configuration.EELFManager;\r
import com.fasterxml.jackson.databind.JsonNode;\r
\r
@Component\r
public class TmClient {\r
- private static EELFLogger log = EELFManager.getInstance().getLogger(TmClient.class);\r
- private static EELFLogger metrics = EELFManager.getInstance().getMetricsLogger();\r
- private static EELFLogger errors = EELFManager.getInstance().getErrorLogger();\r
private static EELFLogger debug = EELFManager.getInstance().getDebugLogger();\r
\r
@Autowired\r
}\r
break;\r
default: {\r
- errors.error(LogMessages.UNEXPECTED_RESPONSE, "TM", String.valueOf(response.getStatus()),\r
+ Observation.report(LogMessages.UNEXPECTED_RESPONSE, "TM", String.valueOf(response.getStatus()),\r
response.toString());\r
}\r
}\r
} catch (Exception e) {\r
- errors.error(LogMessages.UNEXPECTED_EXCEPTION, e.toString());\r
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e.toString());\r
} finally {\r
Mdc.restore(mdcSave);\r
}\r
try {\r
Response response = null;\r
debug.debug("postCloseChangeTicket {}", closeChangeRecord.asText());\r
- log.info(LogMessages.TM_CLOSE_CHANGE_RECORD, "Begin", scheduleId, changeId);\r
+ Observation.report(LogMessages.TM_CLOSE_CHANGE_RECORD, "Begin", scheduleId, changeId);\r
// response = vtmPost(url, closeChangeRecord, scheduleId);\r
response = tmPost(Endpoint.CLOSE, closeChangeRecord, scheduleId);\r
- log.info(LogMessages.TM_CLOSE_CHANGE_RECORD, "End", scheduleId, changeId);\r
+ Observation.report(LogMessages.TM_CLOSE_CHANGE_RECORD, "End", scheduleId, changeId);\r
switch (response.getStatus()) {\r
case 200: {\r
String resp = response.readEntity(String.class);\r
String respString = response.readEntity(String.class);\r
debug.debug("response=" + respString);\r
if (!isAlreadyClosed(respString)) {\r
- errors.error(LogMessages.UNEXPECTED_RESPONSE, "vTM", String.valueOf(response.getStatus()),\r
+ Observation.report(LogMessages.UNEXPECTED_RESPONSE, "vTM", String.valueOf(response.getStatus()),\r
response.toString() + " : " + respString);\r
throw new CMSException(Status.PRECONDITION_FAILED, LogMessages.UNABLE_TO_CLOSE_CHANGE_TICKET,\r
scheduleId, changeId, respString);\r
break;\r
default: {\r
String message = response.readEntity(String.class);\r
- errors.error(LogMessages.UNEXPECTED_RESPONSE, "vTM", String.valueOf(response.getStatus()),\r
+ Observation.report(LogMessages.UNEXPECTED_RESPONSE, "vTM", String.valueOf(response.getStatus()),\r
response.toString() + " : " + message);\r
throw new CMSException(Status.PRECONDITION_FAILED, LogMessages.UNABLE_TO_CLOSE_CHANGE_TICKET,\r
scheduleId, changeId, message);\r
}\r
}\r
} catch (ProcessingException e) {\r
- errors.error(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
throw new CMSException(Status.PRECONDITION_FAILED, LogMessages.UNABLE_TO_CLOSE_CHANGE_TICKET, scheduleId,\r
changeId, e.toString());\r
} finally {\r
}\r
}\r
} catch (Exception e) {\r
- errors.error(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
}\r
return false;\r
}\r
for (String name : variables.keySet()) {\r
Object value = variables.get(name);\r
if (value instanceof String) {\r
- StrSubstitutor sub = new StrSubstitutor(variables);\r
+ StringSubstitutor sub = new StringSubstitutor(variables);\r
value = sub.replace(value.toString());\r
variables.put(name, value);\r
}\r
try {\r
Response response = null;\r
debug.debug("postCreateChangeTicket {}", createChangeRecord.toString());\r
- log.info(LogMessages.TM_CREATE_CHANGE_RECORD, "Begin", scheduleId);\r
+ Observation.report(LogMessages.TM_CREATE_CHANGE_RECORD, "Begin", scheduleId);\r
// response = vtmPost(url, createChangeRecord, scheduleId);\r
response = tmPost(Endpoint.CREATE, createChangeRecord, scheduleId);\r
- log.info(LogMessages.TM_CREATE_CHANGE_RECORD, "End", scheduleId);\r
+ Observation.report(LogMessages.TM_CREATE_CHANGE_RECORD, "End", scheduleId);\r
switch (response.getStatus()) {\r
case 200: {\r
ObjectNode json = response.readEntity(ObjectNode.class);\r
debug.debug("ChangeId=" + changeId);\r
}\r
} else {\r
- errors.error(LogMessages.UNEXPECTED_RESPONSE, "vTM", String.valueOf(response.getStatus()),\r
+ Observation.report(LogMessages.UNEXPECTED_RESPONSE, "vTM", String.valueOf(response.getStatus()),\r
response.toString() + " : " + "Response is empty");\r
throw new CMSException(Status.EXPECTATION_FAILED, LogMessages.UNABLE_TO_CREATE_CHANGE_TICKET,\r
scheduleId, "Response is empty");\r
break;\r
default: {\r
String message = response.readEntity(String.class);\r
- errors.error(LogMessages.UNEXPECTED_RESPONSE, "vTM", String.valueOf(response.getStatus()),\r
+ Observation.report(LogMessages.UNEXPECTED_RESPONSE, "vTM", String.valueOf(response.getStatus()),\r
response.toString() + " : " + message);\r
throw new CMSException(Status.EXPECTATION_FAILED, LogMessages.UNABLE_TO_CREATE_CHANGE_TICKET,\r
scheduleId, message);\r
}\r
}\r
} catch (ProcessingException e) {\r
- errors.error(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
throw new CMSException(Status.EXPECTATION_FAILED, LogMessages.UNABLE_TO_CREATE_CHANGE_TICKET, scheduleId,\r
e.toString());\r
} finally {\r
\r
Response response = null;\r
debug.debug("postUpdateChangeTicket {}", updateChangeRecord.toString());\r
- log.info(LogMessages.TM_UPDATE_CHANGE_RECORD, "Begin", scheduleId, changeId, url);\r
+ Observation.report(LogMessages.TM_UPDATE_CHANGE_RECORD, "Begin", scheduleId, changeId, url);\r
// response = vtmPost(url, updateChangeRecord, scheduleId);\r
response = tmPost(Endpoint.UPDATE, updateChangeRecord, scheduleId);\r
- log.info(LogMessages.TM_UPDATE_CHANGE_RECORD, "End", scheduleId, changeId, url);\r
+ Observation.report(LogMessages.TM_UPDATE_CHANGE_RECORD, "End", scheduleId, changeId, url);\r
switch (response.getStatus()) {\r
case 200: {\r
String resp = response.readEntity(String.class);\r
break;\r
default: {\r
String message = response.readEntity(String.class);\r
- errors.error(LogMessages.UNEXPECTED_RESPONSE, "vTM", String.valueOf(response.getStatus()),\r
+ Observation.report(LogMessages.UNEXPECTED_RESPONSE, "vTM", String.valueOf(response.getStatus()),\r
response.toString() + " : " + message);\r
throw new CMSException(Status.PRECONDITION_FAILED, LogMessages.UNABLE_TO_UPDATE_CHANGE_TICKET,\r
scheduleId, changeId, message);\r
}\r
}\r
} catch (ProcessingException e) {\r
- errors.error(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());\r
throw new CMSException(Status.PRECONDITION_FAILED, LogMessages.UNABLE_TO_UPDATE_CHANGE_TICKET, scheduleId,\r
changeId, e.toString());\r
} finally {\r
ObjectMapper mapper = new ObjectMapper();\r
String jsonRequest = mapper.writeValueAsString(request);\r
debug.debug("vTM URL = " + url + " user=" + user + " : " + jsonRequest);\r
- Mdc.metricStart(scheduleId, url);\r
response = invocationBuilder.post(Entity.json(request));\r
- Mdc.metricEnd(response);\r
- metrics.info(LogMessages.TM_API, url);\r
// String message = response.readEntity(String.class);\r
// debug.debug("Return from " + url + " : " + response.toString() + "\n" +\r
// message);\r
debug.debug("Return from " + url + " : " + response.toString());\r
} catch (Exception e) {\r
- errors.error(LogMessages.UNEXPECTED_EXCEPTION, e, e.toString());\r
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.toString());\r
throw new CMSException(Status.INTERNAL_SERVER_ERROR, LogMessages.UNABLE_TO_CREATE_CHANGE_TICKET, scheduleId,\r
e.getMessage());\r
}\r
ObjectMapper mapper = new ObjectMapper();\r
String jsonRequest = mapper.writeValueAsString(request);\r
debug.debug("TM URL = " + url + " user=" + user + " : " + jsonRequest);\r
- Mdc.metricStart(scheduleId, url);\r
response = invocationBuilder.post(Entity.json(request));\r
- Mdc.metricEnd(response);\r
- metrics.info(LogMessages.TM_API, url);\r
// String message = response.readEntity(String.class);\r
// debug.debug("Return from " + url + " : " + response.toString() + "\n" +\r
// message);\r
debug.debug("Return from " + url + " : " + response.toString());\r
return response;\r
} catch (ProcessingException e) {\r
- errors.error(LogMessages.UNEXPECTED_EXCEPTION, e, e.toString());\r
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.toString());\r
url = tmEndpoints.getNextEndpoint(ep, endpoints);\r
if (url == null || !tryNextURL(e)) {\r
throw new CMSException(Status.INTERNAL_SERVER_ERROR, LogMessages.UNABLE_TO_CREATE_CHANGE_TICKET,\r
scheduleId, e.getMessage());\r
}\r
} catch (Exception e) {\r
- errors.error(LogMessages.UNEXPECTED_EXCEPTION, e, e.toString());\r
+ Observation.report(LogMessages.UNEXPECTED_EXCEPTION, e, e.toString());\r
throw new CMSException(Status.INTERNAL_SERVER_ERROR, LogMessages.UNABLE_TO_CREATE_CHANGE_TICKET,\r
scheduleId, e.getMessage());\r
}\r
--- /dev/null
+/**=org.onap.oof.access|*|get ALL
\ No newline at end of file
--- /dev/null
+############################################################
+# Properties Generated by AT&T Certificate Manager
+# by root
+# on 2019-02-15T21:01:19.868+0000
+# @copyright 2016, AT&T
+############################################################
+aaf_id=oof@oof.onap.org
+aaf_password=demo123456!
+cadi_keyfile=src/main/resources/aaf/org.onap.oof.keyfile
+cadi_truststore=src/main/resources/aaf/truststoreONAPall.jks
+#cadi_truststore_password=enc:erNqS33_5xn_bwcaroba7NvYfPLpPUYxqzw3rdwGTY7jbnygOTyQ-R6dpSC_3iPOomp-rqZkHgMGImiUk9DFPr
--- /dev/null
+liD-IR8Y1MHqPDTUqq3AaTtqnWn5jCpfIRBlyi6xY4A0fbQz8ZPlTZPHkshRt0dHdST3R7TIvTyQ
+JpTCeBNBu2df3vBbUzsN0rIpPG9TGjzmE7cRu4V4kfefSqsIj-S7OTAaWaWpwGWJYLLCB2sQALkS
+f68VWdupUEw3g9jqCU1QzjKOnLGvhlp6Qrc1xG4Z5Ar8WERw-C3DqTWUKANoEvjWkvH2rAywzj93
+pmspvd5fQfH1rp1ACNvnPrRb_oYNfwPrNpE7Sb4LvM1muoiKMDF64IDO0TkxhjHZ9wpJgVsnowby
+qmokqf39dMRRk3S1IEpOiBGyLS_885JDj_XJKYRQsjvkTzjpFJ7wE2-HDZEVWCITvtS9-Xorm5TI
+3iU4rjMDew5fkBnjoKuSOS7Lksva4ouZOCiUkDos1jAJ5XMDEQm4BcPHtcW6PpC602-qRcgnNjjP
+wOPdF7hCm27ZTai3lAtNGByR7oBr9r5Uma-soORFvg8drV8Rgh0lax-poFVhoEH7RhKPIzYpSco9
+jnpURzi_epTjAhjjup-erTv2GAIllKsSEHZLbfsFWlNUZTOx58PSB0jBN5m_8HxTyNm0zsm0Cb7U
+KsjPduQ5ZblsfRIJwqpOBXoof7WerKReMZSOdgjZUNueiuEImVH9_SYOdKZhkluSi4yfEtme7CCP
+kZ2JhdiT5km3SeonalhU2MUsx60krxyQ1mnjI4jS9QagUME4mujdvM_L7mtjcPZVSfXUn49whakE
+J-NQV6q2iZgN2IxsT_uCnlZYwnE5i-IbQkQAEu13m6ETsMmf0cwPnKaSwRhb8G48EkJhTL-GP9Z0
+-EsIKT7lQt7kfX-mmNoEirTg9gQAaN3uxLmdHvXpeJdlETnnaLYYJJ3h-SL0e_5Yz2SpdsEwZ3Bk
+PtR-QvlYKDhG1nhPOna65ctCzn81PZOUP3lsO6MSTOK6D6Taxfh1TYEBAvzCP0BfFBodw4lSglFP
+I5IfdiJmomTGARa36nC_O5YzH_jBWLQrgd2gxI5H5bB-5zqzu79SGX9o2_LRVY_LVV0BmI3xSYOI
+vziYYC1XyTY6blfdiOM5a5KjraErxSTEFZVFrsx4OQ_dLA0woVtixawrIy1rgfQr49U1oIRe8BgN
+j3eis_UQAbPbmdbEe1qtXnvi6T7trHskzt6K-vTgo5ITJkr-F2Sds_QgNdaFBGuES6X5RwRGlbHT
+Tl_M8Ja_1K-RMNKJRssoRTKstpwnrhk9IcoSwYcLykbDLgeC0mhSMHOOuWv1RGRaZdzObc5YA1eB
+idQmzy5xAHzNxPHHrB-fpjFJRYv_QZY9qZcGvP58d6bHO0upxbj-BBt9zfc7Qt0JLU6EAdYbW5TI
+2v4JImikrx6KvtoK8vcjJMTDAanTVB31J65tat0rq9wYKxUdjBJLzkT3psYs_DRtYQc0i02YTD7t
+dWya0-3p1Yrt0em3XGb8JAh2PA3BsQKmvKAOc054wf_B8n8saxSFw1WQL30vU5c4-Z_p53HfaUYd
+Qg7DZskzgwBRy48sLJNCrn81RtxXfQP1XtPEZs-AAlTUslHoUdoQ1cwrYEgkNT1cjk6sLI_oKSK-
+dDICBnlYLrZRBS3sH8K38WaIh1WRY6vbGVDs1tUectUpng_-Khavd0Crw7D_CE6T7Rnfcn0pnTV-
+HW1PIXejFsONQn-2c3a9HZ-v6Hg4JL6UWm-qgBPC5118ymO0LfmrviAFAC6Wt3WFiNzrvx9Jggus
+lE0qvLVfkQVZXAy-hSPHlYZmtxk5voVsf60qPoDN2-NdpWz62M9PrXd_A03YGxzt0G6J4VXExRES
+xqLeGNGB496AfX_vEub97sR8xcbbUXsyt12uVnygifGyND60coikaKrMktv2OLOLEl8AudLp0ZNA
+oOoYJZqfUnQqaLt0dNmNa5OtzYjf7f6bYX0V8XLTHlFqZ6QzqYGFMPNhDYjqtet6d--Q8t7_5S5C
+RfXP8Wh8CjbEh2_rsr9rvy1nhM_Cptxc0BFXcS5Dt_R4vjd2G4B_LEC4Hy1s_rZThzUVxRCl
\ No newline at end of file
--- /dev/null
+############################################################
+# Properties Generated by AT&T Certificate Manager
+# by root
+# on 2019-02-15T21:01:19.861+0000
+# @copyright 2016, AT&T
+############################################################
+cadi_latitude=0.00
+cadi_longitude=0.00
--- /dev/null
+############################################################
+# Properties Generated by AT&T Certificate Manager
+# by root
+# on 2019-02-15T21:01:19.866+0000
+# @copyright 2016, AT&T
+############################################################
+aaf_id=oof@oof.onap.org
+aaf_locate_url=https://aaf-onap-test.osaaf.org:8095
+aaf_url=https://AAF_LOCATE_URL/AAF_NS.service:2.1
+cadi_etc_dir=etc/config
+cadi_latitude=0.00
+cadi_longitude=0.00
+cadi_prop_files=src/main/resources/aaf/org.onap.oof.location.props;src/main/resources/aaf/org.onap.oof.cred.props
+cm_url=https://AAF_LOCATE_URL/AAF_NS.cm:2.1
com.att.eelf.logging.path=\r
\r
logging.config=\r
+spring.profiles.active=proprietary-auth
\ No newline at end of file
-#-------------------------------------------------------------------------------\r
-# Copyright © 2017-2018 AT&T Intellectual Property.\r
-# Modifications Copyright © 2018 IBM.\r
-# \r
-# Licensed under the Apache License, Version 2.0 (the "License");\r
-# you may not use this file except in compliance with the License.\r
-# You may obtain a copy of the License at\r
-# \r
-# http://www.apache.org/licenses/LICENSE-2.0\r
-# \r
-# Unless required by applicable law or agreed to in writing, software\r
-# distributed under the License is distributed on an "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-# See the License for the specific language governing permissions and\r
-# limitations under the License.\r
-# \r
-# \r
-# Unless otherwise specified, all documentation contained herein is licensed\r
-# under the Creative Commons License, Attribution 4.0 Intl. (the â??Licenseâ?\9d);\r
-# you may not use this documentation except in compliance with the License.\r
-# You may obtain a copy of the License at\r
-# \r
-# https://creativecommons.org/licenses/by/4.0/\r
-# \r
-# Unless required by applicable law or agreed to in writing, documentation\r
-# distributed under the License is distributed on an "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-# See the License for the specific language governing permissions and\r
-# limitations under the License.\r
-#-------------------------------------------------------------------------------\r
-\r
-# Generated from org.onap.optf.cmso.common.LogMessages\r
-SEARCH_SCHEDULE_REQUEST_DETAILS SEARCH_SCHEDULE_REQUEST_DETAILS|Search Schedule Request Details {0} from {1}: {2}|No resolution needed|No action is required\r
-SEARCH_SCHEDULE_REQUEST SEARCH_SCHEDULE_REQUEST|Search Schedule Request {0} from {1}: {2} : {3}|No resolution needed|No action is required\r
-CREATE_SCHEDULE_REQUEST CREATE_SCHEDULE_REQUEST|Create Schedule Request {0} from {1}: {2} : {3}|No resolution needed|No action is required\r
-DELETE_SCHEDULE_REQUEST DELETE_SCHEDULE_REQUEST|Delete Schedule Request {0} from {1}: {2} : {3}|No resolution needed|No action is required\r
-GET_SCHEDULE_REQUEST_INFO GET_SCHEDULE_REQUEST_INFO|Get Schedule Request Info {0} from {1}: {2} : {3}|No resolution needed|No action is required\r
-PROCESS_OPTIMIZER_CALLBACK PROCESS_OPTIMIZER_CALLBACK|Change management optimizer callback {0} from {1}: {2} |No resolution needed|No action is required\r
-APPROVE_SCHEDULE_REQUEST APPROVE_SCHEDULE_REQUEST|Approve Schedule Request {0} from {1}: {2} : {3}|No resolution needed|No action is required\r
-SCHEDULE_ALREADY_EXISTS SCHEDULE_ALREADY_EXISTS|Schedule already exists domain={0} schedule id={1}|No resolution needed|No action is required\r
-SCHEDULE_NOT_FOUND SCHEDULE_NOT_FOUND|Schedule not found domain={0} schedule id={1}|No resolution needed|No action is required\r
-INVALID_ATTRIBUTE INVALID_ATTRIBUTE|Invalid attribute {0}={1}|No resolution needed|No action is required\r
-MISSING_REQUIRED_ATTRIBUTE MISSING_REQUIRED_ATTRIBUTE|Missing required attribute '{0}'|No resolution needed|No action is required\r
-INVALID_REQUEST INVALID_REQUEST|The input data structure is incorrect|No resolution needed|No action is required\r
-REQUEST_TIMED_OUT REQUEST_TIMED_OUT|Request timed out.|No resolution needed|No action is required\r
-UNEXPECTED_EXCEPTION UNEXPECTED_EXCEPTION|Unexpected exception encountered during processing. Please contact support : {0}|No resolution needed|No action is required\r
-AUTHORIZATION_FAILED AUTHORIZATION_FAILED|Authorization Failed|No resolution needed|No action is required\r
-UNDEFINED_DOMAIN_DATA_ATTRIBUTE UNDEFINED_DOMAIN_DATA_ATTRIBUTE|Domain data attribute not defined domain={0} name={1} value={2}|No resolution needed|No action is required\r
-UNDEFINED_FILTER_ATTRIBUTE UNDEFINED_FILTER_ATTRIBUTE|Undefined filter attribute {0}|No resolution needed|No action is required\r
-INVALID_DATE_FILTER INVALID_DATE_FILTER|Invalid date filter provided {0}=(1}|No resolution needed|No action is required\r
-OPTIMIZER_QUARTZ_JOB OPTIMIZER_QUARTZ_JOB|Quartz scheduling of OptimizerQuartzJob: {0}|No resolution needed|No action is required\r
-OPTIMIZER_EXCEPTION OPTIMIZER_EXCEPTION|Exception making client call to optimizer {0}|No resolution needed|No action is required\r
-OPTIMIZER_CALLBACK_STATE_ERROR OPTIMIZER_CALLBACK_STATE_ERROR|Optimizer callback on schedule in invalid state. Should be {0} but was {1}.|No resolution needed|No action is required\r
-CHANGE_MANAGEMENT_GROUP_NOT_FOUND CHANGE_MANAGEMENT_GROUP_NOT_FOUND|ChangeManagementGroup not found on optimizer callback scheduleId={0} groupId={1}|No resolution needed|No action is required\r
-UNABLE_TO_ALLOCATE_VNF_TIMESLOTS UNABLE_TO_ALLOCATE_VNF_TIMESLOTS|Unable to allocate VNF timeslots with Optimizer results startTime={0}, latestStartTime={1}, totalDuration={2}, concurrency={3} nvfs={4}|No resolution needed|No action is required\r
-UNABLE_TO_LOCATE_SCHEDULE_DETAIL UNABLE_TO_LOCATE_SCHEDULE_DETAIL|Unable to locate ChangeManagementSchedule for VNF. scheduleId={0}, groupId={1}, vnfName={2}|No resolution needed|No action is required\r
-CM_JOB CM_JOB|Quartz scheduling of CmJob: {0}|No resolution needed|No action is required\r
-CM_QUARTZ_JOB CM_QUARTZ_JOB|Quartz scheduling of CmQuartzJob: {0}|No resolution needed|No action is required\r
-NOT_PENDING_APPROVAL NOT_PENDING_APPROVAL|Approval request received for schedule that is not in Pending Approval state: domain={0} scheduleId={1} state={3}|No resolution needed|No action is required\r
-SCHEDULE_PAST_DUE SCHEDULE_PAST_DUE|Attempt to dispatch an event that is Past due scheduleId={0}, vnf={1}, now={2}, startTime={3}|No resolution needed|No action is required\r
-MSO_POLLING_MISSING_SCHEDULE MSO_POLLING_MISSING_SCHEDULE|Attempt to poll MSO for request id {1} for missing ChangeManagementSchedule id={0}|No resolution needed|No action is required\r
-MSO_STATUS_JOB MSO_STATUS_JOB|Polling MSO {0} for requestId={1} for id={2}|No resolution needed|No action is required\r
-UNEXPECTED_RESPONSE UNEXPECTED_RESPONSE|Unexpected response from {0} HTTP Status={1} : {2}|No resolution needed|No action is required\r
-SCHEDULE_STATUS_JOB SCHEDULE_STATUS_JOB|Quartz scheduling of ScheduleStatusJob: {0}|No resolution needed|No action is required\r
-CM_TICKET_NOT_APPROVED CM_TICKET_NOT_APPROVED|Attempt to dispatch a change management event that has no TM Ticket approved. scheduleId={0} VNF Name={1} TM ChangeId={2} Status={3} Approval Status={4}|No resolution needed|No action is required\r
-MULTIPLE_GROUPS_NOT_SUPPORTED MULTIPLE_GROUPS_NOT_SUPPORTED|Multiple groups not supported on immediate requests|No resolution needed|No action is required\r
-TM_CREATE_CHANGE_RECORD TM_CREATE_CHANGE_RECORD|TM Create Change Record:{0} : Schedule ID: {1}|No resolution needed|No action is required\r
-TM_LIST TM_LIST|TM list:{0} : URL : {1}|No resolution needed|No action is required\r
-TM_API TM_API|TM API Call: URL : {0}|No resolution needed|No action is required\r
-UNABLE_TO_CREATE_CHANGE_TICKET UNABLE_TO_CREATE_CHANGE_TICKET|Unable to create change ticket in TM: Schedule ID: {0} : Reason : {1}|No resolution needed|No action is required\r
-TM_UPDATE_CHECKLIST TM_UPDATE_CHECKLIST|TM Fetch Checklist:{0} : Schedule ID: {1} : Change Id : {2} : URL : {3}|No resolution needed|No action is required\r
-OPTIMIZER_REQUEST OPTIMIZER_REQUEST|Optimi Request:{0} : Schedule ID: {1} : URL : {2}|No resolution needed|No action is required\r
-TM_CLOSE_CHANGE_RECORD TM_CLOSE_CHANGE_RECORD|TM Close Change Record:{0} : Schedule ID: {1} : Change Id : {2}|No resolution needed|No action is required\r
-UNABLE_TO_CLOSE_CHANGE_TICKET UNABLE_TO_CLOSE_CHANGE_TICKET|Unable to close change ticket in TM: Schedule ID: {0} : changeid: {1} : Reason: {2}|No resolution needed|No action is required\r
-CANNOT_CANCEL_IN_PROGRESS CANNOT_CANCEL_IN_PROGRESS|Cannot delete/cancel a schedule with events in progress.|No resolution needed|No action is required\r
-UNABLE_TO_PARSE_SCHEDULING_INFO UNABLE_TO_PARSE_SCHEDULING_INFO|Cannot parse scheduling info.|No resolution needed|No action is required\r
-UNABLE_TO_LOCATE_CHANGE_RECORD UNABLE_TO_LOCATE_CHANGE_RECORD|Unable to locate TM change record {2} to check status before displacth of {1} for schedulId={0}|No resolution needed|No action is required\r
-INVALID_CHANGE_WINDOW INVALID_CHANGE_WINDOW|Change window end time {1} must be after start time {0}|No resolution needed|No action is required\r
-NODE_LIST_CONTAINS_EMTPY_NODE NODE_LIST_CONTAINS_EMTPY_NODE|vnfDetails node list contains at least one empty node.|No resolution needed|No action is required\r
-SO_API SO_API|SO Poll Request {0}|No resolution needed|No action is required\r
-EXPECTED_EXCEPTION EXPECTED_EXCEPTION|Expected exception encountered during processing. Make Sonar happy: {0}|No resolution needed|No action is required\r
-TM_UPDATE_CHANGE_RECORD TM_UPDATE_CHANGE_RECORD|TM Update Change Record:{0} : Schedule ID: {1} : Change Id : {2} : URL : {3}|No resolution needed|No action is required\r
-UNABLE_TO_UPDATE_CHANGE_TICKET UNABLE_TO_UPDATE_CHANGE_TICKET|Unable to update change ticket in TM: Schedule ID: {0} : changeid: {1} : Reason: {2}|No resolution needed|No action is required\r
+# Generated from org.onap.optf.cmso.common.LogMessages
+SEARCH_SCHEDULE_REQUEST_DETAILS SEARCH_SCHEDULE_REQUEST_DETAILS|Search Schedule Request Details {0} from {1}: {2}|No resolution needed|No action is required
+SEARCH_SCHEDULE_REQUEST SEARCH_SCHEDULE_REQUEST|Search Schedule Request {0} from {1}: {2} : {3}|No resolution needed|No action is required
+CREATE_SCHEDULE_REQUEST CREATE_SCHEDULE_REQUEST|Create Schedule Request {0} from {1}: {2} : {3}|No resolution needed|No action is required
+DELETE_SCHEDULE_REQUEST DELETE_SCHEDULE_REQUEST|Delete Schedule Request {0} from {1}: {2} : {3}|No resolution needed|No action is required
+GET_SCHEDULE_REQUEST_INFO GET_SCHEDULE_REQUEST_INFO|Get Schedule Request Info {0} from {1}: {2} : {3}|No resolution needed|No action is required
+PROCESS_OPTIMIZER_CALLBACK PROCESS_OPTIMIZER_CALLBACK|Change management optimizer callback {0} from {1}: {2} |No resolution needed|No action is required
+APPROVE_SCHEDULE_REQUEST APPROVE_SCHEDULE_REQUEST|Approve Schedule Request {0} from {1}: {2} : {3}|No resolution needed|No action is required
+SCHEDULE_ALREADY_EXISTS SCHEDULE_ALREADY_EXISTS|Schedule already exists domain={0} schedule id={1}|No resolution needed|No action is required
+SCHEDULE_NOT_FOUND SCHEDULE_NOT_FOUND|Schedule not found domain={0} schedule id={1}|No resolution needed|No action is required
+INVALID_ATTRIBUTE INVALID_ATTRIBUTE|Invalid attribute {0}={1}|No resolution needed|No action is required
+MISSING_REQUIRED_ATTRIBUTE MISSING_REQUIRED_ATTRIBUTE|Missing required attribute '{0}'|No resolution needed|No action is required
+INVALID_REQUEST INVALID_REQUEST|The input data structure is incorrect|No resolution needed|No action is required
+REQUEST_TIMED_OUT REQUEST_TIMED_OUT|Request timed out.|No resolution needed|No action is required
+UNEXPECTED_EXCEPTION UNEXPECTED_EXCEPTION|Unexpected exception encountered during processing. Please contact support : {0}|No resolution needed|No action is required
+UNDEFINED_DOMAIN_DATA_ATTRIBUTE UNDEFINED_DOMAIN_DATA_ATTRIBUTE|Domain data attribute not defined domain={0} name={1} value={2}|No resolution needed|No action is required
+UNDEFINED_FILTER_ATTRIBUTE UNDEFINED_FILTER_ATTRIBUTE|Undefined filter attribute {0}|No resolution needed|No action is required
+INVALID_DATE_FILTER INVALID_DATE_FILTER|Invalid date filter provided {0}=(1}|No resolution needed|No action is required
+OPTIMIZER_QUARTZ_JOB OPTIMIZER_QUARTZ_JOB|Quartz scheduling of OptimizerQuartzJob: {0}|No resolution needed|No action is required
+OPTIMIZER_EXCEPTION OPTIMIZER_EXCEPTION|Exception making client call to optimizer {0}|No resolution needed|No action is required
+OPTIMIZER_CALLBACK_STATE_ERROR OPTIMIZER_CALLBACK_STATE_ERROR|Optimizer callback on schedule in invalid state. Should be {0} but was {1}.|No resolution needed|No action is required
+CHANGE_MANAGEMENT_GROUP_NOT_FOUND CHANGE_MANAGEMENT_GROUP_NOT_FOUND|ChangeManagementGroup not found on optimizer callback scheduleId={0} groupId={1}|No resolution needed|No action is required
+INCOMING_MESSAGE INCOMING_MESSAGE|Incoming message method={0} path={1}|No resolution needed|No action is required
+INCOMING_MESSAGE_RESPONSE INCOMING_MESSAGE_RESPONSE|Message response method={0} path={1} status={2}|No resolution needed|No action is required
+OUTGOING_MESSAGE OUTGOING_MESSAGE|Outgoing message method={0} path={1}|No resolution needed|No action is required
+OUTGOING_MESSAGE_RETURNED OUTGOING_MESSAGE_RETURNED|Outgoing message returned method={0} path={1} status={2}|No resolution needed|No action is required
+UNABLE_TO_ALLOCATE_VNF_TIMESLOTS UNABLE_TO_ALLOCATE_VNF_TIMESLOTS|Unable to allocate VNF timeslots with Optimizer results startTime={0}, latestStartTime={1}, totalDuration={2}, concurrency={3} nvfs={4}|No resolution needed|No action is required
+UNABLE_TO_LOCATE_SCHEDULE_DETAIL UNABLE_TO_LOCATE_SCHEDULE_DETAIL|Unable to locate ChangeManagementSchedule for VNF. scheduleId={0}, groupId={1}, vnfName={2}|No resolution needed|No action is required
+CM_JOB CM_JOB|Quartz scheduling of CmJob: {0}|No resolution needed|No action is required
+CM_QUARTZ_JOB CM_QUARTZ_JOB|Quartz scheduling of CmQuartzJob: {0}|No resolution needed|No action is required
+NOT_PENDING_APPROVAL NOT_PENDING_APPROVAL|Approval request received for schedule that is not in Pending Approval state: domain={0} scheduleId={1} state={3}|No resolution needed|No action is required
+SCHEDULE_PAST_DUE SCHEDULE_PAST_DUE|Attempt to dispatch an event that is Past due scheduleId={0}, vnf={1}, now={2}, startTime={3}|No resolution needed|No action is required
+MSO_POLLING_MISSING_SCHEDULE MSO_POLLING_MISSING_SCHEDULE|Attempt to poll MSO for request id {1} for missing ChangeManagementSchedule id={0}|No resolution needed|No action is required
+MSO_STATUS_JOB MSO_STATUS_JOB|Polling MSO {0} for requestId={1} for id={2}|No resolution needed|No action is required
+UNEXPECTED_RESPONSE UNEXPECTED_RESPONSE|Unexpected response from {0} HTTP Status={1} : {2}|No resolution needed|No action is required
+SCHEDULE_STATUS_JOB SCHEDULE_STATUS_JOB|Quartz scheduling of ScheduleStatusJob: {0}|No resolution needed|No action is required
+CM_TICKET_NOT_APPROVED CM_TICKET_NOT_APPROVED|Attempt to dispatch a change management event that has no TM Ticket approved. scheduleId={0} VNF Name={1} TM ChangeId={2} Status={3} Approval Status={4}|No resolution needed|No action is required
+MULTIPLE_GROUPS_NOT_SUPPORTED MULTIPLE_GROUPS_NOT_SUPPORTED|Multiple groups not supported on immediate requests|No resolution needed|No action is required
+TM_CREATE_CHANGE_RECORD TM_CREATE_CHANGE_RECORD|TM Create Change Record:{0} : Schedule ID: {1}|No resolution needed|No action is required
+TM_LIST TM_LIST|TM list:{0} : URL : {1}|No resolution needed|No action is required
+TM_API TM_API|TM API Call: URL : {0}|No resolution needed|No action is required
+UNABLE_TO_CREATE_CHANGE_TICKET UNABLE_TO_CREATE_CHANGE_TICKET|Unable to create change ticket in TM: Schedule ID: {0} : Reason : {1}|No resolution needed|No action is required
+TM_UPDATE_CHECKLIST TM_UPDATE_CHECKLIST|TM Fetch Checklist:{0} : Schedule ID: {1} : Change Id : {2} : URL : {3}|No resolution needed|No action is required
+OPTIMIZER_REQUEST OPTIMIZER_REQUEST|Optimi Request:{0} : Schedule ID: {1} : URL : {2}|No resolution needed|No action is required
+TM_CLOSE_CHANGE_RECORD TM_CLOSE_CHANGE_RECORD|TM Close Change Record:{0} : Schedule ID: {1} : Change Id : {2}|No resolution needed|No action is required
+UNABLE_TO_CLOSE_CHANGE_TICKET UNABLE_TO_CLOSE_CHANGE_TICKET|Unable to close change ticket in TM: Schedule ID: {0} : changeid: {1} : Reason: {2}|No resolution needed|No action is required
+CANNOT_CANCEL_IN_PROGRESS CANNOT_CANCEL_IN_PROGRESS|Cannot delete/cancel a schedule with events in progress.|No resolution needed|No action is required
+UNABLE_TO_PARSE_SCHEDULING_INFO UNABLE_TO_PARSE_SCHEDULING_INFO|Cannot parse scheduling info.|No resolution needed|No action is required
+UNABLE_TO_LOCATE_CHANGE_RECORD UNABLE_TO_LOCATE_CHANGE_RECORD|Unable to locate TM change record {2} to check status before displacth of {1} for schedulId={0}|No resolution needed|No action is required
+INVALID_CHANGE_WINDOW INVALID_CHANGE_WINDOW|Change window end time {1} must be after start time {0}|No resolution needed|No action is required
+NODE_LIST_CONTAINS_EMTPY_NODE NODE_LIST_CONTAINS_EMTPY_NODE|vnfDetails node list contains at least one empty node.|No resolution needed|No action is required
+SO_API SO_API|SO Poll Request {0}|No resolution needed|No action is required
+EXPECTED_EXCEPTION EXPECTED_EXCEPTION|Expected exception encountered during processing. {0}|No resolution needed|No action is required
+TM_UPDATE_CHANGE_RECORD TM_UPDATE_CHANGE_RECORD|TM Update Change Record:{0} : Schedule ID: {1} : Change Id : {2} : URL : {3}|No resolution needed|No action is required
+UNABLE_TO_UPDATE_CHANGE_TICKET UNABLE_TO_UPDATE_CHANGE_TICKET|Unable to update change ticket in TM: Schedule ID: {0} : changeid: {1} : Reason: {2}|No resolution needed|No action is required
+UNAUTHORIZED UNAUTHORIZED|Authorization failed.|No resolution needed|No action is required
+UNAUTHENTICATED UNAUTHENTICATED|Authentication failed.|No resolution needed|No action is required
+UNRECOGNIZED_MSO_STATUS UNRECOGNIZED_MSO_STATUS|Unrecognized status returned by MSO {0}|No resolution needed|No action is required
+UNABLE_TO_PARSE_MSO_RESPONSE UNABLE_TO_PARSE_MSO_RESPONSE|Unable to parse status message from MSO {0} : {1}|No resolution needed|No action is required