diff options
author | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2024-10-13 15:27:43 +0200 |
---|---|---|
committer | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2024-10-17 09:53:19 +0200 |
commit | d567ebe4b4f74ad9ac442cca27c361c971c67e1e (patch) | |
tree | c78c964e0a7e06dcdba9ef355aca35421b1e19a8 | |
parent | ad17eaad323295cd61effc6bb9931e872b9b2d92 (diff) |
Upgrade aai-common dependency to 1.15.1-SNAPSHOT
- remove ActiveMq dependency
Issue-ID: AAI-4017
Change-Id: Ie475172ad13bc5ddd482822db36f1ce48bc846c9
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
-rwxr-xr-x | pom.xml | 41 | ||||
-rw-r--r-- | src/main/java/org/onap/aai/migration/Migrator.java | 35 | ||||
-rw-r--r-- | src/main/java/org/onap/aai/migration/NotificationHelper.java | 9 | ||||
-rw-r--r-- | src/main/java/org/onap/aai/util/SendDeleteMigrationNotifications.java | 10 | ||||
-rw-r--r-- | src/main/java/org/onap/aai/util/SendMigrationNotifications.java | 7 | ||||
-rw-r--r-- | src/main/resources/application.properties | 6 | ||||
-rw-r--r-- | src/main/resources/etc/appprops/aaiconfig.properties | 4 | ||||
-rw-r--r-- | src/test/java/org/onap/aai/AAISetup.java | 3 | ||||
-rw-r--r-- | src/test/java/org/onap/aai/util/SendMigrationNotificationsTest.java | 8 | ||||
-rw-r--r-- | src/test/resources/application-test.properties | 5 | ||||
-rw-r--r-- | src/test/resources/etc/appprops/aaiconfig.properties | 4 | ||||
-rw-r--r-- | version.properties | 4 |
12 files changed, 55 insertions, 81 deletions
@@ -26,11 +26,11 @@ <parent> <groupId>org.onap.aai.aai-common</groupId> <artifactId>aai-parent</artifactId> - <version>1.15.0</version> + <version>1.15.1-SNAPSHOT</version> </parent> <groupId>org.onap.aai.graphadmin</groupId> <artifactId>aai-graphadmin</artifactId> - <version>1.15.0-SNAPSHOT</version> + <version>1.15.1-SNAPSHOT</version> <properties> @@ -55,7 +55,7 @@ <docker.push.registry>localhost:5000</docker.push.registry> <aai.docker.version>1.0.0</aai.docker.version> <aai.schema.service.version>1.12.5</aai.schema.service.version> - <aai.common.version>1.15.0</aai.common.version> + <aai.common.version>1.15.1-SNAPSHOT</aai.common.version> <aai.build.directory>${project.build.directory}/${project.artifactId}-${project.version}-build/ </aai.build.directory> <aai.docker.namespace>onap</aai.docker.namespace> @@ -98,7 +98,6 @@ <!-- End of Default ONAP Schema Properties --> <micrometer.version>1.8.1</micrometer.version> - <activemq.version>5.16.7</activemq.version> <antlr.version>4.9.3</antlr.version> <jcommander.version>1.78</jcommander.version> <gremlin.version>3.7.1</gremlin.version> @@ -374,11 +373,6 @@ <!-- End of graphadmin metric collection dependencies --> <dependency> - <groupId>javax.jms</groupId> - <artifactId>javax.jms-api</artifactId> - <version>2.0.1</version> - </dependency> - <dependency> <groupId>org.onap.aai.aai-common</groupId> <artifactId>aai-core</artifactId> <exclusions> @@ -387,10 +381,6 @@ <artifactId>metrics-jmx</artifactId> </exclusion> <exclusion> - <groupId>org.onap.aai.aai-common</groupId> - <artifactId>aai-aaf-auth</artifactId> - </exclusion> - <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> </exclusion> @@ -521,21 +511,6 @@ <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> </dependency> - <!-- - Do not use activemq-all because they force you to use a specific logging - and they shade it so you can't simply exclude it and when you deploy the - jar, you will notice failure - --> - <dependency> - <groupId>org.apache.activemq</groupId> - <artifactId>activemq-broker</artifactId> - <version>${activemq.version}</version> - </dependency> - <dependency> - <groupId>org.apache.activemq</groupId> - <artifactId>activemq-client</artifactId> - <version>${activemq.version}</version> - </dependency> <!-- Do not use the jersey-client since jersey client 1.0 version clashes with jersey 2 which we are using --> <!-- Use this to make http requests instead of jersey 1.0 client --> @@ -563,16 +538,6 @@ </exclusions> </dependency> <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-jms</artifactId> - <exclusions> - <exclusion> - <groupId>com.sun.jersey</groupId> - <artifactId>jersey-core</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> diff --git a/src/main/java/org/onap/aai/migration/Migrator.java b/src/main/java/org/onap/aai/migration/Migrator.java index 57291e0..ca9af63 100644 --- a/src/main/java/org/onap/aai/migration/Migrator.java +++ b/src/main/java/org/onap/aai/migration/Migrator.java @@ -38,6 +38,7 @@ import org.apache.tinkerpop.gremlin.structure.VertexProperty; import org.json.JSONException; import org.json.JSONObject; import org.onap.aai.aailog.logs.AaiDebugLog; +import org.onap.aai.config.SpringContextAware; import org.onap.aai.edges.EdgeIngestor; import org.onap.aai.edges.enums.EdgeType; import org.onap.aai.edges.exceptions.AmbiguousRuleChoiceException; @@ -47,6 +48,7 @@ import org.onap.aai.introspection.Introspector; import org.onap.aai.introspection.Loader; import org.onap.aai.introspection.LoaderFactory; import org.onap.aai.introspection.ModelType; +import org.onap.aai.kafka.NotificationProducer; import org.onap.aai.serialization.db.DBSerializer; import org.onap.aai.serialization.db.EdgeSerializer; import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException; @@ -63,7 +65,7 @@ import org.slf4j.MDC; @MigrationPriority(0) @MigrationDangerRating(0) public abstract class Migrator implements Runnable { - + protected Logger logger = null; protected DBSerializer serializer = null; @@ -80,7 +82,7 @@ public abstract class Migrator implements Runnable { protected static final String MIGRATION_ERROR = "Migration Error: "; protected static final String MIGRATION_SUMMARY_COUNT = "Migration Summary Count: "; - + private static AaiDebugLog debugLog = new AaiDebugLog(); static { debugLog.setupMDC(); @@ -99,8 +101,9 @@ public abstract class Migrator implements Runnable { this.edgeIngestor = edgeIngestor; this.edgeSerializer = edgeSerializer; this.schemaVersions = schemaVersions; - initDBSerializer(); - this.notificationHelper = new NotificationHelper(loader, serializer, loaderFactory, schemaVersions, engine, "AAI-MIGRATION", this.getMigrationName()); + initDBSerializer(); + NotificationProducer notificationProducer = SpringContextAware.getBean(NotificationProducer.class); + this.notificationHelper = new NotificationHelper(notificationProducer, loader, serializer, loaderFactory, schemaVersions, engine, "AAI-MIGRATION", this.getMigrationName()); MDC.put("logFilenameAppender", this.getClass().getSimpleName()); logger = LoggerFactory.getLogger(this.getClass().getSimpleName()); logAndPrint(logger,"\tInitilization of " + this.getClass().getSimpleName() + " migration script complete."); @@ -141,8 +144,8 @@ public abstract class Migrator implements Runnable { if (dmaapMsgList.size() > 0) { try { Files.write(Paths.get(logDirectory+"/"+fileName), (Iterable<String>)dmaapMsgList.stream()::iterator); - } catch (IOException e) { - System.out.println("Unable to generate file with dmaap msgs for " + getMigrationName() + + } catch (IOException e) { + System.out.println("Unable to generate file with dmaap msgs for " + getMigrationName() + " Exception is: " + e.getMessage()); logger.error("Unable to generate file with dmaap msgs for " + getMigrationName(), e); } @@ -299,7 +302,7 @@ public abstract class Migrator implements Runnable { } } - + /** * Creates the edge * @@ -321,7 +324,7 @@ public abstract class Migrator implements Runnable { } return newEdge; } - + /** * Creates the edge * @@ -363,7 +366,7 @@ public abstract class Migrator implements Runnable { } /** - * Creates the TREE edge + * Creates the TREE edge * * @param out the out * @param in the in @@ -373,9 +376,9 @@ public abstract class Migrator implements Runnable { Edge newEdge = createEdge(EdgeType.TREE, out, in); return newEdge; } - + /** - * Creates the COUSIN edge + * Creates the COUSIN edge * * @param out the out * @param in the in @@ -396,19 +399,19 @@ public abstract class Migrator implements Runnable { throw new RuntimeException("could not create seralizer", e); } } - + /** * These are the node types you would like your traversal to process * @return */ public abstract Optional<String[]> getAffectedNodeTypes(); - + /** * used as the "fromAppId" when modifying vertices * @return */ public abstract String getMigrationName(); - + /** * updates all internal vertex properties * @param v @@ -417,11 +420,11 @@ public abstract class Migrator implements Runnable { protected void touchVertexProperties(Vertex v, boolean isNewVertex) { this.serializer.touchStandardVertexProperties(v, isNewVertex); } - + public NotificationHelper getNotificationHelper() { return this.notificationHelper; } - + /** * Log and print. * diff --git a/src/main/java/org/onap/aai/migration/NotificationHelper.java b/src/main/java/org/onap/aai/migration/NotificationHelper.java index 817e5df..de13dbb 100644 --- a/src/main/java/org/onap/aai/migration/NotificationHelper.java +++ b/src/main/java/org/onap/aai/migration/NotificationHelper.java @@ -32,6 +32,7 @@ import org.onap.aai.introspection.Introspector; import org.onap.aai.introspection.Loader; import org.onap.aai.introspection.LoaderFactory; import org.onap.aai.introspection.exceptions.AAIUnknownObjectException; +import org.onap.aai.kafka.NotificationProducer; import org.onap.aai.rest.notification.UEBNotification; import org.onap.aai.serialization.db.DBSerializer; import org.onap.aai.serialization.engines.TransactionalGraphEngine; @@ -54,14 +55,16 @@ public class NotificationHelper { protected final String transactionId; protected final String sourceOfTruth; protected final UEBNotification notification; + protected final NotificationProducer notificationProducer; - public NotificationHelper(Loader loader, DBSerializer serializer, LoaderFactory loaderFactory, SchemaVersions schemaVersions, TransactionalGraphEngine engine, String transactionId, String sourceOfTruth) { + public NotificationHelper(NotificationProducer notificationProducer, Loader loader, DBSerializer serializer, LoaderFactory loaderFactory, SchemaVersions schemaVersions, TransactionalGraphEngine engine, String transactionId, String sourceOfTruth) { this.loader = loader; this.serializer = serializer; this.engine = engine; this.transactionId = transactionId; this.sourceOfTruth = sourceOfTruth; - this.notification = new UEBNotification(loader, loaderFactory, schemaVersions); + this.notification = new UEBNotification(loaderFactory, schemaVersions); + this.notificationProducer = notificationProducer; MDC.put("logFilenameAppender", this.getClass().getSimpleName()); LOGGER = LoggerFactory.getLogger(this.getClass().getSimpleName()); @@ -113,7 +116,7 @@ public class NotificationHelper { } public void triggerEvents() throws AAIException { - notification.triggerEvents(); + notificationProducer.sendUEBNotification(notification); } public UEBNotification getNotifications() { diff --git a/src/main/java/org/onap/aai/util/SendDeleteMigrationNotifications.java b/src/main/java/org/onap/aai/util/SendDeleteMigrationNotifications.java index 865dc27..6cb6ed6 100644 --- a/src/main/java/org/onap/aai/util/SendDeleteMigrationNotifications.java +++ b/src/main/java/org/onap/aai/util/SendDeleteMigrationNotifications.java @@ -20,12 +20,15 @@ package org.onap.aai.util; import com.att.eelf.configuration.Configuration; + +import org.onap.aai.config.SpringContextAware; import org.onap.aai.dbmap.AAIGraph; import org.onap.aai.exceptions.AAIException; import org.onap.aai.introspection.Introspector; import org.onap.aai.introspection.Loader; import org.onap.aai.introspection.LoaderFactory; import org.onap.aai.introspection.ModelType; +import org.onap.aai.kafka.NotificationProducer; import org.onap.aai.migration.EventAction; import org.onap.aai.migration.NotificationHelper; import org.onap.aai.serialization.db.DBSerializer; @@ -66,7 +69,7 @@ public class SendDeleteMigrationNotifications { protected final LoaderFactory loaderFactory; protected final SchemaVersions schemaVersions; protected final SchemaVersion version; - + 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(); @@ -157,7 +160,8 @@ public class SendDeleteMigrationNotifications { } catch (AAIException e) { throw new RuntimeException("could not create serializer", e); } - this.notificationHelper = new NotificationHelper(loader, serializer, loaderFactory, schemaVersions, engine, requestId, this.eventSource); + NotificationProducer notificationProducer = SpringContextAware.getBean(NotificationProducer.class); + this.notificationHelper = new NotificationHelper(notificationProducer, loader, serializer, loaderFactory, schemaVersions, engine, requestId, this.eventSource); } protected void initGraph() { @@ -173,4 +177,4 @@ public class SendDeleteMigrationNotifications { } -}
\ No newline at end of file +} diff --git a/src/main/java/org/onap/aai/util/SendMigrationNotifications.java b/src/main/java/org/onap/aai/util/SendMigrationNotifications.java index c51de1e..a66e491 100644 --- a/src/main/java/org/onap/aai/util/SendMigrationNotifications.java +++ b/src/main/java/org/onap/aai/util/SendMigrationNotifications.java @@ -22,6 +22,7 @@ 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; import org.onap.aai.db.props.AAIProperties; import org.onap.aai.dbmap.AAIGraph; import org.onap.aai.exceptions.AAIException; @@ -29,6 +30,7 @@ import org.onap.aai.introspection.Introspector; import org.onap.aai.introspection.Loader; import org.onap.aai.introspection.LoaderFactory; import org.onap.aai.introspection.ModelType; +import org.onap.aai.kafka.NotificationProducer; import org.onap.aai.migration.EventAction; import org.onap.aai.migration.NotificationHelper; import org.onap.aai.serialization.db.DBSerializer; @@ -172,7 +174,8 @@ public class SendMigrationNotifications { } catch (AAIException e) { throw new RuntimeException("could not create serializer", e); } - this.notificationHelper = new NotificationHelper(loader, serializer, loaderFactory, schemaVersions, engine, requestId, this.eventSource); + NotificationProducer notificationProducer = SpringContextAware.getBean(NotificationProducer.class); + this.notificationHelper = new NotificationHelper(notificationProducer, loader, serializer, loaderFactory, schemaVersions, engine, requestId, this.eventSource); } protected void initGraph() { @@ -188,4 +191,4 @@ public class SendMigrationNotifications { } -}
\ No newline at end of file +} diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 47ab0bc..ba35da5 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -32,9 +32,6 @@ server.ssl.trust-store-password=password(OBF:1vn21ugu1saj1v9i1v941sar1ugw1vo0) server.ssl.client-auth=want server.ssl.key-store-type=JKS -# JMS bind address host port -jms.bind.address=tcp://localhost:61450 - # dmaap is deprecated and now replaced with kafka spring.kafka.producer.bootstrap-servers=${BOOTSTRAP_SERVERS} spring.kafka.producer.properties.security.protocol=SASL_PLAINTEXT @@ -109,4 +106,7 @@ management.metrics.web.server.auto-time-requests=false # but doesn't show up in micrometer metrics aai.actuator.echo.enabled=false +aai.notifications.enabled=false +BOOTSTRAP_SERVERS=localhost:9092 +JAAS_CONFIG= diff --git a/src/main/resources/etc/appprops/aaiconfig.properties b/src/main/resources/etc/appprops/aaiconfig.properties index b2dd2ed..235cbda 100644 --- a/src/main/resources/etc/appprops/aaiconfig.properties +++ b/src/main/resources/etc/appprops/aaiconfig.properties @@ -65,7 +65,7 @@ aai.default.api.version=v14 aai.model.delete.sleep.per.vtx.msec=500 aai.model.query.resultset.maxcount=50 aai.model.query.timeout.sec=90 - + # Used by Data Grooming aai.grooming.default.max.fix=150 aai.grooming.default.sleep.minutes=7 @@ -90,8 +90,6 @@ aai.forceDel.protected.descendant.count=10 aai.ctagPool.rangeString.vplsPe1=2001-2500 aai.ctagPool.rangeString.vplsPe2=2501-3000 -aai.jms.enable=false - #used by the dataGrooming and dataSnapshot cleanup tasks aai.cron.enable.datagroomingcleanup=true aai.cron.enable.datasnapshotcleanup=true diff --git a/src/test/java/org/onap/aai/AAISetup.java b/src/test/java/org/onap/aai/AAISetup.java index 49cc6c4..f0b78f2 100644 --- a/src/test/java/org/onap/aai/AAISetup.java +++ b/src/test/java/org/onap/aai/AAISetup.java @@ -64,7 +64,8 @@ import java.util.Map; XmlFormatTransformerConfiguration.class, RestBeanConfig.class, LoaderFactory.class, - NotificationService.class + NotificationService.class, + KafkaConfig.class }) @TestPropertySource(properties = { "schema.uri.base.path = /aai", diff --git a/src/test/java/org/onap/aai/util/SendMigrationNotificationsTest.java b/src/test/java/org/onap/aai/util/SendMigrationNotificationsTest.java index 2f6a4e0..eb2e2a3 100644 --- a/src/test/java/org/onap/aai/util/SendMigrationNotificationsTest.java +++ b/src/test/java/org/onap/aai/util/SendMigrationNotificationsTest.java @@ -138,7 +138,7 @@ public class SendMigrationNotificationsTest extends AAISetup { @Test public void processEverything() throws Exception { SendMigrationNotifications s = spy(new SendMigrationNotifications( - loaderFactory, schemaVersions, REALTIME_CONFIG, FILE, Collections.EMPTY_SET, 0, 0, "test", EventAction.UPDATE, "DMAAP-LOAD")); + loaderFactory, schemaVersions, REALTIME_CONFIG, FILE, Collections.emptySet(), 0, 0, "test", EventAction.UPDATE, "DMAAP-LOAD")); doNothing().when(s).trigger(); doNothing().when(s).cleanup(); s.process("/aai/"); @@ -171,7 +171,7 @@ public class SendMigrationNotificationsTest extends AAISetup { @Test public void processEverythingBatched2() throws Exception { SendMigrationNotifications s = spy(new SendMigrationNotifications( - loaderFactory, schemaVersions, REALTIME_CONFIG, FILE, Collections.EMPTY_SET, 0, 2, "test", EventAction.UPDATE, "DMAAP-LOAD")); + loaderFactory, schemaVersions, REALTIME_CONFIG, FILE, Collections.emptySet(), 0, 2, "test", EventAction.UPDATE, "DMAAP-LOAD")); doNothing().when(s).trigger(); doNothing().when(s).cleanup(); s.process("/aai/"); @@ -182,7 +182,7 @@ public class SendMigrationNotificationsTest extends AAISetup { @Test public void processEverythingBatched3() throws Exception { SendMigrationNotifications s = spy(new SendMigrationNotifications( - loaderFactory, schemaVersions, REALTIME_CONFIG, FILE, Collections.EMPTY_SET, 0, 3, "test", EventAction.UPDATE, "DMAAP-LOAD")); + loaderFactory, schemaVersions, REALTIME_CONFIG, FILE, Collections.emptySet(), 0, 3, "test", EventAction.UPDATE, "DMAAP-LOAD")); doNothing().when(s).trigger(); doNothing().when(s).cleanup(); s.process("/aai/"); @@ -190,4 +190,4 @@ public class SendMigrationNotificationsTest extends AAISetup { } -}
\ No newline at end of file +} diff --git a/src/test/resources/application-test.properties b/src/test/resources/application-test.properties index d5b47d2..74d5d49 100644 --- a/src/test/resources/application-test.properties +++ b/src/test/resources/application-test.properties @@ -34,9 +34,6 @@ server.port=8449 security.require-ssl=false server.ssl.enabled=false -# JMS bind address host port -jms.bind.address=tcp://localhost:61450 - # Schema related attributes for the oxm and edges # Any additional schema related attributes should start with prefix schema schema.configuration.location=N/A @@ -79,3 +76,5 @@ management.server.port=0 management.endpoints.enabled-by-default=true management.endpoints.web.exposure.include=info, health, loggers, prometheus management.metrics.web.server.auto-time-requests=false + +aai.notifications.enabled=false diff --git a/src/test/resources/etc/appprops/aaiconfig.properties b/src/test/resources/etc/appprops/aaiconfig.properties index b2dd2ed..235cbda 100644 --- a/src/test/resources/etc/appprops/aaiconfig.properties +++ b/src/test/resources/etc/appprops/aaiconfig.properties @@ -65,7 +65,7 @@ aai.default.api.version=v14 aai.model.delete.sleep.per.vtx.msec=500 aai.model.query.resultset.maxcount=50 aai.model.query.timeout.sec=90 - + # Used by Data Grooming aai.grooming.default.max.fix=150 aai.grooming.default.sleep.minutes=7 @@ -90,8 +90,6 @@ aai.forceDel.protected.descendant.count=10 aai.ctagPool.rangeString.vplsPe1=2001-2500 aai.ctagPool.rangeString.vplsPe2=2501-3000 -aai.jms.enable=false - #used by the dataGrooming and dataSnapshot cleanup tasks aai.cron.enable.datagroomingcleanup=true aai.cron.enable.datasnapshotcleanup=true diff --git a/version.properties b/version.properties index e8f490e..bcf6bda 100644 --- a/version.properties +++ b/version.properties @@ -4,8 +4,8 @@ # because they are used in Jenkins, whose plug-in doesn't support major_version=1 -minor_version=14 -patch_version=7 +minor_version=15 +patch_version=1 base_version=${major_version}.${minor_version}.${patch_version} |