diff --git a/VerteilteSysteme-Examples/build/RMIEchoServer.jar b/VerteilteSysteme-Examples/build/RMIEchoServer.jar
index 0322ab7..4e35bcc 100644
Binary files a/VerteilteSysteme-Examples/build/RMIEchoServer.jar and b/VerteilteSysteme-Examples/build/RMIEchoServer.jar differ
diff --git a/VerteilteSysteme-Examples/build/RMIMandelbrotCalculationsServer.jar b/VerteilteSysteme-Examples/build/RMIMandelbrotCalculationsServer.jar
index ce3cb25..49805e9 100644
Binary files a/VerteilteSysteme-Examples/build/RMIMandelbrotCalculationsServer.jar and b/VerteilteSysteme-Examples/build/RMIMandelbrotCalculationsServer.jar differ
diff --git a/VerteilteSysteme-Examples/build/TCPPerfServer.jar b/VerteilteSysteme-Examples/build/TCPPerfServer.jar
index 6b146ec..6945b70 100644
Binary files a/VerteilteSysteme-Examples/build/TCPPerfServer.jar and b/VerteilteSysteme-Examples/build/TCPPerfServer.jar differ
diff --git a/VerteilteSysteme-Examples/build/TCPServer.jar b/VerteilteSysteme-Examples/build/TCPServer.jar
index d189421..efeba29 100644
Binary files a/VerteilteSysteme-Examples/build/TCPServer.jar and b/VerteilteSysteme-Examples/build/TCPServer.jar differ
diff --git a/VerteilteSysteme-Examples/build/TCPServerMulti.jar b/VerteilteSysteme-Examples/build/TCPServerMulti.jar
index 1c4aa38..baa0009 100644
Binary files a/VerteilteSysteme-Examples/build/TCPServerMulti.jar and b/VerteilteSysteme-Examples/build/TCPServerMulti.jar differ
diff --git a/VerteilteSysteme-Examples/build/TCPTimeCounterRESTServer.jar b/VerteilteSysteme-Examples/build/TCPTimeCounterRESTServer.jar
new file mode 100644
index 0000000..f604ce3
Binary files /dev/null and b/VerteilteSysteme-Examples/build/TCPTimeCounterRESTServer.jar differ
diff --git a/VerteilteSysteme-Examples/build/TCPTimeCounterServer.jar b/VerteilteSysteme-Examples/build/TCPTimeCounterServer.jar
index c6a5e5e..65027b4 100644
Binary files a/VerteilteSysteme-Examples/build/TCPTimeCounterServer.jar and b/VerteilteSysteme-Examples/build/TCPTimeCounterServer.jar differ
diff --git a/VerteilteSysteme-Examples/build/UDPServer.jar b/VerteilteSysteme-Examples/build/UDPServer.jar
index a87da5e..55a7eee 100644
Binary files a/VerteilteSysteme-Examples/build/UDPServer.jar and b/VerteilteSysteme-Examples/build/UDPServer.jar differ
diff --git a/VerteilteSysteme-Examples/build/UDPServerMulti.jar b/VerteilteSysteme-Examples/build/UDPServerMulti.jar
index 1bad079..8e8acbe 100644
Binary files a/VerteilteSysteme-Examples/build/UDPServerMulti.jar and b/VerteilteSysteme-Examples/build/UDPServerMulti.jar differ
diff --git a/VerteilteSysteme-Examples/build/UDPTimeCounterServer.jar b/VerteilteSysteme-Examples/build/UDPTimeCounterServer.jar
index 74c5a63..06128d7 100644
Binary files a/VerteilteSysteme-Examples/build/UDPTimeCounterServer.jar and b/VerteilteSysteme-Examples/build/UDPTimeCounterServer.jar differ
diff --git a/VerteilteSysteme-Examples/build/build-server-jars.xml b/VerteilteSysteme-Examples/build/build-server-jars.xml
index c86cf11..a23ab08 100644
--- a/VerteilteSysteme-Examples/build/build-server-jars.xml
+++ b/VerteilteSysteme-Examples/build/build-server-jars.xml
@@ -7,7 +7,7 @@
-
+
@@ -91,33 +91,25 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/VerteilteSysteme-Examples/src/verteiltesysteme/aws/TCPTimeCounterRESTServer.java b/VerteilteSysteme-Examples/src/verteiltesysteme/aws/TCPTimeCounterRESTServer.java
new file mode 100644
index 0000000..013192f
--- /dev/null
+++ b/VerteilteSysteme-Examples/src/verteiltesysteme/aws/TCPTimeCounterRESTServer.java
@@ -0,0 +1,32 @@
+/* Beispiel angelehnt an http://www.torsten-horn.de/techdocs/jee-rest.htm */
+package verteiltesysteme.aws;
+
+import java.io.IOException;
+import java.net.URI;
+import org.glassfish.grizzly.http.server.HttpServer;
+import org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory;
+import org.glassfish.jersey.server.ResourceConfig;
+
+public class TCPTimeCounterRESTServer
+{
+ public static void main( String[] args ) throws IOException, InterruptedException
+ {
+ String baseUrl = ( args.length > 0 ) ? args[0] : "http://localhost:36042";
+
+ final HttpServer server = GrizzlyHttpServerFactory.createHttpServer(
+ URI.create( baseUrl ), new ResourceConfig( TCPTimeCounterRESTService.class ), false );
+ Runtime.getRuntime().addShutdownHook( new Thread( new Runnable() {
+ @Override
+ public void run() {
+ server.shutdownNow();
+ }
+ } ) );
+ server.start();
+
+ System.out.println("Grizzly-HTTP-Server gestartet");
+ System.out.println("Stoppen des Grizzly-HTTP-Servers mit: Strg+C\n");
+ System.out.println("RESTful Web Service URL: " + baseUrl + TCPTimeCounterRESTService.webContextPath);
+
+ Thread.currentThread().join();
+ }
+}
\ No newline at end of file
diff --git a/VerteilteSysteme-Examples/src/verteiltesysteme/aws/TCPTimeCounterRESTService.java b/VerteilteSysteme-Examples/src/verteiltesysteme/aws/TCPTimeCounterRESTService.java
new file mode 100644
index 0000000..08bd24b
--- /dev/null
+++ b/VerteilteSysteme-Examples/src/verteiltesysteme/aws/TCPTimeCounterRESTService.java
@@ -0,0 +1,78 @@
+/* Beispiel angelehnt an http://www.torsten-horn.de/techdocs/jee-rest.htm */
+package verteiltesysteme.aws;
+
+import javax.ws.rs.*;
+import javax.ws.rs.core.MediaType;
+
+import com.amazonaws.services.s3.AmazonS3;
+import com.amazonaws.services.s3.AmazonS3ClientBuilder;
+
+@Path(TCPTimeCounterRESTService.webContextPath)
+public class TCPTimeCounterRESTService {
+ static final String webContextPath = "/counter";
+ static final String bucketName = "vertsys-counter";
+
+ private Long getCounter() {
+ // Verbindung zu S3
+ AmazonS3 s3Client = AmazonS3ClientBuilder.defaultClient();
+ String region = s3Client.getRegionName();
+ return new Long(s3Client.getObjectAsString(bucketName, region));
+ }
+
+ private boolean setCounter(Long counter) {
+ // Verbindung zu S3
+ AmazonS3 s3Client = AmazonS3ClientBuilder.defaultClient();
+ String region = s3Client.getRegionName();
+ s3Client.putObject(bucketName, region, new Long(counter).toString());
+ return true;
+ }
+
+ @GET
+ @Produces(MediaType.TEXT_PLAIN)
+ public String getCounterPlain() {
+ return "Plain-Text: " + getCounter();
+ }
+
+ @GET
+ @Produces(MediaType.TEXT_HTML)
+ public String getCounterHtml() {
+ return "TCPTimeCounter REST ServiceHTML: " + getCounter() + "
";
+ }
+
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ public String getCounterJson() {
+ return "{\n \"type\": \"JSON\",\n \"output\": \"" + getCounter() + "\"\n}";
+ }
+
+ @POST
+ @Consumes(MediaType.TEXT_PLAIN)
+ @Produces(MediaType.TEXT_PLAIN)
+ public String incrCounterPlain(@FormParam("input") String input) {
+ Long currentCounterValue = getCounter();
+ currentCounterValue = currentCounterValue + (new Long(input)).longValue();
+ setCounter(currentCounterValue);
+ return "Plain-Text: TCPTimeCounter counter increased by " + input + " to " + currentCounterValue;
+ }
+
+ @POST
+ @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
+ @Produces(MediaType.TEXT_HTML)
+ public String incrCounterHtml(@FormParam("input") String input) {
+ Long currentCounterValue = getCounter();
+ currentCounterValue = currentCounterValue + (new Long(input)).longValue();
+ setCounter(currentCounterValue);
+ return "TCPTimeCounter counter increased by " + input + " to " + currentCounterValue + "