summaryrefslogtreecommitdiffstats
path: root/java/com/rsyslog/gui
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-07-24 14:54:37 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-07-24 14:54:37 +0200
commita0cf24df62bba0c441cbf9ece9369ac9039f56ac (patch)
tree638b54fb0902fec9b0275857589180641303b10f /java/com/rsyslog/gui
parent72994de288a64d4ddca9816a486aa0f42361da55 (diff)
downloadrsyslog-a0cf24df62bba0c441cbf9ece9369ac9039f56ac.tar.gz
rsyslog-a0cf24df62bba0c441cbf9ece9369ac9039f56ac.tar.xz
rsyslog-a0cf24df62bba0c441cbf9ece9369ac9039f56ac.zip
first shot at mini-receiver and mini-parser java classes (for gui)
Diffstat (limited to 'java/com/rsyslog/gui')
-rw-r--r--java/com/rsyslog/gui/simpServ/simpServ.java19
-rw-r--r--java/com/rsyslog/gui/simpServ/simpServConsumer.java10
2 files changed, 26 insertions, 3 deletions
diff --git a/java/com/rsyslog/gui/simpServ/simpServ.java b/java/com/rsyslog/gui/simpServ/simpServ.java
index 56e4aaf1..5d248d90 100644
--- a/java/com/rsyslog/gui/simpServ/simpServ.java
+++ b/java/com/rsyslog/gui/simpServ/simpServ.java
@@ -1,7 +1,20 @@
-package com.rsyslog.gui;
+package com.rsyslog.gui.simpServ;
+import com.rsyslog.lib.*;
+import com.rsyslog.gui.*;
public class simpServ {
- public static void main(String[] args) {
- System.out.println("hello world\n");
+
+ public static void main(String args[]) {
+ try {
+ simpServConsumer cons = new simpServConsumer();
+ System.out.println("Starting server on port " + args[0] + "\n");
+ SyslogServerTCP myServ = new
+ SyslogServerTCP(Integer.parseInt(args[0]), cons);
+ myServ.start();
+ System.out.println("Press ctl-c to terminate\n");
+ }
+ catch(Exception e) {
+ System.out.println("Error: " + e.toString());
+ }
}
}
diff --git a/java/com/rsyslog/gui/simpServ/simpServConsumer.java b/java/com/rsyslog/gui/simpServ/simpServConsumer.java
new file mode 100644
index 00000000..c7c576d7
--- /dev/null
+++ b/java/com/rsyslog/gui/simpServ/simpServConsumer.java
@@ -0,0 +1,10 @@
+/** A syslog message consumer for the simple syslog server. */
+package com.rsyslog.gui.simpServ;
+import com.rsyslog.lib.*;
+
+class simpServConsumer implements SyslogMsgConsumer {
+ public void consumeMsg(String ln) {
+ SyslogMessage msg = new SyslogMessage(ln);
+ System.out.println("Line received '" + msg.getRawMsgAfterPRI() + "'\n");
+ }
+}