Skip to content
Snippets Groups Projects
Commit 3981fbf4 authored by Sebastian Rieger's avatar Sebastian Rieger
Browse files

merged

parents eee35ca7 4daf5538
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment