aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorFiete Ostkamp <Fiete.Ostkamp@telekom.de>2024-11-22 13:32:19 +0100
committerFiete Ostkamp <Fiete.Ostkamp@telekom.de>2024-11-25 10:38:07 +0100
commit2b77ba67d51b8bd6198e240dc0f653d5d2a10e65 (patch)
tree532321737dc00cac98d568f23fe80b983e34e0da /src/main
parent101f84b82fee1e1e245fb64df9269b9ebf5fd22d (diff)
Use 1.15.3-SNAPSHOT of aai-common
- upgrade spring-boot (2.6.15 -> 2.7.18) - upgrade tinkerpop (3.7.1 -> 3.7.3) - upgrade janusgraph (1.0.0 -> 1.0.1) - remove eelf-core dependency - remove aai logging-service dependency Issue-ID: AAI-4068 Change-Id: I0e0abe69fdee064c5edd57d8098e8c16fc34a776 Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/onap/aai/dataexport/DataExportTasks.java4
-rw-r--r--src/main/java/org/onap/aai/datagrooming/DataGrooming.java5
-rw-r--r--src/main/java/org/onap/aai/datasnapshot/DataSnapshot.java4
-rw-r--r--src/main/java/org/onap/aai/datasnapshot/DataSnapshot4HistInit.java5
-rw-r--r--src/main/java/org/onap/aai/dbgen/DupeTool.java5
-rw-r--r--src/main/java/org/onap/aai/dbgen/ForceDeleteTool.java5
-rw-r--r--src/main/java/org/onap/aai/dbgen/UpdatePropertyTool.java7
-rw-r--r--src/main/java/org/onap/aai/dbgen/schemamod/SchemaMod.java5
-rw-r--r--src/main/java/org/onap/aai/dbgen/schemamod/SchemaMod4Hist.java6
-rw-r--r--src/main/java/org/onap/aai/historytruncate/HistoryTruncate.java7
-rw-r--r--src/main/java/org/onap/aai/migration/MigrationControllerInternal.java5
-rw-r--r--src/main/java/org/onap/aai/rest/client/ApertureServiceNoAuthClient.java6
-rw-r--r--src/main/java/org/onap/aai/schema/GenTester.java6
-rw-r--r--src/main/java/org/onap/aai/schema/GenTester4Hist.java6
-rw-r--r--src/main/java/org/onap/aai/util/SendDeleteMigrationNotifications.java4
-rw-r--r--src/main/java/org/onap/aai/util/SendMigrationNotifications.java4
-rw-r--r--src/main/java/org/onap/aai/util/UniquePropertyCheck.java70
-rw-r--r--src/main/resources/application.properties1
18 files changed, 39 insertions, 116 deletions
diff --git a/src/main/java/org/onap/aai/dataexport/DataExportTasks.java b/src/main/java/org/onap/aai/dataexport/DataExportTasks.java
index 8d4ebb0..8386b18 100644
--- a/src/main/java/org/onap/aai/dataexport/DataExportTasks.java
+++ b/src/main/java/org/onap/aai/dataexport/DataExportTasks.java
@@ -56,7 +56,6 @@ import org.springframework.context.annotation.PropertySource;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
-import com.att.eelf.configuration.Configuration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
@@ -81,9 +80,6 @@ public class DataExportTasks {
static {
System.setProperty("aai.service.name", DataExportTasks.class.getSimpleName());
- Properties props = System.getProperties();
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_LOGBACK_PROPS);
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_BUNDLECONFIG);
LOGGER = LoggerFactory.getLogger(DataExportTasks.class);
}
diff --git a/src/main/java/org/onap/aai/datagrooming/DataGrooming.java b/src/main/java/org/onap/aai/datagrooming/DataGrooming.java
index de14ae6..796e491 100644
--- a/src/main/java/org/onap/aai/datagrooming/DataGrooming.java
+++ b/src/main/java/org/onap/aai/datagrooming/DataGrooming.java
@@ -19,7 +19,6 @@
*/
package org.onap.aai.datagrooming;
-import com.att.eelf.configuration.Configuration;
import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
import java.io.BufferedReader;
@@ -287,10 +286,6 @@ public class DataGrooming {
// Set the logging file properties to be used by EELFManager
System.setProperty("aai.service.name", DataGrooming.class.getSimpleName());
- Properties props = System.getProperties();
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_LOGBACK_PROPS);
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_BUNDLECONFIG);
-
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
PropertyPasswordConfiguration initializer = new PropertyPasswordConfiguration();
initializer.initialize(ctx);
diff --git a/src/main/java/org/onap/aai/datasnapshot/DataSnapshot.java b/src/main/java/org/onap/aai/datasnapshot/DataSnapshot.java
index 9feb6d7..3b9f7d4 100644
--- a/src/main/java/org/onap/aai/datasnapshot/DataSnapshot.java
+++ b/src/main/java/org/onap/aai/datasnapshot/DataSnapshot.java
@@ -60,7 +60,6 @@ import org.onap.aai.util.GraphAdminDBUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.att.eelf.configuration.Configuration;
import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
import com.beust.jcommander.ParameterException;
@@ -118,9 +117,6 @@ public class DataSnapshot {
// Set the logging file properties to be used by EELFManager
System.setProperty("aai.service.name", DataSnapshot.class.getSimpleName());
- Properties props = System.getProperties();
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_LOGBACK_PROPS);
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_BUNDLECONFIG);
LOGGER = LoggerFactory.getLogger(DataSnapshot.class);
cArgs = new CommandLineArgs();
diff --git a/src/main/java/org/onap/aai/datasnapshot/DataSnapshot4HistInit.java b/src/main/java/org/onap/aai/datasnapshot/DataSnapshot4HistInit.java
index fa5c6e1..b143e71 100644
--- a/src/main/java/org/onap/aai/datasnapshot/DataSnapshot4HistInit.java
+++ b/src/main/java/org/onap/aai/datasnapshot/DataSnapshot4HistInit.java
@@ -67,7 +67,6 @@ import org.onap.aai.util.FormatDate;
import org.onap.aai.util.GraphAdminDBUtils;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
-import com.att.eelf.configuration.Configuration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.beust.jcommander.JCommander;
@@ -112,10 +111,6 @@ public class DataSnapshot4HistInit {
// Set the logging file properties to be used by EELFManager
System.setProperty("aai.service.name", DataSnapshot4HistInit.class.getSimpleName());
- Properties props = System.getProperties();
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_LOGBACK_PROPS);
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_BUNDLECONFIG);
-
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
PropertyPasswordConfiguration initializer = new PropertyPasswordConfiguration();
diff --git a/src/main/java/org/onap/aai/dbgen/DupeTool.java b/src/main/java/org/onap/aai/dbgen/DupeTool.java
index f442eac..8dbe1c6 100644
--- a/src/main/java/org/onap/aai/dbgen/DupeTool.java
+++ b/src/main/java/org/onap/aai/dbgen/DupeTool.java
@@ -19,7 +19,6 @@
*/
package org.onap.aai.dbgen;
-import com.att.eelf.configuration.Configuration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
@@ -462,10 +461,6 @@ public class DupeTool {
public static void main(String[] args) throws AAIException {
System.setProperty("aai.service.name", DupeTool.class.getSimpleName());
- // Set the logging file properties to be used by EELFManager
- Properties props = System.getProperties();
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, "dupeTool-logback.xml");
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_BUNDLECONFIG);
MDC.put("logFilenameAppender", DupeTool.class.getSimpleName());
diff --git a/src/main/java/org/onap/aai/dbgen/ForceDeleteTool.java b/src/main/java/org/onap/aai/dbgen/ForceDeleteTool.java
index 451e344..b1b70f0 100644
--- a/src/main/java/org/onap/aai/dbgen/ForceDeleteTool.java
+++ b/src/main/java/org/onap/aai/dbgen/ForceDeleteTool.java
@@ -44,7 +44,6 @@ import org.onap.aai.util.AAIConfig;
import org.onap.aai.util.AAIConstants;
import org.slf4j.MDC;
-import com.att.eelf.configuration.Configuration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.janusgraph.core.JanusGraphFactory;
@@ -78,10 +77,6 @@ public class ForceDeleteTool {
// the Terminal.
System.setProperty("aai.service.name", ForceDelete.class.getSimpleName());
- // Set the logging file properties to be used by EELFManager
- Properties props = System.getProperties();
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_FORCE_DELETE_LOGBACK_PROPS);
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_BUNDLECONFIG);
Logger logger = LoggerFactory.getLogger(ForceDeleteTool.class.getSimpleName());
MDC.put("logFilenameAppender", ForceDeleteTool.class.getSimpleName());
diff --git a/src/main/java/org/onap/aai/dbgen/UpdatePropertyTool.java b/src/main/java/org/onap/aai/dbgen/UpdatePropertyTool.java
index 9a6094b..bb1908c 100644
--- a/src/main/java/org/onap/aai/dbgen/UpdatePropertyTool.java
+++ b/src/main/java/org/onap/aai/dbgen/UpdatePropertyTool.java
@@ -22,7 +22,6 @@ package org.onap.aai.dbgen;
import org.janusgraph.core.JanusGraph;
import org.onap.aai.util.AAIConstants;
-import com.att.eelf.configuration.Configuration;
import org.slf4j.MDC;
import java.util.Properties;
@@ -55,10 +54,6 @@ public class UpdatePropertyTool {
public static void main(String[] args)
{
System.setProperty("aai.service.name", UpdatePropertyTool.class.getSimpleName());
- // Set the logging file properties to be used by EELFManager
- Properties props = System.getProperties();
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, PROPERTY_LOGGING_FILE_NAME);
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_BUNDLECONFIG);
MDC.put("logFilenameAppender", UpdatePropertyTool.class.getSimpleName());
@@ -76,4 +71,4 @@ public class UpdatePropertyTool {
exit(EXIT_VM_STATUS_CODE);
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/org/onap/aai/dbgen/schemamod/SchemaMod.java b/src/main/java/org/onap/aai/dbgen/schemamod/SchemaMod.java
index 50d195f..4a2dcb6 100644
--- a/src/main/java/org/onap/aai/dbgen/schemamod/SchemaMod.java
+++ b/src/main/java/org/onap/aai/dbgen/schemamod/SchemaMod.java
@@ -19,7 +19,6 @@
*/
package org.onap.aai.dbgen.schemamod;
-import com.att.eelf.configuration.Configuration;
import org.onap.aai.restclient.PropertyPasswordConfiguration;
import org.onap.aai.exceptions.AAIException;
import org.onap.aai.introspection.Loader;
@@ -174,10 +173,6 @@ public class SchemaMod {
public static void main(String[] args) throws AAIException {
- Properties props = System.getProperties();
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_SCHEMA_MOD_LOGBACK_PROPS);
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_BUNDLECONFIG);
-
MDC.put("logFilenameAppender", SchemaMod.class.getSimpleName());
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
diff --git a/src/main/java/org/onap/aai/dbgen/schemamod/SchemaMod4Hist.java b/src/main/java/org/onap/aai/dbgen/schemamod/SchemaMod4Hist.java
index eacdb13..bb8e653 100644
--- a/src/main/java/org/onap/aai/dbgen/schemamod/SchemaMod4Hist.java
+++ b/src/main/java/org/onap/aai/dbgen/schemamod/SchemaMod4Hist.java
@@ -19,7 +19,6 @@
*/
package org.onap.aai.dbgen.schemamod;
-import com.att.eelf.configuration.Configuration;
import org.onap.aai.restclient.PropertyPasswordConfiguration;
import org.onap.aai.exceptions.AAIException;
import org.onap.aai.introspection.Loader;
@@ -57,11 +56,6 @@ public class SchemaMod4Hist {
public void execute(String[] args) {
- // Set the logging file properties to be used by EELFManager
- Properties props = System.getProperties();
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_SCHEMA_MOD_LOGBACK_PROPS);
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_BUNDLECONFIG);
-
Logger logger = LoggerFactory.getLogger(SchemaMod4Hist.class.getSimpleName());
MDC.put("logFilenameAppender", SchemaMod4Hist.class.getSimpleName());
diff --git a/src/main/java/org/onap/aai/historytruncate/HistoryTruncate.java b/src/main/java/org/onap/aai/historytruncate/HistoryTruncate.java
index b2a3c91..8796ec5 100644
--- a/src/main/java/org/onap/aai/historytruncate/HistoryTruncate.java
+++ b/src/main/java/org/onap/aai/historytruncate/HistoryTruncate.java
@@ -39,7 +39,6 @@ import org.onap.aai.util.AAIConstants;
import org.onap.aai.util.AAISystemExitUtil;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
-import com.att.eelf.configuration.Configuration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.janusgraph.core.JanusGraph;
@@ -74,12 +73,6 @@ public class HistoryTruncate {
*/
public static void main(String[] args) {
- // Set the logging file properties to be used by EELFManager
- System.setProperty("aai.service.name", HistoryTruncate.class.getSimpleName());
- Properties props = System.getProperties();
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_LOGBACK_PROPS);
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_BUNDLECONFIG);
-
try (AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext()) {
try {
ctx.refresh();
diff --git a/src/main/java/org/onap/aai/migration/MigrationControllerInternal.java b/src/main/java/org/onap/aai/migration/MigrationControllerInternal.java
index 7a170c3..47e7544 100644
--- a/src/main/java/org/onap/aai/migration/MigrationControllerInternal.java
+++ b/src/main/java/org/onap/aai/migration/MigrationControllerInternal.java
@@ -20,7 +20,6 @@
package org.onap.aai.migration;
-import com.att.eelf.configuration.Configuration;
import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
import org.apache.commons.configuration2.ex.ConfigurationException;
@@ -97,10 +96,6 @@ public class MigrationControllerInternal {
public void run(String[] args) {
// Set the logging file properties to be used by EELFManager
System.setProperty("aai.service.name", MigrationController.class.getSimpleName());
- Properties props = System.getProperties();
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, "migration-logback.xml");
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_ETC_APP_PROPERTIES);
-
MDC.put("logFilenameAppender", MigrationController.class.getSimpleName());
logger = LoggerFactory.getLogger(MigrationControllerInternal.class.getSimpleName());
diff --git a/src/main/java/org/onap/aai/rest/client/ApertureServiceNoAuthClient.java b/src/main/java/org/onap/aai/rest/client/ApertureServiceNoAuthClient.java
index 778a821..703420e 100644
--- a/src/main/java/org/onap/aai/rest/client/ApertureServiceNoAuthClient.java
+++ b/src/main/java/org/onap/aai/rest/client/ApertureServiceNoAuthClient.java
@@ -20,9 +20,9 @@
package org.onap.aai.rest.client;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
import org.onap.aai.restclient.NoAuthRestClient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
@@ -35,7 +35,7 @@ import java.util.UUID;
public class ApertureServiceNoAuthClient extends NoAuthRestClient {
- private static EELFLogger logger = EELFManager.getInstance().getLogger(ApertureServiceNoAuthClient.class);
+ private static Logger logger = LoggerFactory.getLogger(ApertureServiceNoAuthClient.class);
@Value("${aperture.service.base.url}")
private String baseUrl;
diff --git a/src/main/java/org/onap/aai/schema/GenTester.java b/src/main/java/org/onap/aai/schema/GenTester.java
index 6674610..7fffd05 100644
--- a/src/main/java/org/onap/aai/schema/GenTester.java
+++ b/src/main/java/org/onap/aai/schema/GenTester.java
@@ -19,7 +19,6 @@
*/
package org.onap.aai.schema;
-import com.att.eelf.configuration.Configuration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.janusgraph.core.EdgeLabel;
@@ -57,10 +56,7 @@ public class GenTester {
JanusGraph graph = null;
System.setProperty("aai.service.name", GenTester.class.getSimpleName());
- // Set the logging file properties to be used by EELFManager
- Properties props = System.getProperties();
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_LOGBACK_PROPS);
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_BUNDLECONFIG);
+
LOGGER = LoggerFactory.getLogger(GenTester.class);
boolean addDefaultCR = true;
diff --git a/src/main/java/org/onap/aai/schema/GenTester4Hist.java b/src/main/java/org/onap/aai/schema/GenTester4Hist.java
index 65dc35e..adfbe90 100644
--- a/src/main/java/org/onap/aai/schema/GenTester4Hist.java
+++ b/src/main/java/org/onap/aai/schema/GenTester4Hist.java
@@ -19,7 +19,6 @@
*/
package org.onap.aai.schema;
-import com.att.eelf.configuration.Configuration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.janusgraph.core.JanusGraph;
@@ -50,10 +49,7 @@ public class GenTester4Hist {
JanusGraph graph = null;
System.setProperty("aai.service.name", GenTester4Hist.class.getSimpleName());
- // Set the logging file properties to be used by EELFManager
- Properties props = System.getProperties();
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_LOGBACK_PROPS);
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_BUNDLECONFIG);
+
LOGGER = LoggerFactory.getLogger(GenTester4Hist.class);
boolean addDefaultCR = false; // For History, we do not add the default CloudRegion
diff --git a/src/main/java/org/onap/aai/util/SendDeleteMigrationNotifications.java b/src/main/java/org/onap/aai/util/SendDeleteMigrationNotifications.java
index 6cb6ed6..0fd75dc 100644
--- a/src/main/java/org/onap/aai/util/SendDeleteMigrationNotifications.java
+++ b/src/main/java/org/onap/aai/util/SendDeleteMigrationNotifications.java
@@ -19,7 +19,6 @@
*/
package org.onap.aai.util;
-import com.att.eelf.configuration.Configuration;
import org.onap.aai.config.SpringContextAware;
import org.onap.aai.dbmap.AAIGraph;
@@ -72,9 +71,6 @@ public class SendDeleteMigrationNotifications {
public SendDeleteMigrationNotifications(LoaderFactory loaderFactory, SchemaVersions schemaVersions, String config, String path, int sleepInMilliSecs, int numToBatch, String requestId, EventAction eventAction, String eventSource) {
System.setProperty("aai.service.name", SendDeleteMigrationNotifications.class.getSimpleName());
- Properties props = System.getProperties();
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, "migration-logback.xml");
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_ETC_APP_PROPERTIES);
MDC.put("logFilenameAppender", SendDeleteMigrationNotifications.class.getSimpleName());
diff --git a/src/main/java/org/onap/aai/util/SendMigrationNotifications.java b/src/main/java/org/onap/aai/util/SendMigrationNotifications.java
index a66e491..a138402 100644
--- a/src/main/java/org/onap/aai/util/SendMigrationNotifications.java
+++ b/src/main/java/org/onap/aai/util/SendMigrationNotifications.java
@@ -19,7 +19,6 @@
*/
package org.onap.aai.util;
-import com.att.eelf.configuration.Configuration;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.onap.aai.config.SpringContextAware;
@@ -74,9 +73,6 @@ public class SendMigrationNotifications {
public SendMigrationNotifications(LoaderFactory loaderFactory, SchemaVersions schemaVersions, String config, String path, Set<String> notifyOn, int sleepInMilliSecs, int numToBatch, String requestId, EventAction eventAction, String eventSource) {
System.setProperty("aai.service.name", SendMigrationNotifications.class.getSimpleName());
- Properties props = System.getProperties();
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, "migration-logback.xml");
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_ETC_APP_PROPERTIES);
MDC.put("logFilenameAppender", SendMigrationNotifications.class.getSimpleName());
diff --git a/src/main/java/org/onap/aai/util/UniquePropertyCheck.java b/src/main/java/org/onap/aai/util/UniquePropertyCheck.java
index 20432e6..8dfa706 100644
--- a/src/main/java/org/onap/aai/util/UniquePropertyCheck.java
+++ b/src/main/java/org/onap/aai/util/UniquePropertyCheck.java
@@ -39,26 +39,20 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
-import com.att.eelf.configuration.Configuration;
-
public class UniquePropertyCheck {
private static final String FROMAPPID = "AAI-UTILS";
private static final String TRANSID = UUID.randomUUID().toString();
private static final String COMPONENT = "UniquePropertyCheck";
-
+
/**
* The main method.
*
* @param args the arguments
*/
public static void main(String[] args) {
-
-
- Properties props = System.getProperties();
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_LOGBACK_PROPS);
- props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_BUNDLECONFIG);
+
Logger logger = LoggerFactory.getLogger(UniquePropertyCheck.class);
MDC.put("logFilenameAppender", UniquePropertyCheck.class.getSimpleName());
AaiScheduledTaskAuditLog auditLog = new AaiScheduledTaskAuditLog();
@@ -72,7 +66,7 @@ public class UniquePropertyCheck {
}
String propertyName = args[0];
Graph graph = null;
-
+
try(JanusGraph tGraph = JanusGraphFactory.open(new AAIGraphConfig.Builder(AAIConstants.REALTIME_DB_CONFIG).forService(UniquePropertyCheck.class.getSimpleName()).withGraphType("realtime").buildConfiguration())) {
AAIConfig.init();
System.out.println(" ---- NOTE --- about to open graph (takes a little while)--------\n");
@@ -81,7 +75,7 @@ public class UniquePropertyCheck {
logAndPrint(logger, " Error: Could not get JanusGraph ");
System.exit(1);
}
-
+
graph = tGraph.newTransaction();
if( graph == null ){
logAndPrint(logger, "could not get graph object in UniquePropertyCheck() \n");
@@ -98,14 +92,14 @@ public class UniquePropertyCheck {
logAndPrint(logger, msg);
System.exit(0);
}
-
+
runTheCheckForUniqueness( TRANSID, FROMAPPID, graph, propertyName, logger );
auditLog.logAfter();
System.exit(0);
-
+
}// End main()
-
-
+
+
/**
* Run the check for uniqueness.
*
@@ -116,17 +110,17 @@ public class UniquePropertyCheck {
* @param logger the logger
* @return the boolean
*/
- public static Boolean runTheCheckForUniqueness( String transId, String fromAppId, Graph graph,
+ public static Boolean runTheCheckForUniqueness( String transId, String fromAppId, Graph graph,
String propertyName, Logger logger ){
-
- // Note - property can be found in more than one nodetype
- // our uniqueness constraints are always across the entire db - so this
+
+ // Note - property can be found in more than one nodetype
+ // our uniqueness constraints are always across the entire db - so this
// tool looks across all nodeTypes that the property is found in.
Boolean foundDupesFlag = false;
-
+
HashMap <String,String> valuesAndVidHash = new HashMap <> ();
HashMap <String,String> dupeHash = new HashMap <> ();
-
+
int propCount = 0;
int dupeCount = 0;
Iterator<Vertex> vertItor = graph.traversal().V().has(propertyName);
@@ -151,10 +145,10 @@ public class UniquePropertyCheck {
}
else {
valuesAndVidHash.put(val.toString(), thisVid);
- }
+ }
}
-
-
+
+
String info = "\n Found this property [" + propertyName + "] " + propCount + " times in our db.";
logAndPrint(logger, info);
info = " Found " + dupeCount + " cases of duplicate values for this property.\n\n";
@@ -169,9 +163,9 @@ public class UniquePropertyCheck {
String dupeValue = pair.getKey().toString();
String vidsStr = pair.getValue().toString();
String[] vidArr = vidsStr.split("\\|");
- logAndPrint(logger, "\n\n -------------- Found " + vidArr.length
+ logAndPrint(logger, "\n\n -------------- Found " + vidArr.length
+ " nodes with " + propertyName + " of this value: [" + dupeValue + "]. Node details: ");
-
+
for( int i = 0; i < vidArr.length; i++ ){
String vidString = vidArr[i];
Long idLong = Long.valueOf(vidString);
@@ -183,14 +177,14 @@ public class UniquePropertyCheck {
}
catch( Exception e2 ){
logAndPrint(logger, "Threw Exception: [" + e2.toString() + "]");
- }
-
-
+ }
+
+
return foundDupesFlag;
-
+
}// end of runTheCheckForUniqueness()
-
-
+
+
/**
* Show properties and edges.
*
@@ -200,7 +194,7 @@ public class UniquePropertyCheck {
* @param logger the logger
*/
private static void showPropertiesAndEdges( String transId, String fromAppId, Vertex tVert,
- Logger logger ){
+ Logger logger ){
if( tVert == null ){
logAndPrint(logger, "Null node passed to showPropertiesAndEdges.");
@@ -214,16 +208,16 @@ public class UniquePropertyCheck {
else{
nodeType = ob.toString();
}
-
+
logAndPrint(logger, " AAINodeType/VtxID for this Node = [" + nodeType + "/" + tVert.id() + "]");
logAndPrint(logger, " Property Detail: ");
Iterator<VertexProperty<Object>> pI = tVert.properties();
while( pI.hasNext() ){
VertexProperty<Object> tp = pI.next();
Object val = tp.value();
- logAndPrint(logger, "Prop: [" + tp.key() + "], val = [" + val + "] ");
+ logAndPrint(logger, "Prop: [" + tp.key() + "], val = [" + val + "] ");
}
-
+
Iterator <Edge> eI = tVert.edges(Direction.BOTH);
if( ! eI.hasNext() ){
logAndPrint(logger, "No edges were found for this vertex. ");
@@ -249,7 +243,7 @@ public class UniquePropertyCheck {
}
} // End of showPropertiesAndEdges()
-
+
/**
* Log and print.
*
@@ -260,5 +254,5 @@ public class UniquePropertyCheck {
System.out.println(msg);
logger.info(msg);
}
-
-} \ No newline at end of file
+
+}
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index 0fda84d..d0a7d63 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -111,3 +111,4 @@ aai.notifications.enabled=false
BOOTSTRAP_SERVERS=localhost:9092
JAAS_CONFIG=
+aai.graph.properties.path=${server.local.startpath}/etc/appprops/janusgraph-realtime.properties