From 0b3385a3e00a3205e8797e17ab465b0c5fb76707 Mon Sep 17 00:00:00 2001 From: Peter Hormanns Date: Tue, 5 Sep 2023 12:12:57 +0200 Subject: [PATCH] null handling --- qserv-test/.classpath | 27 ------- qserv-test/.gitignore | 1 - qserv-test/.project | 23 ------ .../org.eclipse.core.resources.prefs | 3 - .../.settings/org.eclipse.jdt.core.prefs | 8 --- .../.settings/org.eclipse.m2e.core.prefs | 4 -- qserv-test/pom.xml | 68 ------------------ .../main/java/de/hsadmin/qserv/test/Pull.java | 71 ------------------- .../main/java/de/hsadmin/qserv/test/Push.java | 37 ---------- 9 files changed, 242 deletions(-) delete mode 100644 qserv-test/.classpath delete mode 100644 qserv-test/.gitignore delete mode 100644 qserv-test/.project delete mode 100644 qserv-test/.settings/org.eclipse.core.resources.prefs delete mode 100644 qserv-test/.settings/org.eclipse.jdt.core.prefs delete mode 100644 qserv-test/.settings/org.eclipse.m2e.core.prefs delete mode 100644 qserv-test/pom.xml delete mode 100644 qserv-test/src/main/java/de/hsadmin/qserv/test/Pull.java delete mode 100644 qserv-test/src/main/java/de/hsadmin/qserv/test/Push.java diff --git a/qserv-test/.classpath b/qserv-test/.classpath deleted file mode 100644 index 4559ca0..0000000 --- a/qserv-test/.classpath +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/qserv-test/.gitignore b/qserv-test/.gitignore deleted file mode 100644 index b83d222..0000000 --- a/qserv-test/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target/ diff --git a/qserv-test/.project b/qserv-test/.project deleted file mode 100644 index d1d24d6..0000000 --- a/qserv-test/.project +++ /dev/null @@ -1,23 +0,0 @@ - - - hsadmin-qserv-test - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.m2e.core.maven2Nature - - diff --git a/qserv-test/.settings/org.eclipse.core.resources.prefs b/qserv-test/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index e9441bb..0000000 --- a/qserv-test/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,3 +0,0 @@ -eclipse.preferences.version=1 -encoding//src/main/java=UTF-8 -encoding/=UTF-8 diff --git a/qserv-test/.settings/org.eclipse.jdt.core.prefs b/qserv-test/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 2af1e7b..0000000 --- a/qserv-test/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,8 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 -org.eclipse.jdt.core.compiler.compliance=11 -org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore -org.eclipse.jdt.core.compiler.release=disabled -org.eclipse.jdt.core.compiler.source=11 diff --git a/qserv-test/.settings/org.eclipse.m2e.core.prefs b/qserv-test/.settings/org.eclipse.m2e.core.prefs deleted file mode 100644 index f897a7f..0000000 --- a/qserv-test/.settings/org.eclipse.m2e.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -activeProfiles= -eclipse.preferences.version=1 -resolveWorkspaceProjects=true -version=1 diff --git a/qserv-test/pom.xml b/qserv-test/pom.xml deleted file mode 100644 index cd1c9d3..0000000 --- a/qserv-test/pom.xml +++ /dev/null @@ -1,68 +0,0 @@ - - 4.0.0 - de.hsadmin.core - hsadmin-qserv-test - 4.0.16 - - UTF-8 - 11 - - - - de.hsadmin.core - hsadmin-util - 4.0.16 - - - de.hsadmin.core - hsadmin-qserv - 4.0.16 - - - commons-lang - commons-lang - 2.6 - - - commons-net - commons-net - 3.9.0 - - - org.apache.velocity - velocity-engine-core - 2.3 - - - org.apache.openjpa - openjpa - 3.2.2 - - - org.apache.activemq - activemq-client - 5.17.5 - - - junit - junit - 4.13.2 - test - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.11.0 - - 11 - 11 - - - - - diff --git a/qserv-test/src/main/java/de/hsadmin/qserv/test/Pull.java b/qserv-test/src/main/java/de/hsadmin/qserv/test/Pull.java deleted file mode 100644 index 7dbd06f..0000000 --- a/qserv-test/src/main/java/de/hsadmin/qserv/test/Pull.java +++ /dev/null @@ -1,71 +0,0 @@ -package de.hsadmin.qserv.test; - -import java.io.Serializable; - -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.MessageListener; -import javax.jms.ObjectMessage; -import javax.jms.Queue; -import javax.jms.QueueConnection; -import javax.jms.QueueReceiver; -import javax.jms.QueueSession; - -import org.apache.activemq.ActiveMQConnectionFactory; - -import de.hsadmin.core.qserv.ProcessorException; -import de.hsadmin.core.qserv.TaskTransfer; - -public class Pull implements MessageListener { - - public static void main(String[] args) { - ActiveMQConnectionFactory cxFact = new ActiveMQConnectionFactory("ssl://hsh02.hostsharing.net:61619"); - try { -// QueueConnection qCx = cxFact.createQueueConnection("hsar", ""); - QueueConnection queueConnect = cxFact.createQueueConnection("user-h98", ""); - QueueSession session = queueConnect.createQueueSession(false, QueueSession.CLIENT_ACKNOWLEDGE); - Queue queue = session.createQueue("queue.hsadminSystem-h98"); - QueueReceiver receiver = session.createReceiver(queue); - receiver.setMessageListener(new Pull()); - queueConnect.start(); - boolean doContinue = true; - while (doContinue) { - try { - Thread.sleep(2000L); - } catch (InterruptedException e) { - doContinue = false; - } - } - queueConnect.stop(); - session.close(); - queueConnect.close(); - } catch (JMSException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - @Override - public void onMessage(Message message) { - if (message instanceof ObjectMessage) { - try { - ObjectMessage objMesg = (ObjectMessage) message; - Serializable serializable = objMesg.getObject(); - if (serializable instanceof TaskTransfer) { - TaskTransfer task = (TaskTransfer) serializable; - task.getProcessor().process(); - } - } catch (ProcessorException | JMSException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - try { - message.acknowledge(); - } catch (JMSException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - -} diff --git a/qserv-test/src/main/java/de/hsadmin/qserv/test/Push.java b/qserv-test/src/main/java/de/hsadmin/qserv/test/Push.java deleted file mode 100644 index 6e07e71..0000000 --- a/qserv-test/src/main/java/de/hsadmin/qserv/test/Push.java +++ /dev/null @@ -1,37 +0,0 @@ -package de.hsadmin.qserv.test; - -import java.util.Date; - -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.MessageProducer; -import javax.jms.Queue; -import javax.jms.QueueConnection; -import javax.jms.QueueSession; - -import org.apache.activemq.ActiveMQConnectionFactory; - -import de.hsadmin.core.qserv.NullProcessor; -import de.hsadmin.core.qserv.TaskTransfer; - -public class Push { - - public static void main(String[] args) { - ActiveMQConnectionFactory cxFact = new ActiveMQConnectionFactory("ssl://hsh02.hostsharing.net:61619"); - try { -// QueueConnection qCx = cxFact.createQueueConnection("user-h98", ""); - QueueConnection qCx = cxFact.createQueueConnection("hsar", "Eix4Baijee2ae1aighetaik8"); - QueueSession session = qCx.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE); - Queue queue = session.createQueue("queue.hsadminSystem-h98"); - MessageProducer producer = session.createProducer(queue); - Message message = session.createObjectMessage(new TaskTransfer(1L, "anonymous", new Date(), null, "hello world", "hello world detail", new NullProcessor(), null)); - producer.send(queue, message); - session.close(); - qCx.close(); - } catch (JMSException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - -}