diff --git a/VerteilteSysteme-Examples/.classpath b/VerteilteSysteme-Examples/.classpath
index e461bea..500db78 100644
--- a/VerteilteSysteme-Examples/.classpath
+++ b/VerteilteSysteme-Examples/.classpath
@@ -2,5 +2,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/VerteilteSysteme-Examples/lib/grizzly-http-all-2.4.2.jar b/VerteilteSysteme-Examples/lib/grizzly-http-all-2.4.2.jar
new file mode 100644
index 0000000..efa75a6
Binary files /dev/null and b/VerteilteSysteme-Examples/lib/grizzly-http-all-2.4.2.jar differ
diff --git a/VerteilteSysteme-Examples/lib/hk2-api-2.5.0-b42.jar b/VerteilteSysteme-Examples/lib/hk2-api-2.5.0-b42.jar
new file mode 100644
index 0000000..c72ce98
Binary files /dev/null and b/VerteilteSysteme-Examples/lib/hk2-api-2.5.0-b42.jar differ
diff --git a/VerteilteSysteme-Examples/lib/hk2-locator-2.5.0-b42.jar b/VerteilteSysteme-Examples/lib/hk2-locator-2.5.0-b42.jar
new file mode 100644
index 0000000..d05a71b
Binary files /dev/null and b/VerteilteSysteme-Examples/lib/hk2-locator-2.5.0-b42.jar differ
diff --git a/VerteilteSysteme-Examples/lib/hk2-utils-2.5.0-b42.jar b/VerteilteSysteme-Examples/lib/hk2-utils-2.5.0-b42.jar
new file mode 100644
index 0000000..fa5066f
Binary files /dev/null and b/VerteilteSysteme-Examples/lib/hk2-utils-2.5.0-b42.jar differ
diff --git a/VerteilteSysteme-Examples/lib/javax.annotation-api-1.2.jar b/VerteilteSysteme-Examples/lib/javax.annotation-api-1.2.jar
new file mode 100644
index 0000000..9ab39ff
Binary files /dev/null and b/VerteilteSysteme-Examples/lib/javax.annotation-api-1.2.jar differ
diff --git a/VerteilteSysteme-Examples/lib/javax.inject-2.5.0-b42.jar b/VerteilteSysteme-Examples/lib/javax.inject-2.5.0-b42.jar
new file mode 100644
index 0000000..b4ed714
Binary files /dev/null and b/VerteilteSysteme-Examples/lib/javax.inject-2.5.0-b42.jar differ
diff --git a/VerteilteSysteme-Examples/lib/javax.json.bind-api-1.0.jar b/VerteilteSysteme-Examples/lib/javax.json.bind-api-1.0.jar
new file mode 100644
index 0000000..f971d6f
Binary files /dev/null and b/VerteilteSysteme-Examples/lib/javax.json.bind-api-1.0.jar differ
diff --git a/VerteilteSysteme-Examples/lib/javax.ws.rs-api-2.1.jar b/VerteilteSysteme-Examples/lib/javax.ws.rs-api-2.1.jar
new file mode 100644
index 0000000..e64b2d5
Binary files /dev/null and b/VerteilteSysteme-Examples/lib/javax.ws.rs-api-2.1.jar differ
diff --git a/VerteilteSysteme-Examples/lib/jersey-client.jar b/VerteilteSysteme-Examples/lib/jersey-client.jar
new file mode 100644
index 0000000..d692fc1
Binary files /dev/null and b/VerteilteSysteme-Examples/lib/jersey-client.jar differ
diff --git a/VerteilteSysteme-Examples/lib/jersey-common.jar b/VerteilteSysteme-Examples/lib/jersey-common.jar
new file mode 100644
index 0000000..c46dc20
Binary files /dev/null and b/VerteilteSysteme-Examples/lib/jersey-common.jar differ
diff --git a/VerteilteSysteme-Examples/lib/jersey-container-grizzly2-http-2.26.jar b/VerteilteSysteme-Examples/lib/jersey-container-grizzly2-http-2.26.jar
new file mode 100644
index 0000000..fbe3df6
Binary files /dev/null and b/VerteilteSysteme-Examples/lib/jersey-container-grizzly2-http-2.26.jar differ
diff --git a/VerteilteSysteme-Examples/lib/jersey-hk2.jar b/VerteilteSysteme-Examples/lib/jersey-hk2.jar
new file mode 100644
index 0000000..713ff48
Binary files /dev/null and b/VerteilteSysteme-Examples/lib/jersey-hk2.jar differ
diff --git a/VerteilteSysteme-Examples/lib/jersey-server.jar b/VerteilteSysteme-Examples/lib/jersey-server.jar
new file mode 100644
index 0000000..c7f5d43
Binary files /dev/null and b/VerteilteSysteme-Examples/lib/jersey-server.jar differ
diff --git a/VerteilteSysteme-Examples/lib/validation-api-1.1.0.Final.jar b/VerteilteSysteme-Examples/lib/validation-api-1.1.0.Final.jar
new file mode 100644
index 0000000..de85403
Binary files /dev/null and b/VerteilteSysteme-Examples/lib/validation-api-1.1.0.Final.jar differ
diff --git a/VerteilteSysteme-Examples/src/verteiltesysteme/rest/RESTClient.java b/VerteilteSysteme-Examples/src/verteiltesysteme/rest/RESTClient.java
new file mode 100644
index 0000000..f16146e
--- /dev/null
+++ b/VerteilteSysteme-Examples/src/verteiltesysteme/rest/RESTClient.java
@@ -0,0 +1,64 @@
+/* Beispiel angelehnt an http://www.torsten-horn.de/techdocs/jee-rest.htm */
+package verteiltesysteme.rest;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+
+import javax.ws.rs.client.*;
+import javax.ws.rs.core.MediaType;
+
+public class RESTClient {
+ public static void main(String[] args) {
+ String baseUrl = (args.length > 1) ? args[1] : "http://localhost:4434";
+ String webContextPathUpper = "/touppercase";
+ String webContextPathLower = "/tolowercase";
+
+ BufferedReader inFromUser = new BufferedReader(new InputStreamReader(System.in));
+ String input = null;
+ try {
+ System.out.println("Bitte geben Sie eine Zeichenkette ein: ");
+ input = inFromUser.readLine();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ // Nutzung des RESTful Web Service für toUpperCase()
+ System.out.println("****************************");
+ System.out.println("* toUpperCase *");
+ System.out.println("****************************");
+
+ System.out.println("\nAngefragte URL: " + baseUrl + webContextPathUpper + "?input=" + input);
+
+ Client c = ClientBuilder.newClient();
+ WebTarget target = c.target(baseUrl);
+
+ System.out.println("\nTextausgabe:");
+ System.out.println(
+ target.path(webContextPathUpper).queryParam("input", input).request(MediaType.TEXT_PLAIN).get(String.class));
+ System.out.println("\nJSON-Ausgabe:");
+ System.out.println(target.path(webContextPathUpper).queryParam("input", input).request(MediaType.APPLICATION_JSON)
+ .get(String.class));
+ System.out.println("\nHTML-Ausgabe:");
+ System.out.println(
+ target.path(webContextPathUpper).queryParam("input", input).request(MediaType.TEXT_HTML).get(String.class));
+
+ // Nutzung des RESTful Web Service für toLowerCase()
+ System.out.println("\n****************************");
+ System.out.println("* toLowerCase *");
+ System.out.println("****************************");
+
+ System.out.println("\nAngefragte URL: " + baseUrl + webContextPathLower + "?input=" + input);
+
+ System.out.println("\nTextausgabe:");
+ System.out.println(
+ target.path(webContextPathLower).queryParam("input", input).request(MediaType.TEXT_PLAIN).get(String.class));
+ System.out.println("\nJSON-Ausgabe:");
+ System.out.println(target.path(webContextPathLower).queryParam("input", input).request(MediaType.APPLICATION_JSON)
+ .get(String.class));
+ System.out.println("\nHTML-Ausgabe:");
+ System.out.println(
+ target.path(webContextPathLower).queryParam("input", input).request(MediaType.TEXT_HTML).get(String.class));
+
+ }
+}
\ No newline at end of file
diff --git a/VerteilteSysteme-Examples/src/verteiltesysteme/rest/RESTServer.java b/VerteilteSysteme-Examples/src/verteiltesysteme/rest/RESTServer.java
new file mode 100644
index 0000000..6401559
--- /dev/null
+++ b/VerteilteSysteme-Examples/src/verteiltesysteme/rest/RESTServer.java
@@ -0,0 +1,33 @@
+/* Beispiel angelehnt an http://www.torsten-horn.de/techdocs/jee-rest.htm */
+package verteiltesysteme.rest;
+
+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 RESTServer
+{
+ public static void main( String[] args ) throws IOException, InterruptedException
+ {
+ String baseUrl = ( args.length > 0 ) ? args[0] : "http://localhost:4434";
+
+ final HttpServer server = GrizzlyHttpServerFactory.createHttpServer(
+ URI.create( baseUrl ), new ResourceConfig( RESTToUpperCaseService.class, RESTToLowerCaseService.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 + RESTToUpperCaseService.webContextPath);
+ System.out.println("RESTful Web Service URL: " + baseUrl + RESTToLowerCaseService.webContextPath);
+
+ Thread.currentThread().join();
+ }
+}
\ No newline at end of file
diff --git a/VerteilteSysteme-Examples/src/verteiltesysteme/rest/RESTToLowerCaseService.java b/VerteilteSysteme-Examples/src/verteiltesysteme/rest/RESTToLowerCaseService.java
new file mode 100644
index 0000000..8a7e39f
--- /dev/null
+++ b/VerteilteSysteme-Examples/src/verteiltesysteme/rest/RESTToLowerCaseService.java
@@ -0,0 +1,30 @@
+/* Beispiel angelehnt an http://www.torsten-horn.de/techdocs/jee-rest.htm */
+package verteiltesysteme.rest;
+
+import javax.ws.rs.*;
+import javax.ws.rs.core.MediaType;
+
+@Path( RESTToLowerCaseService.webContextPath )
+public class RESTToLowerCaseService
+{
+ static final String webContextPath = "/touppercase";
+
+ @GET @Produces( MediaType.TEXT_PLAIN )
+ public String toUpperCasePlain( @QueryParam("input") String input )
+ {
+ return "Plain-Text: " + input.toUpperCase();
+ }
+
+ @GET @Produces( MediaType.TEXT_HTML )
+ public String toUpperCaseHtml( @QueryParam("input") String input )
+ {
+ return "
RESTServiceHTML: " + input.toUpperCase() + "
";
+ }
+
+ @GET @Produces( MediaType.APPLICATION_JSON )
+ public String toUpperCaseJson( @QueryParam("input") String input )
+ {
+ return "{\n \"type\": \"JSON\",\n \"output\": \"" + input.toUpperCase() + "\"\n}";
+ }
+
+}
\ No newline at end of file
diff --git a/VerteilteSysteme-Examples/src/verteiltesysteme/rest/RESTToUpperCaseService.java b/VerteilteSysteme-Examples/src/verteiltesysteme/rest/RESTToUpperCaseService.java
new file mode 100644
index 0000000..64da2b2
--- /dev/null
+++ b/VerteilteSysteme-Examples/src/verteiltesysteme/rest/RESTToUpperCaseService.java
@@ -0,0 +1,30 @@
+/* Beispiel angelehnt an http://www.torsten-horn.de/techdocs/jee-rest.htm */
+package verteiltesysteme.rest;
+
+import javax.ws.rs.*;
+import javax.ws.rs.core.MediaType;
+
+@Path( RESTToUpperCaseService.webContextPath )
+public class RESTToUpperCaseService
+{
+ static final String webContextPath = "/tolowercase";
+
+ @GET @Produces( MediaType.TEXT_PLAIN )
+ public String toLowerCasePlain( @QueryParam("input") String input )
+ {
+ return "Plain-Text: " + input.toLowerCase();
+ }
+
+ @GET @Produces( MediaType.TEXT_HTML )
+ public String toLowerCaseHtml( @QueryParam("input") String input )
+ {
+ return "RESTServiceHTML: " + input.toLowerCase() + "
";
+ }
+
+ @GET @Produces( MediaType.APPLICATION_JSON )
+ public String toLowerCaseJson( @QueryParam("input") String input )
+ {
+ return "{\n \"type\": \"JSON\",\n \"output\": \"" + input.toLowerCase() + "\"\n}";
+ }
+
+}
\ No newline at end of file