From 968901174b316f8f7d6f695b06f1fb13783ba2ae Mon Sep 17 00:00:00 2001 From: Neha Selvan Date: Fri, 29 Sep 2023 19:47:33 +0200 Subject: [PATCH] reformatted files --- .../polypheny/db/stream/StreamMessage.java | 2 +- .../db/cypher/parser/CypherCharStream.java | 2 +- plugins/mqtt-stream/build.gradle | 5 +---- .../db/mqtt/FilteringMqttMessage.java | 2 +- .../org/polypheny/db/mqtt/MqttMessage.java | 2 +- .../polypheny/db/mqtt/MqttStreamPlugin.java | 21 ------------------- .../polypheny/db/mqtt/StoringMqttMessage.java | 9 +++----- .../polypheny/db/webui/crud/LanguageCrud.java | 2 +- 8 files changed, 9 insertions(+), 36 deletions(-) diff --git a/core/src/main/java/org/polypheny/db/stream/StreamMessage.java b/core/src/main/java/org/polypheny/db/stream/StreamMessage.java index fc6fa0f6b2..2a39f09361 100644 --- a/core/src/main/java/org/polypheny/db/stream/StreamMessage.java +++ b/core/src/main/java/org/polypheny/db/stream/StreamMessage.java @@ -19,5 +19,5 @@ public interface StreamMessage { - T getMessage(); + T getData(); } diff --git a/plugins/cypher-language/src/main/java/org/polypheny/db/cypher/parser/CypherCharStream.java b/plugins/cypher-language/src/main/java/org/polypheny/db/cypher/parser/CypherCharStream.java index 0db4857162..6805c3b6a2 100644 --- a/plugins/cypher-language/src/main/java/org/polypheny/db/cypher/parser/CypherCharStream.java +++ b/plugins/cypher-language/src/main/java/org/polypheny/db/cypher/parser/CypherCharStream.java @@ -170,7 +170,7 @@ private char convertUnicode( char c ) { hexval( nextQueryChar() )); } catch ( final IOException e ) { throw new RuntimeException( e.getMessage() ); - //throw new RuntimeException( e.getMessage(), queryCursor, queryCursorLine, queryCursorColumn ); + //throw new RuntimeException( e.getData(), queryCursor, queryCursorLine, queryCursorColumn ); } } diff --git a/plugins/mqtt-stream/build.gradle b/plugins/mqtt-stream/build.gradle index cd3f63f88f..31e4f4450b 100644 --- a/plugins/mqtt-stream/build.gradle +++ b/plugins/mqtt-stream/build.gradle @@ -14,9 +14,6 @@ dependencies { // https://mvnrepository.com/artifact/com.hivemq/hivemq-mqtt-client implementation group: 'com.hivemq', name: 'hivemq-mqtt-client', version: hivemq_mqttclient_version - //TODO: remove - // https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on - implementation group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.70' implementation group: "org.mongodb", name: "mongodb-driver-sync", version: mongodb_driver_sync_version // Apache 2.0 @@ -94,7 +91,7 @@ jar { } } -java{ +java { withJavadocJar(); withSourcesJar(); } diff --git a/plugins/mqtt-stream/src/main/java/org/polypheny/db/mqtt/FilteringMqttMessage.java b/plugins/mqtt-stream/src/main/java/org/polypheny/db/mqtt/FilteringMqttMessage.java index 900cc56de7..474f45d229 100644 --- a/plugins/mqtt-stream/src/main/java/org/polypheny/db/mqtt/FilteringMqttMessage.java +++ b/plugins/mqtt-stream/src/main/java/org/polypheny/db/mqtt/FilteringMqttMessage.java @@ -32,7 +32,7 @@ public FilteringMqttMessage( MqttMessage mqttMessage, String query ) { public String getMessage() { - return mqttMessage.getMessage(); + return mqttMessage.getData(); } } diff --git a/plugins/mqtt-stream/src/main/java/org/polypheny/db/mqtt/MqttMessage.java b/plugins/mqtt-stream/src/main/java/org/polypheny/db/mqtt/MqttMessage.java index 9d06a5ddab..614d6f1aff 100644 --- a/plugins/mqtt-stream/src/main/java/org/polypheny/db/mqtt/MqttMessage.java +++ b/plugins/mqtt-stream/src/main/java/org/polypheny/db/mqtt/MqttMessage.java @@ -33,7 +33,7 @@ public MqttMessage( String payload, String topic ) { } - public String getMessage() { + public String getData() { return this.payload; } diff --git a/plugins/mqtt-stream/src/main/java/org/polypheny/db/mqtt/MqttStreamPlugin.java b/plugins/mqtt-stream/src/main/java/org/polypheny/db/mqtt/MqttStreamPlugin.java index 84235516da..93f2de734b 100644 --- a/plugins/mqtt-stream/src/main/java/org/polypheny/db/mqtt/MqttStreamPlugin.java +++ b/plugins/mqtt-stream/src/main/java/org/polypheny/db/mqtt/MqttStreamPlugin.java @@ -753,11 +753,9 @@ private class MonitoringPage { private final InformationGroup informationGroupInfo; private final InformationGroup informationGroupReceivedMessages; private final InformationGroup informationGroupPub; - private final InformationGroup informationGroupReconn; private final InformationTable topicsTable; private final InformationTable messageTable; private final InformationKeyValue brokerKv; - private final InformationAction reconnButton; private final InformationAction msgButton; @@ -797,23 +795,6 @@ public MonitoringPage() { } ).withParameters( "topic", "payload" ); im.registerInformation( msgButton ); - // Reconnection button - informationGroupReconn = new InformationGroup( informationPage, "Reconnect to broker" ).setOrder( 5 ); - im.addGroup( informationGroupReconn ); - reconnButton = new InformationAction( informationGroupReconn, "Reconnect", ( parameters ) -> { - String end = "Reconnecting to broker"; - if ( client.getState().toString().equals( "DISCONNECTED" ) ) { - run(); - update(); - } else { - client.toBlocking().disconnect(); - run(); - update(); - } - return end; - } ); - im.registerInformation( reconnButton ); - } @@ -852,11 +833,9 @@ public void remove() { im.removeInformation( brokerKv ); im.removeInformation( messageTable ); im.removeInformation( msgButton ); - im.removeInformation( reconnButton ); im.removeGroup( informationGroupTopics ); im.removeGroup( informationGroupInfo ); - im.removeGroup( informationGroupReconn ); im.removeGroup( informationGroupPub ); im.removeGroup( informationGroupReceivedMessages ); im.removePage( informationPage ); diff --git a/plugins/mqtt-stream/src/main/java/org/polypheny/db/mqtt/StoringMqttMessage.java b/plugins/mqtt-stream/src/main/java/org/polypheny/db/mqtt/StoringMqttMessage.java index ff1fbc8398..6fe1b9a7c6 100644 --- a/plugins/mqtt-stream/src/main/java/org/polypheny/db/mqtt/StoringMqttMessage.java +++ b/plugins/mqtt-stream/src/main/java/org/polypheny/db/mqtt/StoringMqttMessage.java @@ -33,11 +33,8 @@ public class StoringMqttMessage { private final long databaseId; @Getter private final int userId; - /** - * if MqttStreamClient.collectionPerTopic = TRUE, then collectionName is name of the topic or (if the subscribed topic - * has wildcards) the wildcardTopic - * if MqttStreamClient.collectionPerTopic = FALSE, then collectionName is the name of the common collection - */ + + // The name of the entity where the message should be stored in. @Getter private final String entityName; @@ -54,7 +51,7 @@ public StoringMqttMessage( MqttMessage msg, String namespaceName, NamespaceType public String getMessage() { - return this.msg.getMessage(); + return this.msg.getData(); } diff --git a/webui/src/main/java/org/polypheny/db/webui/crud/LanguageCrud.java b/webui/src/main/java/org/polypheny/db/webui/crud/LanguageCrud.java index fde6f84be0..2f210312eb 100644 --- a/webui/src/main/java/org/polypheny/db/webui/crud/LanguageCrud.java +++ b/webui/src/main/java/org/polypheny/db/webui/crud/LanguageCrud.java @@ -162,7 +162,7 @@ public static void printLog( Throwable t, QueryRequest request ) { public static void attachError( Transaction transaction, List results, String query, Throwable t ) { - //String msg = t.getMessage() == null ? "" : t.getMessage(); + //String msg = t.getData() == null ? "" : t.getData(); Result result = new Result( t ).setGeneratedQuery( query ).setXid( transaction.getXid().toString() ); if ( transaction.isActive() ) {