aboutsummaryrefslogtreecommitdiffstats
path: root/common/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'common/src/main/java')
-rw-r--r--common/src/main/java/org/onap/so/client/aai/AAIObjectPlurals.java2
-rw-r--r--common/src/main/java/org/onap/so/client/aai/AAIObjectType.java3
-rw-r--r--common/src/main/java/org/onap/so/client/aai/entities/AAIEdgeLabel.java5
-rw-r--r--common/src/main/java/org/onap/so/client/aai/entities/uri/HttpLookupUri.java23
-rw-r--r--common/src/main/java/org/onap/so/client/dmaap/DmaapClient.java10
-rw-r--r--common/src/main/java/org/onap/so/client/graphinventory/Format.java11
-rw-r--r--common/src/main/java/org/onap/so/client/graphinventory/GraphInventoryResourcesClient.java18
-rw-r--r--common/src/main/java/org/onap/so/client/graphinventory/entities/uri/GraphInventoryUri.java1
-rw-r--r--common/src/main/java/org/onap/so/client/policy/entities/PolicyServiceType.java17
-rw-r--r--common/src/main/java/org/onap/so/client/sdno/dmaap/SDNOHealthCheckDmaapPublisher.java6
-rw-r--r--common/src/main/java/org/onap/so/db/connections/DbDnsIpAddress.java20
-rw-r--r--common/src/main/java/org/onap/so/db/connections/ScheduledDnsLookup.java78
-rw-r--r--common/src/main/java/org/onap/so/logger/ErrorCode.java28
-rw-r--r--common/src/main/java/org/onap/so/logger/HttpHeadersConstants.java20
-rw-r--r--common/src/main/java/org/onap/so/logger/LoggingAnchor.java29
-rw-r--r--common/src/main/java/org/onap/so/logger/MdcConstants.java20
-rw-r--r--common/src/main/java/org/onap/so/logger/MessageEnum.java197
-rw-r--r--common/src/main/java/org/onap/so/objects/audit/AAIObjectAudit.java20
-rw-r--r--common/src/main/java/org/onap/so/objects/audit/AAIObjectAuditList.java20
-rw-r--r--common/src/main/java/org/onap/so/serviceinstancebeans/ModelType.java69
-rw-r--r--common/src/main/java/org/onap/so/serviceinstancebeans/Request.java12
-rw-r--r--common/src/main/java/org/onap/so/serviceinstancebeans/RequestParameters.java28
-rw-r--r--common/src/main/java/org/onap/so/serviceinstancebeans/RequestStatus.java13
-rw-r--r--common/src/main/java/org/onap/so/utils/CryptoUtils.java5
-rw-r--r--common/src/main/java/org/onap/so/utils/TargetEntity.java16
-rw-r--r--common/src/main/java/org/onap/so/utils/UUIDChecker.java3
-rw-r--r--common/src/main/java/org/onap/so/utils/XmlMarshaller.java9
27 files changed, 620 insertions, 63 deletions
diff --git a/common/src/main/java/org/onap/so/client/aai/AAIObjectPlurals.java b/common/src/main/java/org/onap/so/client/aai/AAIObjectPlurals.java
index d02b482008..e42a2a2383 100644
--- a/common/src/main/java/org/onap/so/client/aai/AAIObjectPlurals.java
+++ b/common/src/main/java/org/onap/so/client/aai/AAIObjectPlurals.java
@@ -70,6 +70,8 @@ public class AAIObjectPlurals implements GraphInventoryObjectPlurals, Serializab
new AAIObjectPlurals(AAIObjectType.VSERVER.uriTemplate(), "/l-interfaces", "l-interface");
public static final AAIObjectPlurals SUB_L_INTERFACE =
new AAIObjectPlurals(AAIObjectType.L_INTERFACE.uriTemplate(), "/l-interfaces", "l-interface");
+ public static final AAIObjectPlurals INSTANCE_GROUP =
+ new AAIObjectPlurals(AAINamespaceConstants.NETWORK, "/instance-groups", "instance-group");
public static final AAIObjectPlurals PNF = new AAIObjectPlurals(AAINamespaceConstants.NETWORK, "/pnfs", "pnfs");
private final String uriTemplate;
diff --git a/common/src/main/java/org/onap/so/client/aai/AAIObjectType.java b/common/src/main/java/org/onap/so/client/aai/AAIObjectType.java
index 6b2b6f2b3e..c2c8e933b1 100644
--- a/common/src/main/java/org/onap/so/client/aai/AAIObjectType.java
+++ b/common/src/main/java/org/onap/so/client/aai/AAIObjectType.java
@@ -72,6 +72,7 @@ import org.onap.aai.domain.yang.Vnfc;
import org.onap.aai.domain.yang.VolumeGroup;
import org.onap.aai.domain.yang.VpnBinding;
import org.onap.aai.domain.yang.Vserver;
+import org.onap.aai.domain.yang.Zone;
import org.onap.so.client.graphinventory.GraphInventoryObjectType;
import org.onap.so.constants.Defaults;
import org.reflections.Reflections;
@@ -186,7 +187,7 @@ public class AAIObjectType implements GraphInventoryObjectType, Serializable {
"/esr-vnfm/{vnfm-id}/esr-system-info-list", "vnfm-esr-system-info-list");
public static final AAIObjectType CLOUD_ESR_SYSTEM_INFO_LIST = new AAIObjectType(
AAIObjectType.CLOUD_REGION.uriTemplate(), "/esr-system-info-list", "cloud-esr-system-info-list");
-
+ public static final AAIObjectType ZONE = new AAIObjectType(AAINamespaceConstants.NETWORK, Zone.class);
private final String uriTemplate;
private final String parentUri;
diff --git a/common/src/main/java/org/onap/so/client/aai/entities/AAIEdgeLabel.java b/common/src/main/java/org/onap/so/client/aai/entities/AAIEdgeLabel.java
index 2e70c4925a..456f14e5ee 100644
--- a/common/src/main/java/org/onap/so/client/aai/entities/AAIEdgeLabel.java
+++ b/common/src/main/java/org/onap/so/client/aai/entities/AAIEdgeLabel.java
@@ -24,8 +24,9 @@ import org.onap.so.client.graphinventory.entities.GraphInventoryEdgeLabel;
public enum AAIEdgeLabel implements GraphInventoryEdgeLabel {
- BELONGS_TO("org.onap.relationships.inventory.BelongsTo"), USES(
- "org.onap.relationships.inventory.Uses"), COMPOSED_OF("org.onap.relationships.inventory.ComposedOf");
+ BELONGS_TO("org.onap.relationships.inventory.BelongsTo"),
+ USES("org.onap.relationships.inventory.Uses"),
+ COMPOSED_OF("org.onap.relationships.inventory.ComposedOf");
private final String label;
diff --git a/common/src/main/java/org/onap/so/client/aai/entities/uri/HttpLookupUri.java b/common/src/main/java/org/onap/so/client/aai/entities/uri/HttpLookupUri.java
index f086a6abcf..37d21b375e 100644
--- a/common/src/main/java/org/onap/so/client/aai/entities/uri/HttpLookupUri.java
+++ b/common/src/main/java/org/onap/so/client/aai/entities/uri/HttpLookupUri.java
@@ -21,6 +21,8 @@
package org.onap.so.client.aai.entities.uri;
import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
import java.net.URI;
import java.util.Map;
import java.util.Optional;
@@ -42,7 +44,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
public abstract class HttpLookupUri extends AAISimpleUri implements HttpAwareUri {
- private Optional<String> cachedValue = Optional.empty();
+ private transient Optional<String> cachedValue = Optional.empty();
private final AAIObjectType aaiType;
protected HttpLookupUri(AAIObjectType type, Object... values) {
@@ -78,8 +80,7 @@ public abstract class HttpLookupUri extends AAISimpleUri implements HttpAwareUri
throw new GraphInventoryPayloadException("could not map payload: " + resultJson, e);
}
}
- Optional<String> cachedValueOpt = this.getCachedValue();
- return cachedValueOpt.isPresent() ? cachedValueOpt.get() : "";
+ return cachedValue.get();
}
protected Optional<String> extractRelatedLink(String jsonString) throws IOException {
@@ -139,6 +140,22 @@ public abstract class HttpLookupUri extends AAISimpleUri implements HttpAwareUri
return new AAIResourcesClient();
}
+ private void writeObject(ObjectOutputStream oos) throws IOException {
+
+ oos.writeUTF(this.cachedValue.orElse(""));
+ }
+
+ private void readObject(ObjectInputStream ois) throws IOException {
+
+ String value = ois.readUTF();
+ if ("".equals(value)) {
+ this.cachedValue = Optional.empty();
+ } else {
+ this.cachedValue = Optional.ofNullable(value);
+ }
+
+ }
+
@Override
public abstract URI buildNoNetwork();
}
diff --git a/common/src/main/java/org/onap/so/client/dmaap/DmaapClient.java b/common/src/main/java/org/onap/so/client/dmaap/DmaapClient.java
index 86d4aa7413..48c2d1495d 100644
--- a/common/src/main/java/org/onap/so/client/dmaap/DmaapClient.java
+++ b/common/src/main/java/org/onap/so/client/dmaap/DmaapClient.java
@@ -49,12 +49,12 @@ public abstract class DmaapClient {
this.msoProperties = dmaapProperties.getProperties();
this.properties = new Properties();
this.properties.load(resource.getInputStream());
- try {
- this.properties.put("auth", CryptoUtils.decrypt(this.getAuth(), this.getKey()).getBytes());
- } catch (GeneralSecurityException e) {
- logger.error(e.getMessage(), e);
+ if (this.getAuth() != null && this.getKey() != null) {
+ this.properties.put("auth", this.getAuth());
+ this.properties.put("key", this.getKey());
+ } else {
+ logger.error("Dmaap auth or key is null");
}
- this.properties.put("key", this.getKey());
this.properties.put("topic", this.getTopic());
Optional<String> host = this.getHost();
if (host.isPresent()) {
diff --git a/common/src/main/java/org/onap/so/client/graphinventory/Format.java b/common/src/main/java/org/onap/so/client/graphinventory/Format.java
index b422516e63..078b35aaf4 100644
--- a/common/src/main/java/org/onap/so/client/graphinventory/Format.java
+++ b/common/src/main/java/org/onap/so/client/graphinventory/Format.java
@@ -22,8 +22,15 @@ package org.onap.so.client.graphinventory;
public enum Format {
- RESOURCE("resource"), RESOURCE_AND_URL("resource_and_url"), SIMPLE("simple"), RAW("raw"), CONSOLE(
- "console"), PATHED("pathed"), GRAPHSON("graphson"), ID("id");
+ RESOURCE("resource"),
+ RESOURCE_AND_URL("resource_and_url"),
+ SIMPLE("simple"),
+ RAW("raw"),
+ CONSOLE("console"),
+ PATHED("pathed"),
+ GRAPHSON("graphson"),
+ ID("id"),
+ COUNT("count");
private final String name;
diff --git a/common/src/main/java/org/onap/so/client/graphinventory/GraphInventoryResourcesClient.java b/common/src/main/java/org/onap/so/client/graphinventory/GraphInventoryResourcesClient.java
index 2a76dab107..c7cdb2ff58 100644
--- a/common/src/main/java/org/onap/so/client/graphinventory/GraphInventoryResourcesClient.java
+++ b/common/src/main/java/org/onap/so/client/graphinventory/GraphInventoryResourcesClient.java
@@ -32,9 +32,7 @@ import org.onap.so.client.RestClient;
import org.onap.so.client.RestProperties;
import org.onap.so.client.graphinventory.entities.GraphInventoryEdgeLabel;
import org.onap.so.client.graphinventory.entities.GraphInventoryResultWrapper;
-import org.onap.so.client.graphinventory.entities.uri.Depth;
import org.onap.so.client.graphinventory.entities.uri.GraphInventoryResourceUri;
-import org.onap.so.client.graphinventory.entities.uri.GraphInventoryUri;
public abstract class GraphInventoryResourcesClient<Self, Uri extends GraphInventoryResourceUri, EdgeLabel extends GraphInventoryEdgeLabel, Wrapper extends GraphInventoryResultWrapper, TransactionalClient, SingleTransactionClient> {
@@ -74,7 +72,9 @@ public abstract class GraphInventoryResourcesClient<Self, Uri extends GraphInven
* @return
*/
public boolean exists(Uri uri) {
- GraphInventoryUri forceMinimal = this.addParams(Optional.of(Depth.ZERO), true, uri);
+ GraphInventoryResourceUri forceMinimal = uri.clone();
+ forceMinimal.format(Format.COUNT);
+ forceMinimal.limit(1);
try {
RestClient giRC = client.createClient(forceMinimal);
@@ -314,18 +314,6 @@ public abstract class GraphInventoryResourcesClient<Self, Uri extends GraphInven
*/
public abstract SingleTransactionClient beginSingleTransaction();
- private GraphInventoryUri addParams(Optional<Depth> depth, boolean nodesOnly, GraphInventoryUri uri) {
- GraphInventoryUri clone = uri.clone();
- if (depth.isPresent()) {
- clone.depth(depth.get());
- }
- if (nodesOnly) {
- clone.nodesOnly(nodesOnly);
- }
-
- return clone;
- }
-
public <T extends RestProperties> T getRestProperties() {
return client.getRestProperties();
}
diff --git a/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/GraphInventoryUri.java b/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/GraphInventoryUri.java
index d6d3e5eaa2..6b48ad44ef 100644
--- a/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/GraphInventoryUri.java
+++ b/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/GraphInventoryUri.java
@@ -22,7 +22,6 @@ package org.onap.so.client.graphinventory.entities.uri;
import java.net.URI;
import java.util.Map;
-import org.onap.so.client.graphinventory.entities.uri.Depth;
import org.onap.so.client.graphinventory.GraphInventoryObjectType;
public interface GraphInventoryUri {
diff --git a/common/src/main/java/org/onap/so/client/policy/entities/PolicyServiceType.java b/common/src/main/java/org/onap/so/client/policy/entities/PolicyServiceType.java
index b00d22dbad..eb95b75593 100644
--- a/common/src/main/java/org/onap/so/client/policy/entities/PolicyServiceType.java
+++ b/common/src/main/java/org/onap/so/client/policy/entities/PolicyServiceType.java
@@ -21,11 +21,18 @@
package org.onap.so.client.policy.entities;
public enum PolicyServiceType {
- GET_CONFIG("getConfig"), SEND_EVENT("sendEvent"), PUSH_POLICY("pushPolicy"), CREATE_POLICY(
- "createPolicy"), UPDATE_POLICY("updatePolicy"), GET_DECISION("getDecision"), GET_METRICS(
- "getMetrics"), DELETE_POLICY("deletePolicy"), LIST_CONFIG("listConfig"), CREATE_DICTIONARY_ITEM(
- "createDictionaryItem"), UPDATE_DICTIONARY_ITEM(
- "updateDictionaryItem"), GET_DICTIONARY_ITEMS("getDictionaryItems");
+ GET_CONFIG("getConfig"),
+ SEND_EVENT("sendEvent"),
+ PUSH_POLICY("pushPolicy"),
+ CREATE_POLICY("createPolicy"),
+ UPDATE_POLICY("updatePolicy"),
+ GET_DECISION("getDecision"),
+ GET_METRICS("getMetrics"),
+ DELETE_POLICY("deletePolicy"),
+ LIST_CONFIG("listConfig"),
+ CREATE_DICTIONARY_ITEM("createDictionaryItem"),
+ UPDATE_DICTIONARY_ITEM("updateDictionaryItem"),
+ GET_DICTIONARY_ITEMS("getDictionaryItems");
private final String name;
diff --git a/common/src/main/java/org/onap/so/client/sdno/dmaap/SDNOHealthCheckDmaapPublisher.java b/common/src/main/java/org/onap/so/client/sdno/dmaap/SDNOHealthCheckDmaapPublisher.java
index b1adc53f3a..b85b7c3bde 100644
--- a/common/src/main/java/org/onap/so/client/sdno/dmaap/SDNOHealthCheckDmaapPublisher.java
+++ b/common/src/main/java/org/onap/so/client/sdno/dmaap/SDNOHealthCheckDmaapPublisher.java
@@ -7,9 +7,9 @@
* 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.
@@ -38,7 +38,7 @@ public class SDNOHealthCheckDmaapPublisher extends DmaapPublisher {
@Override
public String getKey() {
- return msoProperties.get("sdno.health-check.dmaap.msoKey");
+ return msoProperties.get("mso.msoKey");
}
@Override
diff --git a/common/src/main/java/org/onap/so/db/connections/DbDnsIpAddress.java b/common/src/main/java/org/onap/so/db/connections/DbDnsIpAddress.java
new file mode 100644
index 0000000000..8ee63a487b
--- /dev/null
+++ b/common/src/main/java/org/onap/so/db/connections/DbDnsIpAddress.java
@@ -0,0 +1,20 @@
+package org.onap.so.db.connections;
+
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+
+@Component
+@Scope("singleton")
+public class DbDnsIpAddress {
+
+ private String ipAddress;
+
+ public String getIpAddress() {
+ return ipAddress;
+ }
+
+ public void setIpAddress(String ipAddress) {
+ this.ipAddress = ipAddress;
+ }
+
+}
diff --git a/common/src/main/java/org/onap/so/db/connections/ScheduledDnsLookup.java b/common/src/main/java/org/onap/so/db/connections/ScheduledDnsLookup.java
new file mode 100644
index 0000000000..14f2f5e9b7
--- /dev/null
+++ b/common/src/main/java/org/onap/so/db/connections/ScheduledDnsLookup.java
@@ -0,0 +1,78 @@
+package org.onap.so.db.connections;
+
+import java.lang.management.ManagementFactory;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.Set;
+import javax.management.JMX;
+import javax.management.MBeanServer;
+import javax.management.ObjectInstance;
+import javax.management.ObjectName;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Profile;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+import com.zaxxer.hikari.HikariPoolMXBean;
+
+@Component
+@Profile("!test")
+public class ScheduledDnsLookup {
+
+ private static final String JMX_HIKARI_DB_POOL_LOOKUP = "com.zaxxer.hikari:type=Pool (*,*";
+
+ private static final String DB_HOST = "DB_HOST";
+
+ @Autowired
+ private DbDnsIpAddress dnsIpAddress;
+
+ private static Logger logger = LoggerFactory.getLogger(ScheduledDnsLookup.class);
+
+ @Scheduled(fixedRate = 15000)
+ public void performDnsLookup() {
+
+ String dnsUrl = System.getenv(DB_HOST);
+
+ try {
+ if (dnsUrl == null) {
+ logger.error("Database DNS is not provided. Please verify the configuration");
+ return;
+ }
+
+ InetAddress inetAddress = java.net.InetAddress.getByName(dnsUrl);
+ String ipAddress = inetAddress.getHostAddress();
+ String currentIpAddress = dnsIpAddress.getIpAddress();
+ /* This is in initial state */
+ if (currentIpAddress == null) {
+ dnsIpAddress.setIpAddress(ipAddress);
+ return;
+ }
+
+ if ((ipAddress != null) && (!ipAddress.equalsIgnoreCase(currentIpAddress))) {
+ logger.debug("Switched Database IP Address from {} to {}", currentIpAddress, ipAddress);
+ softEvictConnectionPool();
+ dnsIpAddress.setIpAddress(ipAddress);
+ }
+ } catch (UnknownHostException e) {
+ logger.warn("Database DNS %s is not resolvable to an IP Address", dnsUrl);
+ }
+
+ }
+
+ private void softEvictConnectionPool() {
+ try {
+ MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
+ ObjectName queryObj = new ObjectName(JMX_HIKARI_DB_POOL_LOOKUP);
+ Set<ObjectInstance> objects = mBeanServer.queryMBeans(queryObj, null);
+ for (ObjectInstance objectInstance : objects) {
+ ObjectName poolObject = objectInstance.getObjectName();
+ HikariPoolMXBean poolProxy = JMX.newMXBeanProxy(mBeanServer, poolObject, HikariPoolMXBean.class);
+ logger.debug("database connection pool is soft evicted for connections");
+ poolProxy.softEvictConnections();
+ }
+ } catch (Exception e) {
+ logger.warn("Error encountered in evicting DB connection pool", e);
+ }
+ }
+}
diff --git a/common/src/main/java/org/onap/so/logger/ErrorCode.java b/common/src/main/java/org/onap/so/logger/ErrorCode.java
index 2d6fb791d5..7fb9522b7c 100644
--- a/common/src/main/java/org/onap/so/logger/ErrorCode.java
+++ b/common/src/main/java/org/onap/so/logger/ErrorCode.java
@@ -1,8 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 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.so.logger;
public enum ErrorCode {
- PermissionError(100), AvailabilityError(200), DataError(300), SchemaError(400), BusinessProcesssError(
- 500), UnknownError(900);
+ PermissionError(100),
+ AvailabilityError(200),
+ DataError(300),
+ SchemaError(400),
+ BusinessProcesssError(500),
+ UnknownError(900);
private int value;
diff --git a/common/src/main/java/org/onap/so/logger/HttpHeadersConstants.java b/common/src/main/java/org/onap/so/logger/HttpHeadersConstants.java
index f34b4b5a9a..83b860ff01 100644
--- a/common/src/main/java/org/onap/so/logger/HttpHeadersConstants.java
+++ b/common/src/main/java/org/onap/so/logger/HttpHeadersConstants.java
@@ -1,3 +1,23 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 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.so.logger;
public class HttpHeadersConstants {
diff --git a/common/src/main/java/org/onap/so/logger/LoggingAnchor.java b/common/src/main/java/org/onap/so/logger/LoggingAnchor.java
new file mode 100644
index 0000000000..119ae4c43c
--- /dev/null
+++ b/common/src/main/java/org/onap/so/logger/LoggingAnchor.java
@@ -0,0 +1,29 @@
+package org.onap.so.logger;
+
+import java.util.Collections;
+import java.util.stream.Collectors;
+
+public class LoggingAnchor {
+ public static final String ONE = Collections.nCopies(1, "{}").stream().collect(Collectors.joining(" "));
+
+ public static final String TWO = Collections.nCopies(2, "{}").stream().collect(Collectors.joining(" "));
+
+ public static final String THREE = Collections.nCopies(3, "{}").stream().collect(Collectors.joining(" "));
+
+ public static final String FOUR = Collections.nCopies(4, "{}").stream().collect(Collectors.joining(" "));
+
+ public static final String FIVE = Collections.nCopies(5, "{}").stream().collect(Collectors.joining(" "));
+
+ public static final String SIX = Collections.nCopies(6, "{}").stream().collect(Collectors.joining(" "));
+
+ public static final String SEVEN = Collections.nCopies(7, "{}").stream().collect(Collectors.joining(" "));
+
+ public static final String EIGHT = Collections.nCopies(8, "{}").stream().collect(Collectors.joining(" "));
+
+ public static final String NINE = Collections.nCopies(9, "{}").stream().collect(Collectors.joining(" "));
+
+ public static final String TEN = Collections.nCopies(10, "{}").stream().collect(Collectors.joining(" "));
+
+ private LoggingAnchor() {}
+
+}
diff --git a/common/src/main/java/org/onap/so/logger/MdcConstants.java b/common/src/main/java/org/onap/so/logger/MdcConstants.java
index e3212733c8..33fceb2f0f 100644
--- a/common/src/main/java/org/onap/so/logger/MdcConstants.java
+++ b/common/src/main/java/org/onap/so/logger/MdcConstants.java
@@ -1,3 +1,23 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 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.so.logger;
public class MdcConstants {
diff --git a/common/src/main/java/org/onap/so/logger/MessageEnum.java b/common/src/main/java/org/onap/so/logger/MessageEnum.java
index e92d50a685..bcf699beaf 100644
--- a/common/src/main/java/org/onap/so/logger/MessageEnum.java
+++ b/common/src/main/java/org/onap/so/logger/MessageEnum.java
@@ -24,13 +24,200 @@ package org.onap.so.logger;
public enum MessageEnum {
// Api Handler Messages
- APIH_REQUEST_NULL, APIH_QUERY_FOUND, APIH_QUERY_NOT_FOUND, APIH_QUERY_PARAM_WRONG, APIH_DB_ACCESS_EXC, APIH_DB_ACCESS_EXC_REASON, APIH_VALIDATION_ERROR, APIH_REQUEST_VALIDATION_ERROR, APIH_SERVICE_VALIDATION_ERROR, APIH_GENERAL_EXCEPTION_ARG, APIH_GENERAL_EXCEPTION, APIH_GENERAL_WARNING, APIH_AUDIT_EXEC, APIH_GENERAL_METRICS, APIH_DUPLICATE_CHECK_EXC, APIH_DUPLICATE_FOUND, APIH_BAD_ORDER, APIH_DB_ATTRIBUTE_NOT_FOUND, APIH_BPEL_COMMUNICATE_ERROR, APIH_BPEL_RESPONSE_ERROR, APIH_WARP_REQUEST, APIH_ERROR_FROM_BPEL_SERVER, APIH_DB_INSERT_EXC, APIH_DB_UPDATE_EXC, APIH_NO_PROPERTIES, APIH_PROPERTY_LOAD_SUC, APIH_LOAD_PROPERTIES_FAIL, APIH_SDNC_COMMUNICATE_ERROR, APIH_SDNC_RESPONSE_ERROR, APIH_CANNOT_READ_SCHEMA, APIH_HEALTH_CHECK_EXCEPTION, APIH_REQUEST_VALIDATION_ERROR_REASON, APIH_JAXB_MARSH_ERROR, APIH_JAXB_UNMARSH_ERROR, APIH_VNFREQUEST_VALIDATION_ERROR, APIH_DOM2STR_ERROR, APIH_READ_VNFOUTPUT_CLOB_EXCEPTION, APIH_DUPLICATE_CHECK_EXC_ATT, APIH_GENERATED_REQUEST_ID, APIH_GENERATED_SERVICE_INSTANCE_ID, APIH_REPLACE_REQUEST_ID,
+ APIH_REQUEST_NULL,
+ APIH_QUERY_FOUND,
+ APIH_QUERY_NOT_FOUND,
+ APIH_QUERY_PARAM_WRONG,
+ APIH_DB_ACCESS_EXC,
+ APIH_DB_ACCESS_EXC_REASON,
+ APIH_VALIDATION_ERROR,
+ APIH_REQUEST_VALIDATION_ERROR,
+ APIH_SERVICE_VALIDATION_ERROR,
+ APIH_GENERAL_EXCEPTION_ARG,
+ APIH_GENERAL_EXCEPTION,
+ APIH_GENERAL_WARNING,
+ APIH_AUDIT_EXEC,
+ APIH_GENERAL_METRICS,
+ APIH_DUPLICATE_CHECK_EXC,
+ APIH_DUPLICATE_FOUND,
+ APIH_BAD_ORDER,
+ APIH_DB_ATTRIBUTE_NOT_FOUND,
+ APIH_BPEL_COMMUNICATE_ERROR,
+ APIH_BPEL_RESPONSE_ERROR,
+ APIH_WARP_REQUEST,
+ APIH_ERROR_FROM_BPEL_SERVER,
+ APIH_DB_INSERT_EXC,
+ APIH_DB_UPDATE_EXC,
+ APIH_NO_PROPERTIES,
+ APIH_PROPERTY_LOAD_SUC,
+ APIH_LOAD_PROPERTIES_FAIL,
+ APIH_SDNC_COMMUNICATE_ERROR,
+ APIH_SDNC_RESPONSE_ERROR,
+ APIH_CANNOT_READ_SCHEMA,
+ APIH_HEALTH_CHECK_EXCEPTION,
+ APIH_REQUEST_VALIDATION_ERROR_REASON,
+ APIH_JAXB_MARSH_ERROR,
+ APIH_JAXB_UNMARSH_ERROR,
+ APIH_VNFREQUEST_VALIDATION_ERROR,
+ APIH_DOM2STR_ERROR,
+ APIH_READ_VNFOUTPUT_CLOB_EXCEPTION,
+ APIH_DUPLICATE_CHECK_EXC_ATT,
+ APIH_GENERATED_REQUEST_ID,
+ APIH_GENERATED_SERVICE_INSTANCE_ID,
+ APIH_REPLACE_REQUEST_ID,
// Resource Adapter Messages
- RA_GENERAL_EXCEPTION_ARG, RA_GENERAL_EXCEPTION, RA_GENERAL_WARNING, RA_MISSING_PARAM, RA_AUDIT_EXEC, RA_GENERAL_METRICS, RA_CREATE_STACK_TIMEOUT, RA_DELETE_STACK_TIMEOUT, RA_UPDATE_STACK_TIMEOUT, RA_CONNECTION_EXCEPTION, RA_PARSING_ERROR, RA_PROPERTIES_NOT_FOUND, RA_LOAD_PROPERTIES_SUC, RA_NETWORK_ALREADY_EXIST, RA_UPDATE_NETWORK_ERR, RA_CREATE_STACK_ERR, RA_UPDATE_STACK_ERR, RA_CREATE_TENANT_ERR, RA_NETWORK_NOT_FOUND, RA_NETWORK_ORCHE_MODE_NOT_SUPPORT, RA_CREATE_NETWORK_EXC, RA_NS_EXC, RA_PARAM_NOT_FOUND, RA_CONFIG_EXC, RA_UNKOWN_PARAM, RA_VLAN_PARSE, RA_DELETE_NETWORK_EXC, RA_ROLLBACK_NULL, RA_TENANT_NOT_FOUND, RA_QUERY_NETWORK_EXC, RA_CREATE_NETWORK_NOTIF_EXC, RA_ASYNC_ROLLBACK, RA_WSDL_NOT_FOUND, RA_WSDL_URL_CONVENTION_EXC, RA_INIT_NOTIF_EXC, RA_SET_CALLBACK_AUTH_EXC, RA_FAULT_INFO_EXC, RA_MARSHING_ERROR, RA_PARSING_REQUEST_ERROR, RA_SEND_REQUEST_SDNC, RA_RESPONSE_FROM_SDNC, RA_EXCEPTION_COMMUNICATE_SDNC, RA_EVALUATE_XPATH_ERROR, RA_ANALYZE_ERROR_EXC, RA_ERROR_GET_RESPONSE_SDNC, RA_CALLBACK_BPEL, RA_INIT_CALLBACK_WSDL_ERR, RA_CALLBACK_BPEL_EXC, RA_CALLBACK_BPEL_COMPLETE, RA_SDNC_MISS_CONFIG_PARAM, RA_SDNC_INVALID_CONFIG, RA_PRINT_URL, RA_ERROR_CREATE_SDNC_REQUEST, RA_ERROR_CREATE_SDNC_RESPONSE, RA_ERROR_CONVERT_XML2STR, RA_RECEIVE_SDNC_NOTIF, RA_INIT_SDNC_ADAPTER, RA_SEND_REQUEST_APPC_ERR, RA_SEND_REQUEST_SDNC_ERR, RA_RECEIVE_BPEL_REQUEST, RA_TENANT_ALREADY_EXIST, RA_UPDATE_TENANT_ERR, RA_DELETE_TEMAMT_ERR, RA_ROLLBACK_TENANT_ERR, RA_QUERY_VNF_ERR, RA_VNF_ALREADY_EXIST, RA_VNF_UNKNOWN_PARAM, RA_VNF_EXTRA_PARAM, RA_CREATE_VNF_ERR, RA_VNF_NOT_EXIST, RA_UPDATE_VNF_ERR, RA_DELETE_VNF_ERR, RA_ASYNC_CREATE_VNF, RA_SEND_VNF_NOTIF_ERR, RA_ASYNC_CREATE_VNF_COMPLETE, RA_ASYNC_UPDATE_VNF, RA_ASYNC_UPDATE_VNF_COMPLETE, RA_ASYNC_QUERY_VNF, RA_ASYNC_QUERY_VNF_COMPLETE, RA_ASYNC_DELETE_VNF, RA_ASYNC_DELETE_VNF_COMPLETE, RA_ASYNC_ROLLBACK_VNF, RA_ASYNC_ROLLBACK_VNF_COMPLETE, RA_ROLLBACK_VNF_ERR, RA_DB_INVALID_STATUS, RA_CANT_UPDATE_REQUEST, RA_DB_REQUEST_NOT_EXIST, RA_CONFIG_NOT_FOUND, RA_CONFIG_LOAD, RA_RECEIVE_WORKFLOW_MESSAGE,
+ RA_GENERAL_EXCEPTION_ARG,
+ RA_GENERAL_EXCEPTION,
+ RA_GENERAL_WARNING,
+ RA_MISSING_PARAM,
+ RA_AUDIT_EXEC,
+ RA_GENERAL_METRICS,
+ RA_CREATE_STACK_TIMEOUT,
+ RA_DELETE_STACK_TIMEOUT,
+ RA_UPDATE_STACK_TIMEOUT,
+ RA_CONNECTION_EXCEPTION,
+ RA_PARSING_ERROR,
+ RA_PROPERTIES_NOT_FOUND,
+ RA_LOAD_PROPERTIES_SUC,
+ RA_NETWORK_ALREADY_EXIST,
+ RA_UPDATE_NETWORK_ERR,
+ RA_CREATE_STACK_ERR,
+ RA_UPDATE_STACK_ERR,
+ RA_CREATE_TENANT_ERR,
+ RA_NETWORK_NOT_FOUND,
+ RA_NETWORK_ORCHE_MODE_NOT_SUPPORT,
+ RA_CREATE_NETWORK_EXC,
+ RA_NS_EXC,
+ RA_PARAM_NOT_FOUND,
+ RA_CONFIG_EXC,
+ RA_UNKOWN_PARAM,
+ RA_VLAN_PARSE,
+ RA_DELETE_NETWORK_EXC,
+ RA_ROLLBACK_NULL,
+ RA_TENANT_NOT_FOUND,
+ RA_QUERY_NETWORK_EXC,
+ RA_CREATE_NETWORK_NOTIF_EXC,
+ RA_ASYNC_ROLLBACK,
+ RA_WSDL_NOT_FOUND,
+ RA_WSDL_URL_CONVENTION_EXC,
+ RA_INIT_NOTIF_EXC,
+ RA_SET_CALLBACK_AUTH_EXC,
+ RA_FAULT_INFO_EXC,
+ RA_MARSHING_ERROR,
+ RA_PARSING_REQUEST_ERROR,
+ RA_SEND_REQUEST_SDNC,
+ RA_RESPONSE_FROM_SDNC,
+ RA_EXCEPTION_COMMUNICATE_SDNC,
+ RA_EVALUATE_XPATH_ERROR,
+ RA_ANALYZE_ERROR_EXC,
+ RA_ERROR_GET_RESPONSE_SDNC,
+ RA_CALLBACK_BPEL,
+ RA_INIT_CALLBACK_WSDL_ERR,
+ RA_CALLBACK_BPEL_EXC,
+ RA_CALLBACK_BPEL_COMPLETE,
+ RA_SDNC_MISS_CONFIG_PARAM,
+ RA_SDNC_INVALID_CONFIG,
+ RA_PRINT_URL,
+ RA_ERROR_CREATE_SDNC_REQUEST,
+ RA_ERROR_CREATE_SDNC_RESPONSE,
+ RA_ERROR_CONVERT_XML2STR,
+ RA_RECEIVE_SDNC_NOTIF,
+ RA_INIT_SDNC_ADAPTER,
+ RA_SEND_REQUEST_APPC_ERR,
+ RA_SEND_REQUEST_SDNC_ERR,
+ RA_RECEIVE_BPEL_REQUEST,
+ RA_TENANT_ALREADY_EXIST,
+ RA_UPDATE_TENANT_ERR,
+ RA_DELETE_TEMAMT_ERR,
+ RA_ROLLBACK_TENANT_ERR,
+ RA_QUERY_VNF_ERR,
+ RA_VNF_ALREADY_EXIST,
+ RA_VNF_UNKNOWN_PARAM,
+ RA_VNF_EXTRA_PARAM,
+ RA_CREATE_VNF_ERR,
+ RA_VNF_NOT_EXIST,
+ RA_UPDATE_VNF_ERR,
+ RA_DELETE_VNF_ERR,
+ RA_ASYNC_CREATE_VNF,
+ RA_SEND_VNF_NOTIF_ERR,
+ RA_ASYNC_CREATE_VNF_COMPLETE,
+ RA_ASYNC_UPDATE_VNF,
+ RA_ASYNC_UPDATE_VNF_COMPLETE,
+ RA_ASYNC_QUERY_VNF,
+ RA_ASYNC_QUERY_VNF_COMPLETE,
+ RA_ASYNC_DELETE_VNF,
+ RA_ASYNC_DELETE_VNF_COMPLETE,
+ RA_ASYNC_ROLLBACK_VNF,
+ RA_ASYNC_ROLLBACK_VNF_COMPLETE,
+ RA_ROLLBACK_VNF_ERR,
+ RA_DB_INVALID_STATUS,
+ RA_CANT_UPDATE_REQUEST,
+ RA_DB_REQUEST_NOT_EXIST,
+ RA_CONFIG_NOT_FOUND,
+ RA_CONFIG_LOAD,
+ RA_RECEIVE_WORKFLOW_MESSAGE,
// BPEL engine Messages
- BPMN_GENERAL_INFO, BPMN_GENERAL_EXCEPTION_ARG, BPMN_GENERAL_EXCEPTION, BPMN_GENERAL_WARNING, BPMN_AUDIT_EXEC, BPMN_GENERAL_METRICS, BPMN_URN_MAPPING_FAIL, BPMN_VARIABLE_NULL, BPMN_CALLBACK_EXCEPTION,
+ BPMN_GENERAL_INFO,
+ BPMN_GENERAL_EXCEPTION_ARG,
+ BPMN_GENERAL_EXCEPTION,
+ BPMN_GENERAL_WARNING,
+ BPMN_AUDIT_EXEC,
+ BPMN_GENERAL_METRICS,
+ BPMN_URN_MAPPING_FAIL,
+ BPMN_VARIABLE_NULL,
+ BPMN_CALLBACK_EXCEPTION,
// ASDC Messages
- ASDC_GENERAL_EXCEPTION_ARG, ASDC_GENERAL_EXCEPTION, ASDC_GENERAL_WARNING, ASDC_GENERAL_INFO, ASDC_AUDIT_EXEC, ASDC_GENERAL_METRICS, ASDC_CREATE_SERVICE, ASDC_ARTIFACT_ALREADY_DEPLOYED, ASDC_CREATE_ARTIFACT, ASDC_ARTIFACT_INSTALL_EXC, ASDC_ARTIFACT_ALREADY_DEPLOYED_DETAIL, ASDC_ARTIFACT_NOT_DEPLOYED_DETAIL, ASDC_ARTIFACT_CHECK_EXC, ASDC_INIT_ASDC_CLIENT_EXC, ASDC_INIT_ASDC_CLIENT_SUC, ASDC_LOAD_ASDC_CLIENT_EXC, ASDC_SINGLETON_CHECKT_EXC, ASDC_SHUTDOWN_ASDC_CLIENT_EXC, ASDC_CHECK_HEAT_TEMPLATE, ASDC_START_INSTALL_ARTIFACT, ASDC_ARTIFACT_TYPE_NOT_SUPPORT, ASDC_ARTIFACT_ALREADY_EXIST, ASDC_ARTIFACT_DOWNLOAD_SUC, ASDC_ARTIFACT_DOWNLOAD_FAIL, ASDC_START_DEPLOY_ARTIFACT, ASDC_SEND_NOTIF_ASDC, ASDC_SEND_NOTIF_ASDC_EXEC, ASDC_RECEIVE_CALLBACK_NOTIF, ASDC_RECEIVE_SERVICE_NOTIF, ASDC_ARTIFACT_NULL, ASDC_SERVICE_NOT_SUPPORT, ASDC_ARTIFACT_DEPLOY_SUC, ASDC_PROPERTIES_NOT_FOUND, ASDC_PROPERTIES_LOAD_SUCCESS,
+ ASDC_GENERAL_EXCEPTION_ARG,
+ ASDC_GENERAL_EXCEPTION,
+ ASDC_GENERAL_WARNING,
+ ASDC_GENERAL_INFO,
+ ASDC_AUDIT_EXEC,
+ ASDC_GENERAL_METRICS,
+ ASDC_CREATE_SERVICE,
+ ASDC_ARTIFACT_ALREADY_DEPLOYED,
+ ASDC_CREATE_ARTIFACT,
+ ASDC_ARTIFACT_INSTALL_EXC,
+ ASDC_ARTIFACT_ALREADY_DEPLOYED_DETAIL,
+ ASDC_ARTIFACT_NOT_DEPLOYED_DETAIL,
+ ASDC_ARTIFACT_CHECK_EXC,
+ ASDC_INIT_ASDC_CLIENT_EXC,
+ ASDC_INIT_ASDC_CLIENT_SUC,
+ ASDC_LOAD_ASDC_CLIENT_EXC,
+ ASDC_SINGLETON_CHECKT_EXC,
+ ASDC_SHUTDOWN_ASDC_CLIENT_EXC,
+ ASDC_CHECK_HEAT_TEMPLATE,
+ ASDC_START_INSTALL_ARTIFACT,
+ ASDC_ARTIFACT_TYPE_NOT_SUPPORT,
+ ASDC_ARTIFACT_ALREADY_EXIST,
+ ASDC_ARTIFACT_DOWNLOAD_SUC,
+ ASDC_ARTIFACT_DOWNLOAD_FAIL,
+ ASDC_START_DEPLOY_ARTIFACT,
+ ASDC_SEND_NOTIF_ASDC,
+ ASDC_SEND_NOTIF_ASDC_EXEC,
+ ASDC_RECEIVE_CALLBACK_NOTIF,
+ ASDC_RECEIVE_SERVICE_NOTIF,
+ ASDC_ARTIFACT_NULL,
+ ASDC_SERVICE_NOT_SUPPORT,
+ ASDC_ARTIFACT_DEPLOY_SUC,
+ ASDC_PROPERTIES_NOT_FOUND,
+ ASDC_PROPERTIES_LOAD_SUCCESS,
// Default Messages, in case Log catalog is not defined
- GENERAL_EXCEPTION_ARG, GENERAL_EXCEPTION, GENERAL_WARNING, AUDIT_EXEC, GENERAL_METRICS, LOGGER_SETUP, LOGGER_NOT_FOUND, LOGGER_UPDATE_SUC, LOGGER_UPDATE_DEBUG, LOGGER_UPDATE_DEBUG_SUC, LOAD_PROPERTIES_SUC, NO_PROPERTIES, MADATORY_PARAM_MISSING, LOAD_PROPERTIES_FAIL, INIT_LOGGER, INIT_LOGGER_FAIL, JAXB_EXCEPTION, IDENTITY_SERVICE_NOT_FOUND;
+ GENERAL_EXCEPTION_ARG,
+ GENERAL_EXCEPTION,
+ GENERAL_WARNING,
+ AUDIT_EXEC,
+ GENERAL_METRICS,
+ LOGGER_SETUP,
+ LOGGER_NOT_FOUND,
+ LOGGER_UPDATE_SUC,
+ LOGGER_UPDATE_DEBUG,
+ LOGGER_UPDATE_DEBUG_SUC,
+ LOAD_PROPERTIES_SUC,
+ NO_PROPERTIES,
+ MADATORY_PARAM_MISSING,
+ LOAD_PROPERTIES_FAIL,
+ INIT_LOGGER,
+ INIT_LOGGER_FAIL,
+ JAXB_EXCEPTION,
+ IDENTITY_SERVICE_NOT_FOUND;
}
diff --git a/common/src/main/java/org/onap/so/objects/audit/AAIObjectAudit.java b/common/src/main/java/org/onap/so/objects/audit/AAIObjectAudit.java
index a27e8fbbd1..d45cc00b85 100644
--- a/common/src/main/java/org/onap/so/objects/audit/AAIObjectAudit.java
+++ b/common/src/main/java/org/onap/so/objects/audit/AAIObjectAudit.java
@@ -1,3 +1,23 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 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.so.objects.audit;
import java.io.Serializable;
diff --git a/common/src/main/java/org/onap/so/objects/audit/AAIObjectAuditList.java b/common/src/main/java/org/onap/so/objects/audit/AAIObjectAuditList.java
index 675701d598..2a4b90eef7 100644
--- a/common/src/main/java/org/onap/so/objects/audit/AAIObjectAuditList.java
+++ b/common/src/main/java/org/onap/so/objects/audit/AAIObjectAuditList.java
@@ -1,3 +1,23 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 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.so.objects.audit;
import java.io.Serializable;
diff --git a/common/src/main/java/org/onap/so/serviceinstancebeans/ModelType.java b/common/src/main/java/org/onap/so/serviceinstancebeans/ModelType.java
index 9a184b0a51..6b9b39e5a9 100644
--- a/common/src/main/java/org/onap/so/serviceinstancebeans/ModelType.java
+++ b/common/src/main/java/org/onap/so/serviceinstancebeans/ModelType.java
@@ -20,9 +20,76 @@
package org.onap.so.serviceinstancebeans;
+import java.lang.reflect.InvocationTargetException;
+import com.google.common.base.CaseFormat;
+
/*
* Enum for Model Type values returned by API Handler to BPMN
*/
public enum ModelType {
- service, vnf, vfModule, volumeGroup, network, configuration, connectionPoint, pnf, networkInstanceGroup, instanceGroup
+ service("serviceInstance"),
+ vnf("vnf"),
+ vfModule("vfModule"),
+ volumeGroup("volumeGroup"),
+ network("network"),
+ configuration("configuration"),
+ connectionPoint("connectionPoint"),
+ pnf("pnf"),
+ networkInstanceGroup("networkInstanceGroup"),
+ instanceGroup("instanceGroup"),
+ vpnBinding("vpnBinding");
+
+ final String name;
+
+ private ModelType(String name) {
+ this.name = name;
+ }
+
+
+ public <T> T getId(Object obj) {
+ return this.get(obj, "Id");
+ }
+
+ public <T> T getName(Object obj) {
+ return this.get(obj, "Name");
+ }
+
+ public void setId(Object obj, Object value) {
+ this.set(obj, "Id", value);
+ }
+
+ public void setName(Object obj, Object value) {
+ this.set(obj, "Name", value);
+ }
+
+ protected <T> T get(Object obj, String field) {
+ T result = null;
+ if (obj != null) {
+ try {
+ result = (T) obj.getClass().getMethod(String.format("%s%s%s", "get",
+ CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_CAMEL, this.name), field)).invoke(obj);
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException
+ | NoSuchMethodException | SecurityException e) {
+ // silent fail
+ }
+ }
+
+ return result;
+ }
+
+ protected void set(Object obj, String field, Object value) {
+ if (obj != null) {
+ try {
+ obj.getClass()
+ .getMethod(
+ String.format("%s%s%s", "set",
+ CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_CAMEL, this.name), field),
+ value.getClass())
+ .invoke(obj, value);
+ } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException
+ | InvocationTargetException e) {
+ // silent fail
+ }
+ }
+ }
}
diff --git a/common/src/main/java/org/onap/so/serviceinstancebeans/Request.java b/common/src/main/java/org/onap/so/serviceinstancebeans/Request.java
index fbdb27c0ec..75a6ba8280 100644
--- a/common/src/main/java/org/onap/so/serviceinstancebeans/Request.java
+++ b/common/src/main/java/org/onap/so/serviceinstancebeans/Request.java
@@ -22,7 +22,6 @@ package org.onap.so.serviceinstancebeans;
import java.util.ArrayList;
import java.util.List;
-import java.util.Map;
import org.apache.commons.lang3.builder.ToStringBuilder;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
@@ -36,6 +35,7 @@ public class Request {
protected String finishTime;
protected String requestScope;
protected String requestType;
+ protected String originalRequestId;
protected RequestDetails requestDetails;
protected InstanceReferences instanceReferences;
protected RequestStatus requestStatus;
@@ -124,6 +124,14 @@ public class Request {
this.cloudRequestData = cloudRequestData;
}
+ public String getOriginalRequestId() {
+ return originalRequestId;
+ }
+
+ public void setOriginalRequestId(String originalRequestId) {
+ this.originalRequestId = originalRequestId;
+ }
+
@Override
public String toString() {
return new ToStringBuilder(this).append("requestId", requestId).append("startTime", startTime)
@@ -131,6 +139,6 @@ public class Request {
.append("requestType", requestType).append("requestDetails", requestDetails)
.append("instanceReferences", instanceReferences).append("requestStatus", requestStatus)
.append("requestProcessingData", requestProcessingData).append("cloudRequestData", cloudRequestData)
- .toString();
+ .append("originalRequestId", originalRequestId).toString();
}
}
diff --git a/common/src/main/java/org/onap/so/serviceinstancebeans/RequestParameters.java b/common/src/main/java/org/onap/so/serviceinstancebeans/RequestParameters.java
index 1df2c10411..9fceed1641 100644
--- a/common/src/main/java/org/onap/so/serviceinstancebeans/RequestParameters.java
+++ b/common/src/main/java/org/onap/so/serviceinstancebeans/RequestParameters.java
@@ -20,11 +20,11 @@
package org.onap.so.serviceinstancebeans;
-import java.beans.Transient;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
+import org.apache.commons.lang3.builder.ToStringBuilder;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -52,9 +52,21 @@ public class RequestParameters implements Serializable {
private Boolean cascadeDelete;
@JsonProperty("testApi")
private String testApi; // usePreload would always be true for Update
+ @JsonProperty("retainAssignments")
+ private Boolean retainAssignments; // usePreload would always be true for Update
@JsonProperty("rebuildVolumeGroups")
private Boolean rebuildVolumeGroups;
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("subscriptionServiceType", subscriptionServiceType)
+ .append("userParams", userParams).append("aLaCarte", aLaCarte).append("payload", payload)
+ .append("usePreload", usePreload).append("autoBuildVfModules", autoBuildVfModules)
+ .append("cascadeDelete", cascadeDelete).append("testApi", testApi)
+ .append("retainAssignments", retainAssignments).append("rebuildVolumeGroups", rebuildVolumeGroups)
+ .toString();
+ }
+
public String getSubscriptionServiceType() {
return subscriptionServiceType;
}
@@ -150,11 +162,13 @@ public class RequestParameters implements Serializable {
this.rebuildVolumeGroups = rebuildVolumeGroups;
}
- @Override
- public String toString() {
- return "RequestParameters [subscriptionServiceType=" + subscriptionServiceType + ", userParams=" + userParams
- + ", aLaCarte=" + aLaCarte + ", testApi= " + testApi + ", autoBuildVfModules=" + autoBuildVfModules
- + ", usePreload=" + usePreload + ", rebuildVolumeGroups=" + rebuildVolumeGroups + ", payload=" + payload
- + "]";
+ public Boolean getRetainAssignments() {
+ return retainAssignments;
+ }
+
+ public void setRetainAssignments(Boolean retainAssignments) {
+ this.retainAssignments = retainAssignments;
}
+
+
}
diff --git a/common/src/main/java/org/onap/so/serviceinstancebeans/RequestStatus.java b/common/src/main/java/org/onap/so/serviceinstancebeans/RequestStatus.java
index f659ae241a..e9d9d87b10 100644
--- a/common/src/main/java/org/onap/so/serviceinstancebeans/RequestStatus.java
+++ b/common/src/main/java/org/onap/so/serviceinstancebeans/RequestStatus.java
@@ -36,6 +36,16 @@ public class RequestStatus {
protected Integer percentProgress;
@JsonProperty("timestamp")
protected String timeStamp;
+ @JsonProperty("extSystemErrorSource")
+ protected String extSystemErrorSource;
+
+ public String getExtSystemErrorSource() {
+ return extSystemErrorSource;
+ }
+
+ public void setExtSystemErrorSource(String extSystemErrorSource) {
+ this.extSystemErrorSource = extSystemErrorSource;
+ }
public String getRequestState() {
return requestState;
@@ -72,6 +82,7 @@ public class RequestStatus {
@Override
public String toString() {
return new ToStringBuilder(this).append("requestState", requestState).append("statusMessage", statusMessage)
- .append("percentProgress", percentProgress).append("timestamp", timeStamp).toString();
+ .append("percentProgress", percentProgress).append("timestamp", timeStamp)
+ .append("extSystemErrorSource", extSystemErrorSource).toString();
}
}
diff --git a/common/src/main/java/org/onap/so/utils/CryptoUtils.java b/common/src/main/java/org/onap/so/utils/CryptoUtils.java
index 09b48d266f..640660e97c 100644
--- a/common/src/main/java/org/onap/so/utils/CryptoUtils.java
+++ b/common/src/main/java/org/onap/so/utils/CryptoUtils.java
@@ -23,6 +23,7 @@
package org.onap.so.utils;
+import org.onap.so.logger.LoggingAnchor;
import org.onap.so.logger.ErrorCode;
import org.onap.so.logger.MessageEnum;
import org.slf4j.Logger;
@@ -89,7 +90,7 @@ public final class CryptoUtils {
try {
return CryptoUtils.encrypt(message, CLOUD_KEY);
} catch (GeneralSecurityException e) {
- logger.error("{} {} {}", MessageEnum.RA_GENERAL_EXCEPTION.toString(),
+ logger.error(LoggingAnchor.THREE, MessageEnum.RA_GENERAL_EXCEPTION.toString(),
ErrorCode.BusinessProcesssError.getValue(), "Exception in encryptPassword ", e);
return null;
}
@@ -99,7 +100,7 @@ public final class CryptoUtils {
try {
return CryptoUtils.decrypt(message, CLOUD_KEY);
} catch (GeneralSecurityException e) {
- logger.error("{} {} {}", MessageEnum.RA_GENERAL_EXCEPTION.toString(),
+ logger.error(LoggingAnchor.THREE, MessageEnum.RA_GENERAL_EXCEPTION.toString(),
ErrorCode.BusinessProcesssError.getValue(), "Exception in encryptPassword ", e);
return null;
}
diff --git a/common/src/main/java/org/onap/so/utils/TargetEntity.java b/common/src/main/java/org/onap/so/utils/TargetEntity.java
index 5f87378b79..0f1fe51114 100644
--- a/common/src/main/java/org/onap/so/utils/TargetEntity.java
+++ b/common/src/main/java/org/onap/so/utils/TargetEntity.java
@@ -23,7 +23,21 @@ package org.onap.so.utils;
import java.util.EnumSet;
public enum TargetEntity {
- OPENSTACK_ADAPTER, BPMN, GRM, AAI, DMAAP, POLICY, CATALOG_DB, REQUEST_DB, VNF_ADAPTER, SDNC_ADAPTER, SNIRO, SDC, EXTERNAL, MULTICLOUD;
+ OPENSTACK_ADAPTER,
+ BPMN,
+ GRM,
+ AAI,
+ DMAAP,
+ POLICY,
+ CATALOG_DB,
+ REQUEST_DB,
+ VNF_ADAPTER,
+ SDNC_ADAPTER,
+ SNIRO,
+ SDC,
+ EXTERNAL,
+ MULTICLOUD,
+ OOF;
private static final String PREFIX = "SO";
diff --git a/common/src/main/java/org/onap/so/utils/UUIDChecker.java b/common/src/main/java/org/onap/so/utils/UUIDChecker.java
index 585ffcc7c4..30fc92bf49 100644
--- a/common/src/main/java/org/onap/so/utils/UUIDChecker.java
+++ b/common/src/main/java/org/onap/so/utils/UUIDChecker.java
@@ -24,6 +24,7 @@
package org.onap.so.utils;
import java.util.UUID;
+import org.onap.so.logger.LoggingAnchor;
import org.onap.so.logger.MessageEnum;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -51,7 +52,7 @@ public class UUIDChecker {
public static String getUUID() {
String result = UUID.randomUUID().toString();
- logger.info("{} {}", MessageEnum.APIH_GENERATED_REQUEST_ID, result);
+ logger.info(LoggingAnchor.TWO, MessageEnum.APIH_GENERATED_REQUEST_ID, result);
return result;
}
}
diff --git a/common/src/main/java/org/onap/so/utils/XmlMarshaller.java b/common/src/main/java/org/onap/so/utils/XmlMarshaller.java
index 0022ecbb96..0ff3ccfa9c 100644
--- a/common/src/main/java/org/onap/so/utils/XmlMarshaller.java
+++ b/common/src/main/java/org/onap/so/utils/XmlMarshaller.java
@@ -32,6 +32,7 @@ import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import javax.xml.parsers.SAXParserFactory;
import javax.xml.transform.sax.SAXSource;
+import org.onap.so.logger.LoggingAnchor;
import org.onap.so.exceptions.MarshallerException;
import org.onap.so.logger.ErrorCode;
import org.onap.so.logger.MessageEnum;
@@ -52,8 +53,8 @@ public class XmlMarshaller {
Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
jaxbMarshaller.marshal(object, stringWriter);
} catch (JAXBException e) {
- logger.error("{} {} {}", MessageEnum.GENERAL_EXCEPTION.toString(), ErrorCode.SchemaError.getValue(),
- e.getMessage(), e);
+ logger.error(LoggingAnchor.THREE, MessageEnum.GENERAL_EXCEPTION.toString(),
+ ErrorCode.SchemaError.getValue(), e.getMessage(), e);
throw new MarshallerException(e.getMessage(), ErrorCode.SchemaError.getValue(), e);
}
@@ -77,8 +78,8 @@ public class XmlMarshaller {
SAXSource source = new SAXSource(xmlReader, inputSource);
object = jaxbUnmarshaller.unmarshal(source, object.getClass()).getValue();
} catch (Exception e) {
- logger.error("{} {} {}", MessageEnum.GENERAL_EXCEPTION.toString(), ErrorCode.SchemaError.getValue(),
- e.getMessage(), e);
+ logger.error(LoggingAnchor.THREE, MessageEnum.GENERAL_EXCEPTION.toString(),
+ ErrorCode.SchemaError.getValue(), e.getMessage(), e);
throw new MarshallerException(e.getMessage(), ErrorCode.SchemaError.getValue(), e);
}