|
@ -14,7 +14,8 @@ public class TCPTimeCounterRESTService { |
|
|
static final String bucketName = "vertsys-counter"; |
|
|
static final String bucketName = "vertsys-counter"; |
|
|
static final String bucketRegion = "eu-central-1"; |
|
|
static final String bucketRegion = "eu-central-1"; |
|
|
|
|
|
|
|
|
static final String dnsNameELB = "VertSys-ELB1-b88aad9416b2929b.elb.eu-central-1.amazonaws.com"; |
|
|
|
|
|
|
|
|
static final String dnsNameELB = "cloudcomp-loadbalancer-1492513132.eu-central-1.elb.amazonaws.com"; |
|
|
|
|
|
static final int portELBTarget = 36042; |
|
|
|
|
|
|
|
|
private Long getCounter() { |
|
|
private Long getCounter() { |
|
|
// Verbindung zu S3 |
|
|
// Verbindung zu S3 |
|
@ -40,7 +41,7 @@ public class TCPTimeCounterRESTService { |
|
|
public String getCounterHtml() { |
|
|
public String getCounterHtml() { |
|
|
return "<html><head><title>TCPTimeCounter REST Service</title>" + |
|
|
return "<html><head><title>TCPTimeCounter REST Service</title>" + |
|
|
"<meta http-equiv=\"refresh\" content=\"5\"/></head><body>" + |
|
|
"<meta http-equiv=\"refresh\" content=\"5\"/></head><body>" + |
|
|
"<h2>Verteilte Systeme HS Fulda - TCPTimeCounter REST Service</h2>"+ |
|
|
|
|
|
|
|
|
"<h2>Cloud Computing HS Fulda - TCPTimeCounter REST Service</h2>"+ |
|
|
"<p><b>HTML-Output:</b> " + getCounter() + "</p></body></html>"; |
|
|
"<p><b>HTML-Output:</b> " + getCounter() + "</p></body></html>"; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -68,10 +69,10 @@ public class TCPTimeCounterRESTService { |
|
|
currentCounterValue = currentCounterValue + (new Long(input)).longValue(); |
|
|
currentCounterValue = currentCounterValue + (new Long(input)).longValue(); |
|
|
setCounter(currentCounterValue); |
|
|
setCounter(currentCounterValue); |
|
|
return "<html><head><title>TCPTimeCounter REST Service</title></head></body>" + |
|
|
return "<html><head><title>TCPTimeCounter REST Service</title></head></body>" + |
|
|
"<h2>Verteilte Systeme HS Fulda - TCPTimeCounter REST Service</h2>" + |
|
|
|
|
|
|
|
|
"<h2>Cloud Computing HS Fulda - TCPTimeCounter REST Service</h2>" + |
|
|
"<p><b>HTML-Output:</b> counter increased by " + |
|
|
"<p><b>HTML-Output:</b> counter increased by " + |
|
|
input + " to " + currentCounterValue + "</p>" + |
|
|
input + " to " + currentCounterValue + "</p>" + |
|
|
"<form method=POST action=\"http://" + dnsNameELB + ":36042/counter\">" + |
|
|
|
|
|
|
|
|
"<form method=POST action=\"http://" + dnsNameELB + ":" + portELBTarget + webContextPath +"\">" + |
|
|
"<input name=\"input\" value=\"\"></form></body></html>"; |
|
|
"<input name=\"input\" value=\"\"></form></body></html>"; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|