diff --git a/VerteilteSysteme-Examples/src/verteiltesysteme/aws/TCPTimeCounterRESTService.java b/VerteilteSysteme-Examples/src/verteiltesysteme/aws/TCPTimeCounterRESTService.java index 00f4e0ce587f0336e2e7918a8fc3a9f04e0b59ed..377978eb66810f61db5fba9c313061de71a62d78 100644 --- a/VerteilteSysteme-Examples/src/verteiltesysteme/aws/TCPTimeCounterRESTService.java +++ b/VerteilteSysteme-Examples/src/verteiltesysteme/aws/TCPTimeCounterRESTService.java @@ -14,9 +14,6 @@ public class TCPTimeCounterRESTService { static final String bucketName = "vertsys-counter"; static final String bucketRegion = "eu-central-1"; - static final String dnsNameELB = "cloudcomp-loadbalancer-1492513132.eu-central-1.elb.amazonaws.com"; - static final int portELBTarget = 36042; - private Long getCounter() { // Verbindung zu S3 AmazonS3 s3Client = AmazonS3ClientBuilder.defaultClient(); @@ -41,8 +38,11 @@ public class TCPTimeCounterRESTService { public String getCounterHtml() { return "<html><head><title>TCPTimeCounter REST Service</title>" + "<meta http-equiv=\"refresh\" content=\"5\"/></head><body>" + - "<h2>Cloud Computing HS Fulda - TCPTimeCounter REST Service</h2>"+ - "<p><b>HTML-Output:</b> " + getCounter() + "</p></body></html>"; + "<h2>HS Fulda - TCPTimeCounter REST Service</h2>"+ + "<p><b>HTML-Output:</b> " + getCounter() + "</p></body>"+ + "<form method=POST action=\"/counter\">" + + "<input type=\"hidden\" name=\"input\" value=\"1\">"+ + "<input type=\"submit\" value=\"Increment\"></form></body></html>"; } @GET @@ -68,12 +68,13 @@ public class TCPTimeCounterRESTService { Long currentCounterValue = getCounter(); currentCounterValue = currentCounterValue + (new Long(input)).longValue(); setCounter(currentCounterValue); - return "<html><head><title>TCPTimeCounter REST Service</title></head></body>" + - "<h2>Cloud Computing HS Fulda - TCPTimeCounter REST Service</h2>" + - "<p><b>HTML-Output:</b> counter increased by " + - input + " to " + currentCounterValue + "</p>" + - "<form method=POST action=\"http://" + dnsNameELB + ":" + portELBTarget + webContextPath +"\">" + - "<input name=\"input\" value=\"\"></form></body></html>"; + return "<html><head><title>TCPTimeCounter REST Service</title>" + + "<meta http-equiv=\"refresh\" content=\"5\"/></head><body>" + + "<h2>HS Fulda - TCPTimeCounter REST Service</h2>"+ + "<p><b>HTML-Output:</b> " + getCounter() + "</p></body>"+ + "<form method=POST action=\"/counter\">" + + "<input type=\"hidden\" name=\"input\" value=\"1\">"+ + "<input type=\"submit\" value=\"Increment\"></form></body></html>"; } @POST