mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-18 19:59:09 +00:00
Merge branch 'master' of ssh://sapsailing.com/home/trac/git into bug5288
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
#!/bin/bash
|
||||
|
||||
# You need an installation of the 2020-09 release of "Eclipse IDE for Eclipse Committers" matching you OS and JDK (32 vs 64 Bit):
|
||||
# https://www.eclipse.org/downloads/packages/release/2020-09/r/eclipse-ide-eclipse-committers
|
||||
|
||||
if [[ $1 == "" ]]; then
|
||||
echo "You need to specify the Eclipse installation directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
installPath="$1"
|
||||
|
||||
installPlugins() {
|
||||
"$installPath/eclipse" -application org.eclipse.equinox.p2.director -noSplash -roaming -repository $1 -installIU $2
|
||||
echo ""
|
||||
}
|
||||
|
||||
updatePlugins() {
|
||||
"$installPath/eclipse" -application org.eclipse.equinox.p2.director -noSplash -roaming -repository $1 -uninstallIU $2 -installIU $2
|
||||
echo ""
|
||||
}
|
||||
|
||||
uninstallPlugins() {
|
||||
"$installPath/eclipse" -application org.eclipse.equinox.p2.director -noSplash -roaming -uninstallIU $1
|
||||
echo ""
|
||||
}
|
||||
|
||||
# Not necessary if using Eclipse for JEE developers
|
||||
echo "Installing webtools (WTP/WST/JPT) and m2e that are required by the GWT plugin..."
|
||||
installPlugins http://download.eclipse.org/releases/2020-09/ org.eclipse.wst.web_ui.feature.feature.group,org.eclipse.jst.web_ui.feature.feature.group,org.eclipse.wst.xml_ui.feature.feature.group,org.eclipse.jpt.common.feature.feature.group,org.eclipse.jpt.jpa.feature.feature.group,org.eclipse.m2e.feature.feature.group,org.eclipse.m2e.wtp.feature.feature.group
|
||||
|
||||
echo "Installing GWT plugin..."
|
||||
installPlugins http://storage.googleapis.com/gwt-eclipse-plugin/v3/release com.gwtplugins.eclipse.suite.v3.feature.feature.group
|
||||
|
||||
echo "Installing Mission Control plugin..."
|
||||
installPlugins http://download.oracle.com/technology/products/missioncontrol/updatesites/base/6.0.0/eclipse com.oracle.jmc.feature.ide.feature.group,com.oracle.jmc.feature.flightrecorder.feature.group,com.oracle.jmc.feature.core.feature.group,com.oracle.jmc.feature.console.feature.group,com.oracle.jmc.feature.core.feature.group,com.oracle.jmc.feature.core.feature.group
|
||||
|
||||
echo "Installing GWT SDM debug bridge..."
|
||||
installPlugins http://p2.sapsailing.com/p2/sdbg com.github.sdbg.feature.feature.group
|
||||
|
||||
echo "Installing EasyShell..."
|
||||
installPlugins http://anb0s.github.io/EasyShell de.anbos.eclipse.easyshell.feature.feature.group
|
||||
|
||||
echo "Installing Memory Analyzer..."
|
||||
installPlugins http://download.eclipse.org/releases/2020-09 org.eclipse.mat.feature.feature.group,org.eclipse.mat.chart.feature.feature.group
|
||||
|
||||
echo "Installing SAP JVM Tools (profiler) ..."
|
||||
installPlugins https://tools.hana.ondemand.com/oxygen com.sap.jvm.profiling.feature.group
|
||||
|
||||
echo "Installing UMLet ..."
|
||||
installPlugins https://www.umlet.com/umlet_latest/repository/ umlet-eclipse-feature.feature.group
|
||||
|
||||
echo "Installing javax.xml.bind for news feed polling (see https://stackoverflow.com/questions/52528693/eclipse-internal-error-polling-news-feeds)..."
|
||||
installPlugins http://download.eclipse.org/tools/orbit/downloads/drops/R20200224183213/repository javax.xml.bind
|
||||
|
||||
echo "Installing Enhanced Class Decompiler"
|
||||
installPlugins https://ecd-plugin.github.io/update org.sf.feeling.decompiler.feature.group,org.sf.feeling.decompiler.cfr.feature.group,org.sf.feeling.decompiler.jad.feature.group,org.sf.feeling.decompiler.jd.feature.group,org.sf.feeling.decompiler.procyon.feature.group
|
||||
|
||||
echo "Uninstalling Wild Web Developer"
|
||||
uninstallPlugins org.eclipse.wildwebdeveloper.feature.feature.group
|
||||
|
||||
echo "Installation completed!"
|
||||
@@ -2,21 +2,21 @@
|
||||
<feature
|
||||
id="com.amazon.aws.aws-java-api"
|
||||
label="AWS API"
|
||||
version="2.14.24"
|
||||
version="2.15.16"
|
||||
provider-name="Amazon">
|
||||
|
||||
<plugin
|
||||
id="com.amazon.aws.aws-java-api"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="2.14.24"
|
||||
version="2.15.16"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.amazon.aws.aws-java-api.source"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="2.14.24"
|
||||
version="2.15.16"
|
||||
unpack="false"/>
|
||||
|
||||
</feature>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<site>
|
||||
<feature url="features/aws-sdk/com.amazon.aws.aws-java-api_2.14.24.jar" id="com.amazon.aws.aws-java-api" version="2.14.24">
|
||||
<feature url="features/aws-sdk/com.amazon.aws.aws-java-api_2.15.16.jar" id="com.amazon.aws.aws-java-api" version="2.15.16">
|
||||
<category name="aws-java-api"/>
|
||||
</feature>
|
||||
<category-def name="com.amazon.aws.aws-java-api" label="aws-java-api"/>
|
||||
|
||||
@@ -5,13 +5,13 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation platform('software.amazon.awssdk:bom:2.14.24')
|
||||
implementation platform('software.amazon.awssdk:bom:2.15.16')
|
||||
implementation 'software.amazon.awssdk:s3'
|
||||
implementation 'software.amazon.awssdk:ec2'
|
||||
implementation 'software.amazon.awssdk:route53'
|
||||
implementation 'software.amazon.awssdk:cloudwatch'
|
||||
implementation 'software.amazon.awssdk:elasticloadbalancingv2'
|
||||
implementation 'software.amazon.awssdk:firehose'
|
||||
implementation 'software.amazon.awssdk:autoscaling'
|
||||
implementation group: 'software.amazon.awssdk', name: 'sdk-core', classifier: 'sources'
|
||||
implementation group: 'software.amazon.awssdk', name: 'arns', classifier: 'sources'
|
||||
implementation group: 'software.amazon.awssdk', name: 'aws-core', classifier: 'sources'
|
||||
@@ -24,7 +24,7 @@ dependencies {
|
||||
implementation group: 'software.amazon.awssdk', name: 'route53', classifier: 'sources'
|
||||
implementation group: 'software.amazon.awssdk', name: 'cloudwatch', classifier: 'sources'
|
||||
implementation group: 'software.amazon.awssdk', name: 'elasticloadbalancingv2', classifier: 'sources'
|
||||
implementation group: 'software.amazon.awssdk', name: 'firehose', classifier: 'sources'
|
||||
implementation group: 'software.amazon.awssdk', name: 'autoscaling', classifier: 'sources'
|
||||
}
|
||||
task downloadLibs(type: Copy) {
|
||||
into file('lib')
|
||||
|
||||
@@ -8,6 +8,6 @@
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>com.amazon.aws.aws-java-api</artifactId>
|
||||
<version>2.14.24</version>
|
||||
<version>2.15.16</version>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
</project>
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.jdt.debug.ui.CONSIDER_INHERITED_MAIN" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="false"/>
|
||||
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8" javaProject="com.sap.sailing.gwt.ui" path="1" type="4"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="false" project="com.sap.sailing.dashboards.gwt"/> </runtimeClasspathEntry> "/>
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
<booleanAttribute key="org.eclipse.jdt.debug.ui.CONSIDER_INHERITED_MAIN" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_CLASSPATH_ONLY_JAR" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="false"/>
|
||||
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8" javaProject="com.sap.sailing.gwt.ui" path="1" type="4"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="false" project="com.sap.sailing.dashboards.gwt"/> </runtimeClasspathEntry> "/>
|
||||
|
||||
+3
-3
@@ -3,14 +3,14 @@ package com.sap.sailing.domain.common.racelog.tracking;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class MarkAlreadyUsedInRaceException extends Exception implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 2040461905745135256L;
|
||||
|
||||
private static final long serialVersionUID = 2040461905745135256L;
|
||||
|
||||
public MarkAlreadyUsedInRaceException() {
|
||||
super();
|
||||
this.raceNames = "";
|
||||
}
|
||||
|
||||
|
||||
public MarkAlreadyUsedInRaceException(String message, String raceNames) {
|
||||
super(message);
|
||||
this.raceNames = raceNames;
|
||||
|
||||
@@ -8,8 +8,8 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Require-Bundle: org.json.simple;bundle-version="1.1.0",
|
||||
com.sun.jersey;bundle-version="1.17.0",
|
||||
org.objectweb.asm;bundle-version="3.3.1",
|
||||
org.apache.httpcomponents.httpclient;bundle-version="[4.2.5,4.3.0)",
|
||||
org.apache.httpcomponents.httpcore;bundle-version="[4.0.0,4.3.0)",
|
||||
org.apache.httpcomponents.httpclient;bundle-version="4.5.5",
|
||||
org.apache.httpcomponents.httpcore;bundle-version="4.4.9",
|
||||
com.sap.sailing.domain.common,
|
||||
com.sap.sailing.domain.igtimiadapter.persistence,
|
||||
com.sap.sailing.domain.shared.android,
|
||||
|
||||
@@ -8,8 +8,8 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Require-Bundle: org.json.simple;bundle-version="1.1.0",
|
||||
com.sun.jersey;bundle-version="1.17.0",
|
||||
org.objectweb.asm;bundle-version="3.3.1",
|
||||
org.apache.httpcomponents.httpclient;bundle-version="[4.2.5,4.3.0)",
|
||||
org.apache.httpcomponents.httpcore;bundle-version="[4.0.0,4.3.0)",
|
||||
org.apache.httpcomponents.httpclient;bundle-version="4.5.5",
|
||||
org.apache.httpcomponents.httpcore;bundle-version="4.4.9",
|
||||
com.sap.sailing.domain.common,
|
||||
com.sap.sailing.domain.igtimiadapter.persistence,
|
||||
com.sap.sailing.domain.shared.android,
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@ import org.apache.http.NameValuePair;
|
||||
import org.apache.http.client.ClientProtocolException;
|
||||
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.impl.client.DefaultHttpClient;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.parser.JSONParser;
|
||||
@@ -48,7 +48,7 @@ public class ConnectivityUtils {
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
public static HttpResponse postForm(String baseUrl, final String action, final Map<String, String> inputFieldsToSubmit, DefaultHttpClient client, String referer)
|
||||
public static HttpResponse postForm(String baseUrl, final String action, final Map<String, String> inputFieldsToSubmit, CloseableHttpClient client, String referer)
|
||||
throws UnsupportedEncodingException, IOException, ClientProtocolException {
|
||||
HttpPost post = new HttpPost(baseUrl+action);
|
||||
List<NameValuePair> urlParameters = new ArrayList<NameValuePair>();
|
||||
|
||||
+29
-39
@@ -25,15 +25,13 @@ import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.apache.http.client.ClientProtocolException;
|
||||
import org.apache.http.client.CookieStore;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.RedirectStrategy;
|
||||
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.impl.client.BasicCookieStore;
|
||||
import org.apache.http.impl.client.DefaultHttpClient;
|
||||
import org.apache.http.impl.client.SystemDefaultHttpClient;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClientBuilder;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
@@ -115,7 +113,7 @@ public class IgtimiConnectionFactoryImpl implements IgtimiConnectionFactory {
|
||||
}
|
||||
|
||||
private Account getAccount(String creatorName, String accessToken) throws ClientProtocolException, IOException, IllegalStateException, ParseException {
|
||||
HttpClient client = new SystemDefaultHttpClient();
|
||||
HttpClient client = HttpClientBuilder.create().build();
|
||||
HttpGet getAccount = new HttpGet(getApiV1BaseUrl()+"account?access_token="+accessToken);
|
||||
HttpResponse accountResponse = client.execute(getAccount);
|
||||
JSONObject accountJson = ConnectivityUtils.getJsonFromResponse(accountResponse);
|
||||
@@ -375,7 +373,7 @@ public class IgtimiConnectionFactoryImpl implements IgtimiConnectionFactory {
|
||||
* @throws RuntimeException in case there was an error while retrieving the token
|
||||
*/
|
||||
public Account obtainAccessTokenFromAuthorizationCode(String creatorName, String code) throws ClientProtocolException, IOException, IllegalStateException, ParseException {
|
||||
HttpClient client = new SystemDefaultHttpClient();
|
||||
HttpClient client = HttpClientBuilder.create().build();
|
||||
HttpPost post = new HttpPost(getOauthTokenUrl());
|
||||
List<NameValuePair> urlParameters = new ArrayList<NameValuePair>();
|
||||
urlParameters.add(new BasicNameValuePair("grant_type", "authorization_code"));
|
||||
@@ -402,42 +400,23 @@ public class IgtimiConnectionFactoryImpl implements IgtimiConnectionFactory {
|
||||
* @return the authorization code which can then be used to obtain a permanent access token to be used by our client
|
||||
* to access data owned by the user identified by e-mail and password.
|
||||
*/
|
||||
public String authorizeAndReturnAuthorizedCode(String userEmail, String userPassword)
|
||||
public String authorizeAndReturnAuthorizedCode(final String userEmail, final String userPassword)
|
||||
throws ClientProtocolException, IOException, IllegalStateException, ParserConfigurationException,
|
||||
SAXException, ClassNotFoundException, InstantiationException, IllegalAccessException, ClassCastException {
|
||||
logger.info("Trying to authorize application client " + getClient().getId() + " for user " + userEmail);
|
||||
DefaultHttpClient client = new SystemDefaultHttpClient();
|
||||
CookieStore cookieStore = new BasicCookieStore();
|
||||
client.setCookieStore(cookieStore);
|
||||
client.setRedirectStrategy(new LaxRedirectStrategyForAllRedirectResponseCodes());
|
||||
final RedirectStrategyExtractingAuthorizationCode codeExtractor =
|
||||
new RedirectStrategyExtractingAuthorizationCode(new LaxRedirectStrategyForAllRedirectResponseCodes());
|
||||
CloseableHttpClient client = HttpClientBuilder.create()
|
||||
.setDefaultCookieStore(new BasicCookieStore())
|
||||
.setRedirectStrategy(codeExtractor)
|
||||
.build();
|
||||
HttpGet get = new HttpGet(getOauthAuthorizeUrl());
|
||||
HttpResponse responseForAuthorize = client.execute(get);
|
||||
return signInAndReturnAuthorizationForm(client, responseForAuthorize, userEmail, userPassword);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Account createAccountToAccessUserData(String creatorName, String userEmail, String userPassword) throws ClientProtocolException,
|
||||
IOException, IllegalStateException, ParserConfigurationException, SAXException, ClassNotFoundException,
|
||||
InstantiationException, IllegalAccessException, ClassCastException, ParseException {
|
||||
final Account result;
|
||||
String code = authorizeAndReturnAuthorizedCode(userEmail, userPassword);
|
||||
if (code != null) {
|
||||
result = obtainAccessTokenFromAuthorizationCode(creatorName, code);
|
||||
} else {
|
||||
result = null;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private String signInAndReturnAuthorizationForm(DefaultHttpClient client, HttpResponse response,
|
||||
final String userEmail, final String userPassword) throws ParserConfigurationException, SAXException,
|
||||
IOException, UnsupportedEncodingException, ClientProtocolException, IllegalStateException,
|
||||
ClassNotFoundException, InstantiationException, IllegalAccessException, ClassCastException {
|
||||
SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
|
||||
final String[] action = new String[1];
|
||||
final Map<String, String> inputFieldsToSubmit = new HashMap<>();
|
||||
try {
|
||||
String pageContent = ConnectivityUtils.getContent(response).replaceAll("<link (.*[^/])>", "<link $1 />");
|
||||
String pageContent = ConnectivityUtils.getContent(responseForAuthorize).replaceAll("<link (.*[^/])>", "<link $1 />");
|
||||
parser.parse(new ByteArrayInputStream(pageContent.getBytes("UTF-8")), new DefaultHandler() {
|
||||
@Override
|
||||
public void startElement(String uri, String localName, String qName, Attributes attributes)
|
||||
@@ -462,10 +441,7 @@ public class IgtimiConnectionFactoryImpl implements IgtimiConnectionFactory {
|
||||
// swallow; we try to grab what we can; let's hope it was enough...
|
||||
logger.log(Level.FINE, "Exception trying to parse Igtimi authorization document", e);
|
||||
}
|
||||
response.getEntity().getContent().close();
|
||||
final RedirectStrategy oldRedirectStrategy = client.getRedirectStrategy();
|
||||
final RedirectStrategyExtractingAuthorizationCode codeExtractor = new RedirectStrategyExtractingAuthorizationCode(oldRedirectStrategy);
|
||||
client.setRedirectStrategy(codeExtractor);
|
||||
responseForAuthorize.getEntity().getContent().close();
|
||||
logger.info("Posting sign-in form for user "+userEmail);
|
||||
HttpResponse authorizationForm = ConnectivityUtils.postForm(getBaseUrl(), action[0], inputFieldsToSubmit, client, getSignInUrl());
|
||||
if (codeExtractor.getCode() == null) {
|
||||
@@ -477,12 +453,26 @@ public class IgtimiConnectionFactoryImpl implements IgtimiConnectionFactory {
|
||||
return codeExtractor.getCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Account createAccountToAccessUserData(String creatorName, String userEmail, String userPassword) throws ClientProtocolException,
|
||||
IOException, IllegalStateException, ParserConfigurationException, SAXException, ClassNotFoundException,
|
||||
InstantiationException, IllegalAccessException, ClassCastException, ParseException {
|
||||
final Account result;
|
||||
String code = authorizeAndReturnAuthorizedCode(userEmail, userPassword);
|
||||
if (code != null) {
|
||||
result = obtainAccessTokenFromAuthorizationCode(creatorName, code);
|
||||
} else {
|
||||
result = null;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses the form in the <code>autorizationForm</code> response and posts it by submitting the form that contains
|
||||
* the commit button with the value "Authorize". If a redirect strategy is set on the <code>client</code> it will
|
||||
* see the redirect URL in the <code>Location</code> header. The redirection target is closed immediately.
|
||||
*/
|
||||
private void authorizeAndGetCode(HttpResponse authorizationForm, DefaultHttpClient client)
|
||||
private void authorizeAndGetCode(HttpResponse authorizationForm, CloseableHttpClient client)
|
||||
throws IllegalStateException, SAXException, IOException, ParserConfigurationException,
|
||||
ClassNotFoundException, InstantiationException, IllegalAccessException, ClassCastException {
|
||||
// If the user already authorized the app, an empty document will be returned
|
||||
@@ -528,7 +518,7 @@ public class IgtimiConnectionFactoryImpl implements IgtimiConnectionFactory {
|
||||
}
|
||||
|
||||
public HttpClient getHttpClient() {
|
||||
HttpClient client = new SystemDefaultHttpClient();
|
||||
HttpClient client = HttpClientBuilder.create().build();
|
||||
return client;
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -2,6 +2,7 @@ package com.sap.sailing.domain.igtimiadapter.impl;
|
||||
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
@@ -66,7 +67,7 @@ public class RedirectStrategyExtractingAuthorizationCode implements RedirectStra
|
||||
}
|
||||
|
||||
private String getCodeFromRedirect(final Header locationHeader) throws URISyntaxException {
|
||||
List<NameValuePair> params = URLEncodedUtils.parse(new URI(locationHeader.getValue()), "UTF-8");
|
||||
List<NameValuePair> params = URLEncodedUtils.parse(new URI(locationHeader.getValue()), Charset.forName("UTF-8"));
|
||||
for (NameValuePair param : params) {
|
||||
if (param.getName().equals("code")) {
|
||||
return param.getValue();
|
||||
|
||||
@@ -25,11 +25,11 @@ Export-Package: com.sap.sailing.domain.tractracadapter,
|
||||
com.sap.sailing.server.replication.test"
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Import-Package: org.apache.http,
|
||||
org.apache.http.client;version="[4.2.5,4.3.0)",
|
||||
org.apache.http.client.entity;version="[4.2.5,4.3.0)",
|
||||
org.apache.http.client.methods;version="[4.2.5,4.3.0)",
|
||||
org.apache.http.impl.client;version="[4.2.5,4.3.0)",
|
||||
org.apache.http.message;version="[4.2.5,4.3.0)",
|
||||
org.apache.http.client;version="4.5.5",
|
||||
org.apache.http.client.entity;version="4.5.5",
|
||||
org.apache.http.client.methods;version="4.5.5",
|
||||
org.apache.http.impl.client;version="4.5.5",
|
||||
org.apache.http.message;version="4.4.9",
|
||||
org.json.simple,
|
||||
org.json.simple.parser,
|
||||
org.osgi.framework;version="1.7.0"
|
||||
|
||||
@@ -62,9 +62,9 @@ Import-Package: com.sap.sse.security,
|
||||
org.apache.commons.io.input;version="2.2.0",
|
||||
org.apache.commons.lang;version="2.6.0",
|
||||
org.apache.http,
|
||||
org.apache.http.client;version="[4.2.5,4.3.0)",
|
||||
org.apache.http.client.entity;version="[4.2.5,4.3.0)",
|
||||
org.apache.http.client.methods;version="[4.2.5,4.3.0)",
|
||||
org.apache.http.impl.client;version="[4.2.5,4.3.0)",
|
||||
org.apache.http.message;version="[4.2.5,4.3.0)"
|
||||
org.apache.http.client;version="4.5.5",
|
||||
org.apache.http.client.entity;version="4.5.5",
|
||||
org.apache.http.client.methods;version="4.5.5",
|
||||
org.apache.http.impl.client;version="4.5.5",
|
||||
org.apache.http.message;version="4.4.9"
|
||||
Automatic-Module-Name: com.sap.sailing.domain
|
||||
|
||||
+3
-3
@@ -40,7 +40,7 @@ import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.impl.client.SystemDefaultHttpClient;
|
||||
import org.apache.http.impl.client.HttpClientBuilder;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
import org.w3c.dom.DOMException;
|
||||
import org.w3c.dom.Document;
|
||||
@@ -277,7 +277,7 @@ public class ORCPublicCertificateDatabaseImpl implements ORCPublicCertificateDat
|
||||
public Iterable<CertificateHandle> search(CountryCode issuingCountry, Integer yearOfIssuance, String referenceNumber,
|
||||
String yachtName, String sailNumber, String boatClassName, boolean includeInvalid) throws Exception {
|
||||
final Set<ORCPublicCertificateDatabase.CertificateHandle> result = new HashSet<>();
|
||||
final HttpClient client = new SystemDefaultHttpClient();
|
||||
final HttpClient client = HttpClientBuilder.create().build();
|
||||
final List<NameValuePair> params = new ArrayList<>();
|
||||
params.add(ACTION_PARAM);
|
||||
params.add(XSLP_PARAM);
|
||||
@@ -496,7 +496,7 @@ public class ORCPublicCertificateDatabaseImpl implements ORCPublicCertificateDat
|
||||
private ORCCertificate getSingleCertificate(final String queryParameters)
|
||||
throws IOException, org.json.simple.parser.ParseException, ClientProtocolException {
|
||||
final HttpGet getRequest = new HttpGet(SINGLE_CERTIFICATE_DOWNLOAD_URL+"&"+queryParameters);
|
||||
final HttpClient client = new SystemDefaultHttpClient();
|
||||
final HttpClient client = HttpClientBuilder.create().build();
|
||||
addAuthorizationHeader(getRequest);
|
||||
final Iterable<ORCCertificate> certificates = new ORCCertificatesJsonImporter().read(client.execute(getRequest).getEntity().getContent())
|
||||
.getCertificates();
|
||||
|
||||
+5
-4
@@ -13,8 +13,8 @@ import java.util.logging.Logger;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.impl.client.AbstractHttpClient;
|
||||
import org.apache.http.impl.client.SystemDefaultHttpClient;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClientBuilder;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
import org.json.simple.parser.ParseException;
|
||||
|
||||
@@ -59,8 +59,9 @@ public class FinishTimeUpdateHandler extends UpdateHandler {
|
||||
params.add(new BasicNameValuePair(FIELD_TRACKING_END_TIME, String.valueOf(newFinishedTime.plus(
|
||||
TrackedRace.STOP_TRACKING_THIS_MUCH_AFTER_RACE_FINISH).asMillis())));
|
||||
request.setEntity(new UrlEncodedFormEntity(params));
|
||||
final AbstractHttpClient client = new SystemDefaultHttpClient();
|
||||
client.setRedirectStrategy(new LaxRedirectStrategyForAllRedirectResponseCodes());
|
||||
final CloseableHttpClient client = HttpClientBuilder.create()
|
||||
.setRedirectStrategy(new LaxRedirectStrategyForAllRedirectResponseCodes())
|
||||
.build();
|
||||
logger.info("Using " + stopTrackingURI.toString() + " to stop tracking");
|
||||
final HttpResponse response = client.execute(request);
|
||||
try {
|
||||
|
||||
+5
-4
@@ -15,10 +15,10 @@ import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.impl.client.AbstractHttpClient;
|
||||
import org.apache.http.impl.client.SystemDefaultHttpClient;
|
||||
import org.apache.http.impl.client.HttpClientBuilder;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
import org.json.simple.parser.ParseException;
|
||||
|
||||
@@ -92,8 +92,9 @@ public class StartTimeUpdateHandler extends UpdateHandler implements StartTimeCh
|
||||
params.add(new BasicNameValuePair(FIELD_TRACKING_START_TIME, String.valueOf(newStartTime.minus(
|
||||
TrackedRace.START_TRACKING_THIS_MUCH_BEFORE_RACE_START).asMillis())));
|
||||
request.setEntity(new UrlEncodedFormEntity(params));
|
||||
final AbstractHttpClient client = new SystemDefaultHttpClient();
|
||||
client.setRedirectStrategy(new LaxRedirectStrategyForAllRedirectResponseCodes());
|
||||
final HttpClient client = HttpClientBuilder.create()
|
||||
.setRedirectStrategy(new LaxRedirectStrategyForAllRedirectResponseCodes())
|
||||
.build();
|
||||
logger.info("Using " + startTrackingURI.toString() + " to start tracking");
|
||||
final HttpResponse response = client.execute(request);
|
||||
try {
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
id="org.apache.commons.codec"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="1.6.0.v201305230611"
|
||||
version="1.10.0.v20180409-1845"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
@@ -81,14 +81,14 @@
|
||||
id="org.apache.httpcomponents.httpclient"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="4.2.6.v201311072007"
|
||||
version="4.5.5.v20180409-1525"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.apache.httpcomponents.httpcore"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="4.2.5.v201311072007"
|
||||
version="4.4.9.v20180409-1525"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
eclipse.preferences.version=1
|
||||
entryPointModules=
|
||||
filesCopiedToWebInfLib=
|
||||
gwtCompileSettings=PGd3dC1jb21waWxlLXNldHRpbmdzPjxsb2ctbGV2ZWw+SU5GTzwvbG9nLWxldmVsPjxvdXRwdXQtc3R5bGU+T0JGVVNDQVRFRDwvb3V0cHV0LXN0eWxlPjxleHRyYS1hcmdzPjwhW0NEQVRBWy1sb2NhbFdvcmtlcnMgMTAgIC13YXIgLi9dXT48L2V4dHJhLWFyZ3M+PHZtLWFyZ3M+PCFbQ0RBVEFbLVhteDJnXV0+PC92bS1hcmdzPjxlbnRyeS1wb2ludC1tb2R1bGU+Y29tLnNhcC5zYWlsaW5nLmd3dC51aS5TaW11bGF0b3I8L2VudHJ5LXBvaW50LW1vZHVsZT48ZW50cnktcG9pbnQtbW9kdWxlPmNvbS5zYXAuc2FpbGluZy5nd3QudWkuTGVhZGVyYm9hcmQ8L2VudHJ5LXBvaW50LW1vZHVsZT48ZW50cnktcG9pbnQtbW9kdWxlPmNvbS5zYXAuc2FpbGluZy5nd3QuaG9tZS5Ib21lPC9lbnRyeS1wb2ludC1tb2R1bGU+PGVudHJ5LXBvaW50LW1vZHVsZT5jb20uc2FwLnNhaWxpbmcuZ3d0LnVpLlNwZWN0YXRvcjwvZW50cnktcG9pbnQtbW9kdWxlPjxlbnRyeS1wb2ludC1tb2R1bGU+Y29tLnNhcC5zYWlsaW5nLmd3dC51aS5BZG1pbkNvbnNvbGU8L2VudHJ5LXBvaW50LW1vZHVsZT48ZW50cnktcG9pbnQtbW9kdWxlPmNvbS5zYXAuc2FpbGluZy5nd3QudWkuWW91dHViZVBvcHVwPC9lbnRyeS1wb2ludC1tb2R1bGU+PGVudHJ5LXBvaW50LW1vZHVsZT5jb20uc2FwLnNhaWxpbmcuZ3d0LnVpLkRhdGFNaW5pbmc8L2VudHJ5LXBvaW50LW1vZHVsZT48ZW50cnktcG9pbnQtbW9kdWxlPmNvbS5zYXAuc2FpbGluZy5nd3QucmVnYXR0YW92ZXJ2aWV3LlJlZ2F0dGFPdmVydmlldzwvZW50cnktcG9pbnQtbW9kdWxlPjxlbnRyeS1wb2ludC1tb2R1bGU+Y29tLnNhcC5zYWlsaW5nLmd3dC51aS5WaWRlb1BvcHVwPC9lbnRyeS1wb2ludC1tb2R1bGU+PGVudHJ5LXBvaW50LW1vZHVsZT5jb20uc2FwLnNhaWxpbmcuZ3d0LnVpLkVtYmVkZGVkTWFwQW5kV2luZENoYXJ0PC9lbnRyeS1wb2ludC1tb2R1bGU+PGVudHJ5LXBvaW50LW1vZHVsZT5jb20uc2FwLnNhaWxpbmcuZ3d0LnVpLlBhaXJpbmdMaXN0PC9lbnRyeS1wb2ludC1tb2R1bGU+PGVudHJ5LXBvaW50LW1vZHVsZT5jb20uc2FwLnNhaWxpbmcuZ3d0LnVpLkxlYWRlcmJvYXJkRWRpdGluZzwvZW50cnktcG9pbnQtbW9kdWxlPjxlbnRyeS1wb2ludC1tb2R1bGU+Y29tLnNhcC5zYWlsaW5nLmd3dC5hdXRvcGxheS5BdXRvUGxheTwvZW50cnktcG9pbnQtbW9kdWxlPjxlbnRyeS1wb2ludC1tb2R1bGU+Y29tLnNhcC5zYWlsaW5nLmd3dC51aS5SYWNlQm9hcmQ8L2VudHJ5LXBvaW50LW1vZHVsZT48L2d3dC1jb21waWxlLXNldHRpbmdzPg\=\=
|
||||
gwtCompileSettings=PGd3dC1jb21waWxlLXNldHRpbmdzPjxsb2ctbGV2ZWw+SU5GTzwvbG9nLWxldmVsPjxvdXRwdXQtc3R5bGU+T0JGVVNDQVRFRDwvb3V0cHV0LXN0eWxlPjxleHRyYS1hcmdzPjwhW0NEQVRBWy1sb2NhbFdvcmtlcnMgMTAgIC13YXIgLi9dXT48L2V4dHJhLWFyZ3M+PHZtLWFyZ3M+PCFbQ0RBVEFbLVhteDJnXV0+PC92bS1hcmdzPjxlbnRyeS1wb2ludC1tb2R1bGU+Y29tLnNhcC5zYWlsaW5nLmd3dC51aS5BZG1pbkNvbnNvbGVQd2E8L2VudHJ5LXBvaW50LW1vZHVsZT48L2d3dC1jb21waWxlLXNldHRpbmdzPg\=\=
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.jdt.debug.ui.CONSIDER_INHERITED_MAIN" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="false"/>
|
||||
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8" javaProject="com.sap.sailing.gwt.ui" path="1" type="4"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.gwt.ui/src/main/resources" path="3" type="2"/> "/>
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="com.gwtplugins.gdt.eclipse.suite.webapp">
|
||||
<booleanAttribute key="com.gwtplugins.gdt.eclipse.core.RUN_SERVER" value="false"/>
|
||||
<stringAttribute key="com.gwtplugins.gdt.eclipse.suiteMainTypeProcessor.PREVIOUSLY_SET_MAIN_TYPE_NAME" value="com.google.gwt.dev.DevMode"/>
|
||||
<booleanAttribute key="com.gwtplugins.gdt.eclipse.suiteWarArgumentProcessor.IS_WAR_FROM_PROJECT_PROPERTIES" value="true"/>
|
||||
<stringAttribute key="com.gwtplugins.gwt.eclipse.core.CLASSIC_DEVMODE_CODE_SERVER_PORT" value="9876"/>
|
||||
<listAttribute key="com.gwtplugins.gwt.eclipse.core.ENTRY_POINT_MODULES">
|
||||
<listEntry value="com.sap.sailing.gwt.ui.AdminConsole"/>
|
||||
<listEntry value="com.sap.sailing.gwt.home.Home"/>
|
||||
<listEntry value="com.sap.sailing.gwt.ui.AdminConsolePwa"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="com.gwtplugins.gwt.eclipse.core.SUPERDEVMODE_ENABLED" value="true"/>
|
||||
<stringAttribute key="com.gwtplugins.gwt.eclipse.core.URL" value="/gwt/Home.html"/>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/com.sap.sailing.gwt.ui"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="4"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
|
||||
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
|
||||
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.jdt.debug.ui.CONSIDER_INHERITED_MAIN" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS" value="true"/>
|
||||
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8" javaProject="com.sap.sailing.gwt.ui" path="1" type="4"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.gwt.ui/src/main/resources" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.gwt.ui/src/main/java" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.domain/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.googlecode.java-diff-utils/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.domain.shared.android/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.domain.common/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.common/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.datamining.annotations/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.security.common/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.shared.android/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/org.json.simple/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.geocoding/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.datamining.shared/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.declination/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.datamining.ui/src/main/resources" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.declination/resources" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.server/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.server/resources" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.expeditionconnector/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.udpconnector/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.server.gateway.serialization.shared.android/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.expeditionconnector.common/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.gwt/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.gwt/resources" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.filestorage/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.filestorage/resources" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.mongodb/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.replication/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.operationaltransformation/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.expeditionconnector.persistence/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.domain.persistence/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.server.gateway.serialization/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.simulator/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.simulator/resources" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.domain.tractracadapter/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.tractrac.clientmodule/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.security/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.security/resources" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.mail/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.domain.swisstimingadapter/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.xrr.resultimport/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.resultimport/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.competitorimport/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.xrr.schema/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.domain.swisstimingadapter.persistence/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.domain.tractracadapter.persistence/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/org.moxieapps.gwt.highcharts/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.freg.resultimport/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.domain.swisstimingreplayadapter/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.domain.igtimiadapter/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.domain.igtimiadapter.persistence/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.datamining.shared/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.datamining/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.datamining/resources" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.datamining/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.datamining/resources" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.datamining.provider/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.domain.racelogtrackingadapter/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.domain.racelogtrackingadapter/resources" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.manage2sail/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.manage2sail/resources" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.xrr.structureimport/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.security.ui/src/main/java" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.security.ui/src/main/resources" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.gwt.adminconsole/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.news/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.polars.datamining.shared/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.polars.datamining/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.polars.datamining/resources" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="false" project="com.sap.sailing.gwt.ui"/> </runtimeClasspathEntry> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry path="3" projectName="com.sap.sse.common" type="1"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.datamining.ui/src/main/java" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.github.branflake2267.gwt-maps-api/src" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.google.gwt.ajaxloader/src" path="3" type="2"/> "/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="com.gwtplugins.gwt.eclipse.core.moduleClasspathProvider"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.DevMode"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MODULE_NAME" value="com.sap.sailing.gwt.ui"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-style PRETTY -incremental -war "${project_loc:com.sap.sailing.gwt.ui}" -noserver -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -logLevel INFO -codeServerPort 9876 -startupUrl /gwt/Home.html -startupUrl /gwt/AdminConsole.html -startupUrl /gwt/PairingList.html -startupUrl /gwt/LeaderboardEditing.html -startupUrl /gwt/Leaderboard.html -startupUrl /gwt/Spectator.html -startupUrl /gwt/EmbeddedMapAndWindChart -startupUrl /gwt/RaceBoard.html -startupUrl /gwt/RegattaOverview.html -startupUrl /gwt/DataMining.html -startupUrl /gwt/Simulator.html -startupUrl /gwt/VideoPopup.html -startupUrl /gwt/AutoPlay.html -startupUrl /gwt/YoutubePopup.html com.sap.sailing.gwt.home.Home com.sap.sailing.gwt.ui.AdminConsole com.sap.sailing.gwt.ui.AdminConsolePwa"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.gwt.ui"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-XX:+UseG1GC -XX:+UseStringDeduplication -Dgwt.watchFileChanges=false -Xmx2048m -Dgwt-usearchives=false -Dgwt.persistentunitcache=false"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${project_loc:com.sap.sailing.gwt.ui}/.tmp/gwt-work"/>
|
||||
</launchConfiguration>
|
||||
@@ -71,7 +71,7 @@ Import-Package: javax.servlet;version="3.1.0",
|
||||
javax.servlet.http;version="3.1.0",
|
||||
javax.ws.rs;version="1.1.1",
|
||||
javax.ws.rs.core;version="1.1.1",
|
||||
org.apache.http.client;version="[4.2.5,4.3.0)",
|
||||
org.apache.http.client;version="4.5.5",
|
||||
org.json.simple,
|
||||
org.json.simple.parser,
|
||||
org.osgi.framework,
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -731,7 +731,7 @@
|
||||
/**
|
||||
* @module lib/embed
|
||||
*/
|
||||
var oEmbedParameters = ['autopause', 'autoplay', 'background', 'byline', 'color', 'height', 'id', 'loop', 'maxheight', 'maxwidth', 'muted', 'playsinline', 'portrait', 'responsive', 'speed', 'title', 'transparent', 'url', 'width'];
|
||||
var oEmbedParameters = ['dnt', 'autopause', 'autoplay', 'background', 'byline', 'color', 'height', 'id', 'loop', 'maxheight', 'maxwidth', 'muted', 'playsinline', 'portrait', 'responsive', 'speed', 'title', 'transparent', 'url', 'width'];
|
||||
/**
|
||||
* Get the 'data-vimeo'-prefixed attributes from an element as an object.
|
||||
*
|
||||
@@ -2433,7 +2433,8 @@ var Vimeo = function (_Tech) {
|
||||
url: this.options_.source.src,
|
||||
byline: false,
|
||||
portrait: false,
|
||||
title: false
|
||||
title: false,
|
||||
dnt: true
|
||||
};
|
||||
|
||||
if (this.options_.autoplay) {
|
||||
@@ -2457,6 +2458,9 @@ var Vimeo = function (_Tech) {
|
||||
if (this.options_.color) {
|
||||
// vimeo is the only API on earth to reject hex color with leading #
|
||||
vimeoOptions.color = this.options_.color.replace(/^#/, '');
|
||||
}
|
||||
if (this.options_.dnt) {
|
||||
vimeoOptions.dnt = this.options_.dnt;
|
||||
}
|
||||
|
||||
this._player = new _player2.default(this.el(), vimeoOptions);
|
||||
@@ -2520,7 +2524,7 @@ var Vimeo = function (_Tech) {
|
||||
};
|
||||
|
||||
Vimeo.prototype.createEl = function createEl() {
|
||||
var div = _video2.default.createEl('div', {
|
||||
var div = _video2.default.dom.createEl('div', {
|
||||
id: this.options_.techId
|
||||
});
|
||||
|
||||
|
||||
+1
-1
@@ -427,7 +427,7 @@ public abstract class AbstractTrackedRacesListComposite extends AbstractComposit
|
||||
userService.getUserManagementWriteService(), type, regatta -> regattaRefresher.fillRegattas(),
|
||||
stringMessages);
|
||||
actionsColumn.addAction(RegattaConfigImagesBarCell.ACTION_CHANGE_ACL, DefaultActions.CHANGE_ACL,
|
||||
configACL::openACLDialog);
|
||||
configACL::openDialog);
|
||||
|
||||
actionsColumn.addAction(RegattaConfigImagesBarCell.ACTION_DELETE, DefaultActions.DELETE,
|
||||
this::removeAndUntrackRace);
|
||||
|
||||
+1
-1
@@ -185,7 +185,7 @@ public class BoatTableWrapper<S extends RefreshableSelectionModel<BoatDTO>> exte
|
||||
final EditACLDialog.DialogConfig<BoatDTO> configACL = EditACLDialog
|
||||
.create(userService.getUserManagementWriteService(), type, null, stringMessages);
|
||||
boatActionColumn.addAction(BoatConfigImagesBarCell.ACTION_CHANGE_ACL, DefaultActions.CHANGE_ACL,
|
||||
configACL::openACLDialog);
|
||||
configACL::openDialog);
|
||||
mainPanel.insert(filterField, 0);
|
||||
table.addColumnSortHandler(boatColumnListHandler);
|
||||
table.addColumn(boatNameColumn, stringMessages.name());
|
||||
|
||||
+1
-1
@@ -337,7 +337,7 @@ public class CompetitorTableWrapper<S extends RefreshableSelectionModel<Competit
|
||||
final EditACLDialog.DialogConfig<CompetitorDTO> configACL = EditACLDialog
|
||||
.create(userService.getUserManagementWriteService(), type, null, stringMessages);
|
||||
competitorActionColumn.addAction(CompetitorConfigImagesBarCell.ACTION_CHANGE_ACL, DefaultActions.CHANGE_ACL,
|
||||
configACL::openACLDialog);
|
||||
configACL::openDialog);
|
||||
mainPanel.insert(filterField, 0);
|
||||
table.addColumnSortHandler(competitorColumnListHandler);
|
||||
table.addColumn(competitorNameColumn, getStringMessages().name());
|
||||
|
||||
+1
-1
@@ -161,7 +161,7 @@ public class DeviceConfigurationListComposite extends Composite {
|
||||
actionColumn.addAction(DefaultActionsImagesBarCell.ACTION_CHANGE_OWNERSHIP, DefaultActions.CHANGE_OWNERSHIP,
|
||||
configOwnership::openOwnershipDialog);
|
||||
actionColumn.addAction(DefaultActionsImagesBarCell.ACTION_CHANGE_ACL, DefaultActions.CHANGE_ACL,
|
||||
u -> configACL.openACLDialog(u));
|
||||
u -> configACL.openDialog(u));
|
||||
SecuredDTOOwnerColumn.configureOwnerColumns(table, columnSortHandler, stringMessages);
|
||||
table.addColumn(deviceConfigurationUUidColumn, stringMessages.id());
|
||||
table.addColumn(actionColumn, stringMessages.actions());
|
||||
|
||||
+3
-25
@@ -16,8 +16,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.google.gwt.cell.client.AbstractCell;
|
||||
import com.google.gwt.cell.client.SafeHtmlCell;
|
||||
import com.google.gwt.cell.client.ValueUpdater;
|
||||
@@ -79,7 +77,6 @@ import com.sap.sse.security.ui.client.component.EditOwnershipDialog.DialogConfig
|
||||
import com.sap.sse.security.ui.client.component.SecuredDTOOwnerColumn;
|
||||
import com.sap.sse.security.ui.client.component.editacl.EditACLDialog;
|
||||
|
||||
/**
|
||||
/**
|
||||
* A composite showing the list of all sailing events
|
||||
* @author Frank Mittag (C5163974)
|
||||
@@ -317,24 +314,11 @@ public class EventListComposite extends Composite implements EventsRefresher, Le
|
||||
});
|
||||
final DialogConfig<EventDTO> config = EditOwnershipDialog.create(userService.getUserManagementWriteService(), EVENT,
|
||||
event -> fillEvents(), stringMessages);
|
||||
actionsColumn.addAction(EventConfigImagesBarCell.ACTION_CHANGE_OWNERSHIP, CHANGE_OWNERSHIP,
|
||||
// Explicitly using an anonymous inner class. Using a method reference caused problems with the GWT compiler (see bug 5269)
|
||||
new Consumer<EventDTO>() {
|
||||
@Override
|
||||
public void accept(EventDTO t) {
|
||||
config.openOwnershipDialog(t);
|
||||
}
|
||||
});
|
||||
actionsColumn.addAction(EventConfigImagesBarCell.ACTION_CHANGE_OWNERSHIP, CHANGE_OWNERSHIP, config::openOwnershipDialog);
|
||||
final EditACLDialog.DialogConfig<EventDTO> configACL = EditACLDialog.create(
|
||||
userService.getUserManagementWriteService(), EVENT, event -> fillEvents(), stringMessages);
|
||||
actionsColumn.addAction(EventConfigImagesBarCell.ACTION_CHANGE_ACL, DefaultActions.CHANGE_ACL,
|
||||
// Explicitly using an anonymous inner class. Using a method reference caused problems with the GWT compiler (see bug 5269)
|
||||
new Consumer<EventDTO>() {
|
||||
@Override
|
||||
public void accept(EventDTO e) {
|
||||
configACL.openACLDialog(e);
|
||||
}
|
||||
});
|
||||
configACL::openDialog);
|
||||
final MigrateGroupOwnershipDialog.DialogConfig<EventDTO> migrateDialogConfig = MigrateGroupOwnershipDialog
|
||||
.create(userService.getUserManagementService(), (event, dto) -> {
|
||||
sailingServiceWrite.updateGroupOwnerForEventHierarchy(event.id, dto, new AsyncCallback<Void>() {
|
||||
@@ -350,13 +334,7 @@ public class EventListComposite extends Composite implements EventsRefresher, Le
|
||||
});
|
||||
});
|
||||
actionsColumn.addAction(EventConfigImagesBarCell.ACTION_MIGRATE_GROUP_OWNERSHIP_HIERARCHY, CHANGE_OWNERSHIP,
|
||||
// Explicitly using an anonymous inner class. Using a method reference caused problems with the GWT compiler (see bug 5269)
|
||||
new Consumer<EventDTO>() {
|
||||
@Override
|
||||
public void accept(EventDTO t) {
|
||||
migrateDialogConfig.openDialog(t);
|
||||
}
|
||||
});
|
||||
migrateDialogConfig::openDialog);
|
||||
eventNameColumn.setSortable(true);
|
||||
venueNameColumn.setSortable(true);
|
||||
isPublicColumn.setSortable(true);
|
||||
|
||||
+1
-1
@@ -160,7 +160,7 @@ public class ExpeditionDeviceConfigurationsPanel extends FlowPanel {
|
||||
final EditACLDialog.DialogConfig<ExpeditionDeviceConfiguration> configACL = EditACLDialog
|
||||
.create(userService.getUserManagementWriteService(), type, deviceConfiguration -> refresh(), stringMessages);
|
||||
actionsColumn.addAction(DefaultActionsImagesBarCell.ACTION_CHANGE_ACL, DefaultActions.CHANGE_ACL,
|
||||
deviceConfiguration -> configACL.openACLDialog(deviceConfiguration));
|
||||
deviceConfiguration -> configACL.openDialog(deviceConfiguration));
|
||||
SecuredDTOOwnerColumn.configureOwnerColumns(allDeviceConfigurations, deviceConfigurationColumnListHandler,
|
||||
stringMessages);
|
||||
allDeviceConfigurations.addColumn(actionsColumn, stringMessages.actions());
|
||||
|
||||
+1
-1
@@ -241,7 +241,7 @@ public class IgtimiAccountsPanel extends FlowPanel {
|
||||
final EditACLDialog.DialogConfig<AccountWithSecurityDTO> configACL = EditACLDialog
|
||||
.create(userService.getUserManagementWriteService(), type, roleDefinition -> refresh(), stringMessages);
|
||||
roleActionColumn.addAction(DefaultActionsImagesBarCell.ACTION_CHANGE_ACL, DefaultActions.CHANGE_ACL,
|
||||
configACL::openACLDialog);
|
||||
configACL::openDialog);
|
||||
|
||||
table.addColumn(accountSelectionCheckboxColumn, accountSelectionCheckboxColumn.getHeader());
|
||||
table.addColumn(accountNameColumn, stringMessages.name());
|
||||
|
||||
+1
-1
@@ -374,7 +374,7 @@ public class LeaderboardConfigPanel extends AbstractLeaderboardConfigPanel
|
||||
new Consumer<StrippedLeaderboardDTOWithSecurity>() {
|
||||
@Override
|
||||
public void accept(StrippedLeaderboardDTOWithSecurity t) {
|
||||
configACL.openACLDialog(t);
|
||||
configACL.openDialog(t);
|
||||
}
|
||||
});
|
||||
leaderboardTable.addColumn(selectionCheckboxColumn, selectionCheckboxColumn.getHeader());
|
||||
|
||||
+3
-22
@@ -15,7 +15,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -557,24 +556,12 @@ public class LeaderboardGroupConfigPanel extends AbstractRegattaPanel
|
||||
userService.getUserManagementWriteService(), type,
|
||||
group -> leaderboardGroupsRefresher.fillLeaderboardGroups(), stringMessages);
|
||||
actionsColumn.addAction(LeaderboardGroupConfigImagesBarCell.ACTION_CHANGE_OWNERSHIP, CHANGE_OWNERSHIP,
|
||||
// Explicitly using an anonymous inner class. Using a method reference caused problems with the GWT compiler (see bug 5269)
|
||||
new Consumer<LeaderboardGroupDTO>() {
|
||||
@Override
|
||||
public void accept(LeaderboardGroupDTO e) {
|
||||
config.openOwnershipDialog(e);
|
||||
}
|
||||
});
|
||||
e -> config.openOwnershipDialog(e));
|
||||
final EditACLDialog.DialogConfig<LeaderboardGroupDTO> configACL = EditACLDialog.create(
|
||||
userService.getUserManagementWriteService(), type,
|
||||
group -> leaderboardGroupsRefresher.fillLeaderboardGroups(), stringMessages);
|
||||
actionsColumn.addAction(LeaderboardGroupConfigImagesBarCell.ACTION_CHANGE_ACL, DefaultActions.CHANGE_ACL,
|
||||
// Explicitly using an anonymous inner class. Using a method reference caused problems with the GWT compiler (see bug 5269)
|
||||
new Consumer<LeaderboardGroupDTO>() {
|
||||
@Override
|
||||
public void accept(LeaderboardGroupDTO e) {
|
||||
configACL.openACLDialog(e);
|
||||
}
|
||||
});
|
||||
e -> configACL.openDialog(e));
|
||||
final MigrateGroupOwnershipDialog.DialogConfig<LeaderboardGroupDTO> migrateDialogConfig = MigrateGroupOwnershipDialog
|
||||
.create(userService.getUserManagementService(), (lg, dto) -> {
|
||||
sailingServiceWrite.updateGroupOwnerForLeaderboardGroupHierarchy(lg.getId(), dto,
|
||||
@@ -591,13 +578,7 @@ public class LeaderboardGroupConfigPanel extends AbstractRegattaPanel
|
||||
});
|
||||
});
|
||||
actionsColumn.addAction(EventConfigImagesBarCell.ACTION_MIGRATE_GROUP_OWNERSHIP_HIERARCHY, CHANGE_OWNERSHIP,
|
||||
// Explicitly using an anonymous inner class. Using a method reference caused problems with the GWT compiler (see bug 5269)
|
||||
new Consumer<LeaderboardGroupDTO>() {
|
||||
@Override
|
||||
public void accept(LeaderboardGroupDTO e) {
|
||||
migrateDialogConfig.openDialog(e);
|
||||
}
|
||||
});
|
||||
e -> migrateDialogConfig.openDialog(e));
|
||||
SelectionCheckboxColumn<LeaderboardGroupDTO> leaderboardTableSelectionColumn =
|
||||
new SelectionCheckboxColumn<LeaderboardGroupDTO>(
|
||||
tableResources.cellTableStyle().cellTableCheckboxSelected(),
|
||||
|
||||
+1
-1
@@ -96,7 +96,7 @@ public class LocalServerManagementPanel extends SimplePanel {
|
||||
buttonPanel.addAction(stringMessages.actionChangeOwnership(), () -> permissionCheck.test(CHANGE_OWNERSHIP),
|
||||
() -> configOwner.openOwnershipDialog(currentServerInfo));
|
||||
buttonPanel.addAction(stringMessages.actionChangeACL(), () -> permissionCheck.test(CHANGE_ACL),
|
||||
() -> configACL.openACLDialog(currentServerInfo));
|
||||
() -> configACL.openDialog(currentServerInfo));
|
||||
return buttonPanel;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -587,7 +587,7 @@ public class MediaPanel extends FlowPanel implements MediaTracksRefresher {
|
||||
stringMessages);
|
||||
actionsColumn.addAction(ACTION_CHANGE_OWNERSHIP, CHANGE_OWNERSHIP, configOwnership::openOwnershipDialog);
|
||||
actionsColumn.addAction(DefaultActionsImagesBarCell.ACTION_CHANGE_ACL, DefaultActions.CHANGE_ACL,
|
||||
mediaTrack -> configACL.openACLDialog(mediaTrack));
|
||||
mediaTrack -> configACL.openDialog(mediaTrack));
|
||||
mediaTracksTable.addColumn(actionsColumn, stringMessages.actions());
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -293,7 +293,7 @@ public class RegattaListComposite extends Composite implements RegattasDisplayer
|
||||
userService.getUserManagementWriteService(), type, regatta -> regattaRefresher.fillRegattas(),
|
||||
stringMessages);
|
||||
actionsColumn.addAction(RegattaConfigImagesBarCell.ACTION_CHANGE_ACL, DefaultActions.CHANGE_ACL,
|
||||
regattaDTO -> configACL.openACLDialog(regattaDTO));
|
||||
regattaDTO -> configACL.openDialog(regattaDTO));
|
||||
table.addColumn(regattaSelectionCheckboxColumn, regattaSelectionCheckboxColumn.getHeader());
|
||||
table.addColumn(regattaNameColumn, stringMessages.regattaName());
|
||||
table.addColumn(regattaCanBoatsOfCompetitorsChangePerRaceColumn, stringMessages.canBoatsChange());
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ public class ResultImportUrlsTableWrapper<S extends RefreshableSelectionModel<Ur
|
||||
EditACLDialog.DialogConfig<UrlDTO> configACL = EditACLDialog.create(userService.getUserManagementWriteService(),
|
||||
SecuredDomainType.RESULT_IMPORT_URL, event -> update(), stringMessages);
|
||||
actionsColumn.addAction(DefaultActionsImagesBarCell.ACTION_CHANGE_ACL, DefaultActions.CHANGE_ACL,
|
||||
e -> configACL.openACLDialog(e));
|
||||
e -> configACL.openDialog(e));
|
||||
|
||||
super.table.addColumn(urlColumn, stringMessages.url());
|
||||
SecuredDTOOwnerColumn.configureOwnerColumns(super.table, listHandler, stringMessages);
|
||||
|
||||
+1
-1
@@ -217,7 +217,7 @@ public class SmartphoneTrackingEventManagementPanel
|
||||
leaderboardActionColumn.addAction(DefaultActionsImagesBarCell.ACTION_CHANGE_OWNERSHIP, DefaultActions.UPDATE,
|
||||
configOwnership::openOwnershipDialog);
|
||||
leaderboardActionColumn.addAction(DefaultActionsImagesBarCell.ACTION_CHANGE_ACL, DefaultActions.UPDATE,
|
||||
configACL::openACLDialog);
|
||||
configACL::openDialog);
|
||||
leaderboardTable.addColumn(selectionCheckboxColumn, selectionCheckboxColumn.getHeader());
|
||||
leaderboardTable.addColumn(leaderboardNameColumn, stringMessages.name());
|
||||
leaderboardTable.addColumn(leaderboardDisplayNameColumn, stringMessages.displayName());
|
||||
|
||||
+1
-1
@@ -331,7 +331,7 @@ public class CourseTemplatePanel extends FlowPanel {
|
||||
actionsColumn.addAction(ACTION_UPDATE, UPDATE, e -> openEditCourseTemplateDialog(e, userService, false));
|
||||
actionsColumn.addAction(ACTION_CHANGE_OWNERSHIP, CHANGE_OWNERSHIP, configOwnership::openOwnershipDialog);
|
||||
actionsColumn.addAction(DefaultActionsImagesBarCell.ACTION_CHANGE_ACL, DefaultActions.CHANGE_ACL,
|
||||
courseTemplate -> configACL.openACLDialog(courseTemplate));
|
||||
courseTemplate -> configACL.openDialog(courseTemplate));
|
||||
courseTemplateTable.addColumn(idColumn, stringMessages.id());
|
||||
courseTemplateTable.addColumn(actionsColumn, stringMessages.actions());
|
||||
}
|
||||
|
||||
+1
-1
@@ -362,7 +362,7 @@ public class MarkPropertiesPanel extends FlowPanel {
|
||||
this::unsetPosition);
|
||||
actionsColumn.addAction(ACTION_CHANGE_OWNERSHIP, CHANGE_OWNERSHIP, configOwnership::openOwnershipDialog);
|
||||
actionsColumn.addAction(DefaultActionsImagesBarCell.ACTION_CHANGE_ACL, DefaultActions.CHANGE_ACL,
|
||||
markProperties -> configACL.openACLDialog(markProperties));
|
||||
markProperties -> configACL.openDialog(markProperties));
|
||||
markPropertiesTable.addColumn(idColumn, stringMessages.id());
|
||||
markPropertiesTable.addColumn(actionsColumn, stringMessages.actions());
|
||||
}
|
||||
|
||||
+1
-1
@@ -244,7 +244,7 @@ public class MarkRolePanel extends FlowPanel {
|
||||
markRole -> markRole.getAccessControlList(), stringMessages);
|
||||
actionsColumn.addAction(ACTION_CHANGE_OWNERSHIP, CHANGE_OWNERSHIP, configOwnership::openOwnershipDialog);
|
||||
actionsColumn.addAction(DefaultActionsImagesBarCell.ACTION_CHANGE_ACL, DefaultActions.CHANGE_ACL,
|
||||
markRole -> configACL.openACLDialog(markRole));
|
||||
markRole -> configACL.openDialog(markRole));
|
||||
markRolesTable.addColumn(idColumn, stringMessages.id());
|
||||
markRolesTable.addColumn(actionsColumn, stringMessages.actions());
|
||||
}
|
||||
|
||||
+1
-1
@@ -278,7 +278,7 @@ public class MarkTemplatePanel extends FlowPanel {
|
||||
stringMessages);
|
||||
actionsColumn.addAction(ACTION_CHANGE_OWNERSHIP, CHANGE_OWNERSHIP, configOwnership::openOwnershipDialog);
|
||||
actionsColumn.addAction(DefaultActionsImagesBarCell.ACTION_CHANGE_ACL, DefaultActions.CHANGE_ACL,
|
||||
markTemplate -> configACL.openACLDialog(markTemplate));
|
||||
markTemplate -> configACL.openDialog(markTemplate));
|
||||
markTemplateTable.addColumn(idColumn, stringMessages.id());
|
||||
markTemplateTable.addColumn(actionsColumn, stringMessages.actions());
|
||||
}
|
||||
|
||||
+1
-1
@@ -121,7 +121,7 @@ public class SwissTimingArchivedConnectionTableWrapper extends
|
||||
actionColumn.addAction(DefaultActionsImagesBarCell.ACTION_CHANGE_OWNERSHIP, DefaultActions.CHANGE_OWNERSHIP,
|
||||
configOwnership::openOwnershipDialog);
|
||||
actionColumn.addAction(DefaultActionsImagesBarCell.ACTION_CHANGE_ACL, DefaultActions.CHANGE_ACL,
|
||||
u -> configACL.openACLDialog(u));
|
||||
u -> configACL.openDialog(u));
|
||||
filterField = new LabeledAbstractFilterablePanel<SwissTimingArchiveConfigurationWithSecurityDTO>(
|
||||
new Label(stringMessages.filterSwissTimingAchivedConnections()),
|
||||
new ArrayList<SwissTimingArchiveConfigurationWithSecurityDTO>(), dataProvider, stringMessages) {
|
||||
|
||||
+1
-1
@@ -138,7 +138,7 @@ public class SwissTimingConnectionTableWrapper extends
|
||||
actionColumn.addAction(DefaultActionsImagesBarCell.ACTION_CHANGE_OWNERSHIP, DefaultActions.CHANGE_OWNERSHIP,
|
||||
configOwnership::openOwnershipDialog);
|
||||
actionColumn.addAction(DefaultActionsImagesBarCell.ACTION_CHANGE_ACL, DefaultActions.CHANGE_ACL,
|
||||
u -> configACL.openACLDialog(u));
|
||||
u -> configACL.openDialog(u));
|
||||
|
||||
filterField = new LabeledAbstractFilterablePanel<SwissTimingConfigurationWithSecurityDTO>(
|
||||
new Label(stringMessagesClient.filterSwissTimingConnections()),
|
||||
|
||||
+1
-1
@@ -132,7 +132,7 @@ public class TracTracConnectionTableWrapper extends
|
||||
actionColumn.addAction(DefaultActionsImagesBarCell.ACTION_CHANGE_OWNERSHIP, DefaultActions.CHANGE_OWNERSHIP,
|
||||
configOwnership::openOwnershipDialog);
|
||||
actionColumn.addAction(DefaultActionsImagesBarCell.ACTION_CHANGE_ACL, DefaultActions.CHANGE_ACL,
|
||||
u -> configACL.openACLDialog(u));
|
||||
u -> configACL.openDialog(u));
|
||||
filterField = new LabeledAbstractFilterablePanel<TracTracConfigurationWithSecurityDTO>(
|
||||
new Label(stringMessages.filterTracTracConnections()),
|
||||
new ArrayList<TracTracConfigurationWithSecurityDTO>(), dataProvider, stringMessages) {
|
||||
|
||||
+29
-8
@@ -15,6 +15,8 @@ import com.google.gwt.event.logical.shared.ValueChangeEvent;
|
||||
import com.google.gwt.event.logical.shared.ValueChangeHandler;
|
||||
import com.google.gwt.media.client.Audio;
|
||||
import com.google.gwt.media.client.MediaBase;
|
||||
import com.google.gwt.regexp.shared.MatchResult;
|
||||
import com.google.gwt.regexp.shared.RegExp;
|
||||
import com.google.gwt.typedarrays.shared.Int8Array;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.gwt.user.client.ui.Button;
|
||||
@@ -203,6 +205,8 @@ public class NewMediaDialog extends DataEntryDialog<MediaTrack> implements FileS
|
||||
mediaTrack.startTime = defaultStartTime;
|
||||
}
|
||||
|
||||
|
||||
boolean isVimeoUrl = isVimeoUrl(url);
|
||||
String youtubeId = YoutubeApi.getIdByUrl(url);
|
||||
if (youtubeId != null) {
|
||||
mediaTrack.url = youtubeId;
|
||||
@@ -224,6 +228,9 @@ public class NewMediaDialog extends DataEntryDialog<MediaTrack> implements FileS
|
||||
}
|
||||
}
|
||||
});
|
||||
} else if (isVimeoUrl) {
|
||||
mediaTrack.url = url;
|
||||
mediaTrack.mimeType = MimeType.vimeo;
|
||||
} else {
|
||||
mediaTrack.url = url;
|
||||
AnchorElement anchor = Document.get().createAnchorElement();
|
||||
@@ -250,6 +257,17 @@ public class NewMediaDialog extends DataEntryDialog<MediaTrack> implements FileS
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isVimeoUrl(String url) {
|
||||
try {
|
||||
RegExp urlPattern = RegExp.compile("^(.*:)//([A-Za-z0-9\\-\\.]+)(:[0-9]+)?(.*)$");
|
||||
MatchResult matchResult = urlPattern.exec(url);
|
||||
String host = matchResult.getGroup(2);
|
||||
return host.contains("vimeo.com");
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//used for audio only tracks, using native mediaelement to determine time
|
||||
private void loadMediaDuration() {
|
||||
MediaBase mediaBase = Audio.createIfSupported();
|
||||
@@ -336,12 +354,15 @@ public class NewMediaDialog extends DataEntryDialog<MediaTrack> implements FileS
|
||||
if (!remoteMp4WasStarted) {
|
||||
processMp4(mediaTrack);
|
||||
} else if (remoteMp4WasFinished) {
|
||||
manualMimeTypeSelection(null, mediaTrack);
|
||||
manualMimeTypeSelection(null, mediaTrack, MimeType.mp4MimeTypes());
|
||||
} else {
|
||||
infoLabel.setWidget(new Label(stringMessages.processingMP4()));
|
||||
}
|
||||
} else if (mediaTrack.mimeType == MimeType.vimeo) {
|
||||
infoLabel.setWidget(new Label(mediaTrack.typeToString()));
|
||||
} else {
|
||||
infoLabel.setWidget(new Label(mediaTrack.typeToString()));
|
||||
manualMimeTypeSelection(null, mediaTrack, new MimeType[] { MimeType.mp4, MimeType.mp4panorama,
|
||||
MimeType.mp4panoramaflip, MimeType.youtube, MimeType.vimeo });
|
||||
}
|
||||
}
|
||||
startTimeBox.setValue(mediaTrack.startTime == null ? null : mediaTrack.startTime.asDate(), DONT_FIRE_EVENTS);
|
||||
@@ -375,7 +396,7 @@ public class NewMediaDialog extends DataEntryDialog<MediaTrack> implements FileS
|
||||
public void onFailure(Throwable caught) {
|
||||
busyIndicator.setBusy(false);
|
||||
remoteMp4WasFinished = true;
|
||||
manualMimeTypeSelection(caught.getMessage(), mediaTrack);
|
||||
manualMimeTypeSelection(caught.getMessage(), mediaTrack, MimeType.mp4MimeTypes());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -444,7 +465,7 @@ public class NewMediaDialog extends DataEntryDialog<MediaTrack> implements FileS
|
||||
protected void mp4MetadataResult(VideoMetadataDTO result) {
|
||||
if (!result.isDownloadable()) {
|
||||
Notification.notify(stringMessages.couldNotDownload(mediaTrack.url), NotificationType.ERROR);
|
||||
manualMimeTypeSelection(result.getMessage(), mediaTrack);
|
||||
manualMimeTypeSelection(result.getMessage(), mediaTrack, MimeType.mp4MimeTypes());
|
||||
} else {
|
||||
mediaTrack.duration = result.getDuration();
|
||||
if (mediaTrack.duration == null) {
|
||||
@@ -459,15 +480,15 @@ public class NewMediaDialog extends DataEntryDialog<MediaTrack> implements FileS
|
||||
}
|
||||
}
|
||||
|
||||
private void manualMimeTypeSelection(String message, MediaTrack mediaTrack) {
|
||||
private void manualMimeTypeSelection(String message, MediaTrack mediaTrack, MimeType[] proposedMimeTypes) {
|
||||
FlowPanel fp = new FlowPanel();
|
||||
if (message != null) {
|
||||
fp.add(new Label(message));
|
||||
}
|
||||
ListBox mimeTypeListBox = createListBox(false);
|
||||
mimeTypeListBox.addItem(MimeType.mp4.name());
|
||||
mimeTypeListBox.addItem(MimeType.mp4panorama.name());
|
||||
mimeTypeListBox.addItem(MimeType.mp4panoramaflip.name());
|
||||
for (int i = 0; i < proposedMimeTypes.length; i++) {
|
||||
mimeTypeListBox.addItem(proposedMimeTypes[i].name());
|
||||
}
|
||||
mimeTypeListBox.addChangeHandler(new ChangeHandler() {
|
||||
@Override
|
||||
public void onChange(ChangeEvent event) {
|
||||
|
||||
+5
-2
@@ -143,8 +143,11 @@ public class VideoJSPlayer extends Widget implements RequiresResize {
|
||||
"customControlsOnMobile" : true,
|
||||
youtube: {
|
||||
enablePrivacyEnhancedMode: true,
|
||||
customVars: { rel: 0, modestbranding: 1 }
|
||||
}
|
||||
customVars: { rel: 0, modestbranding: 1 }
|
||||
},
|
||||
vimeo: {
|
||||
"dnt": 1,
|
||||
}
|
||||
});
|
||||
player.ready(function() {
|
||||
this.on('play', function() {
|
||||
|
||||
-1
@@ -8,7 +8,6 @@
|
||||
.player {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-height: 230px;
|
||||
}
|
||||
|
||||
.invertedVideoPlayer canvas{
|
||||
|
||||
+2
-19
@@ -3762,8 +3762,7 @@ public class SailingServiceImpl extends ResultCachingProxiedRemoteServiceServlet
|
||||
}
|
||||
|
||||
private VideoDTO convertToVideoDTO(VideoDescriptor video) {
|
||||
String videoRef = convertToNoCookieUrlWhereApplicable(video.getURL(), video.getMimeType());
|
||||
VideoDTO result = new VideoDTO(videoRef, video.getMimeType(),
|
||||
VideoDTO result = new VideoDTO(video.getURL().toString(), video.getMimeType(),
|
||||
video.getCreatedAtDate() != null ? video.getCreatedAtDate().asDate() : null);
|
||||
result.setCopyright(video.getCopyright());
|
||||
result.setTitle(video.getTitle());
|
||||
@@ -3778,23 +3777,7 @@ public class SailingServiceImpl extends ResultCachingProxiedRemoteServiceServlet
|
||||
result.setTags(tags);
|
||||
return result;
|
||||
}
|
||||
|
||||
private String convertToNoCookieUrlWhereApplicable(URL videoUrl, MimeType mimeType) {
|
||||
String result = videoUrl.toString();
|
||||
switch (mimeType) {
|
||||
case youtube:
|
||||
result.replace("youtube", "youtube-nocookies");
|
||||
break;
|
||||
case vimeo:
|
||||
result += videoUrl.getQuery() == null ? "?" : "&";
|
||||
result += "dnt=true";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
//READ
|
||||
private Locale toLocale(String localeName) {
|
||||
if(localeName == null || localeName.isEmpty()) {
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src">
|
||||
<attributes>
|
||||
<attribute name="test" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>com.sap.sailing.landscape.test</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@@ -0,0 +1,8 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.release=disabled
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
@@ -0,0 +1,3 @@
|
||||
eclipse.preferences.version=1
|
||||
pluginProject.extensions=false
|
||||
resolve.requirebundle=false
|
||||
@@ -0,0 +1,10 @@
|
||||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: com.sap.sailing.landscape.test
|
||||
Bundle-SymbolicName: com.sap.sailing.landscape.test
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Bundle-Vendor: SAP
|
||||
Fragment-Host: com.sap.sailing.landscape
|
||||
Automatic-Module-Name: com.sap.sailing.landscape.test
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Require-Bundle: org.junit
|
||||
@@ -0,0 +1,4 @@
|
||||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<artifactId>root</artifactId>
|
||||
<groupId>com.sap.sailing</groupId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>com.sap.sailing.landscape.test</artifactId>
|
||||
<!-- Once we have an idea how to test AWS landscape operations by passing in a secret key in a secure way
|
||||
we can make this an eclipse-test-plugin packaging; until then, only Eclipse-local tests that pass in
|
||||
the secrets as test VM parameters are possible, and this fragment is simply built as a Java OSGi fragments,
|
||||
not running any tests
|
||||
<packaging>eclipse-test-plugin</packaging>
|
||||
-->
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
</project>
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
package com.sap.sailing.landscape.test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.Random;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.sap.sailing.landscape.SailingAnalyticsHost;
|
||||
import com.sap.sailing.landscape.SailingAnalyticsMaster;
|
||||
import com.sap.sailing.landscape.SailingAnalyticsMetrics;
|
||||
import com.sap.sailing.landscape.SailingAnalyticsReplica;
|
||||
import com.sap.sailing.landscape.procedures.StartSailingAnalyticsMaster;
|
||||
import com.sap.sse.common.Duration;
|
||||
import com.sap.sse.landscape.application.ApplicationProcess;
|
||||
import com.sap.sse.landscape.application.impl.ApplicationProcessImpl;
|
||||
import com.sap.sse.landscape.aws.AwsLandscape;
|
||||
import com.sap.sse.landscape.aws.Tags;
|
||||
import com.sap.sse.landscape.aws.impl.AwsRegion;
|
||||
|
||||
import software.amazon.awssdk.regions.Region;
|
||||
import software.amazon.awssdk.services.ec2.model.Instance;
|
||||
import software.amazon.awssdk.services.ec2.model.InstanceType;
|
||||
import software.amazon.awssdk.services.ec2.model.Tag;
|
||||
|
||||
/**
|
||||
* Tests for the AWS SDK landscape wrapper in bundle {@code com.sap.sse.landscape.aws}. To run these tests
|
||||
* successfully it is necessary to have valid AWS credentials for region {@code EU_WEST_2} that allow the
|
||||
* AWS user account to create keys and launch instances, etc. These are to be provided as explained
|
||||
* in the documentation of {@link AwsLandscape#obtain()}.
|
||||
*
|
||||
* @author Axel Uhl (D043530)
|
||||
*
|
||||
*/
|
||||
public class TestProcedures {
|
||||
private static final Optional<Duration> optionalTimeout = Optional.of(Duration.ONE_MINUTE.times(5));
|
||||
private AwsLandscape<String, SailingAnalyticsMetrics, SailingAnalyticsMaster<String>, SailingAnalyticsReplica<String>> landscape;
|
||||
private AwsRegion region;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
landscape = AwsLandscape.obtain();
|
||||
region = new AwsRegion(Region.EU_WEST_2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConnectivity() throws Exception {
|
||||
final String serverName = "test"+new Random().nextInt();
|
||||
final String keyName = "MyKey-"+UUID.randomUUID();
|
||||
final StartSailingAnalyticsMaster.Builder<String> builder = StartSailingAnalyticsMaster.builder();
|
||||
final StartSailingAnalyticsMaster<String> startSailingAnalyticsMaster = builder
|
||||
.setServerName(serverName)
|
||||
.setLandscape(landscape)
|
||||
.setRegion(region)
|
||||
.setInstanceType(InstanceType.T3_SMALL)
|
||||
.setKeyName(keyName)
|
||||
.setCommaSeparatedEmailAddressesToNotifyOfStartup("axel.uhl@sap.com")
|
||||
.setTags(Optional.of(Tags.with("Hello", "World")))
|
||||
.setOptionalTimeout(optionalTimeout)
|
||||
.build();
|
||||
startSailingAnalyticsMaster.run();
|
||||
final SailingAnalyticsHost<String> host = startSailingAnalyticsMaster.getHost();
|
||||
try {
|
||||
assertNotNull(host);
|
||||
final Instance instance = landscape.getInstance(host.getInstanceId(), region);
|
||||
boolean foundName = false;
|
||||
boolean foundHello = false;
|
||||
for (final Tag tag : instance.tags()) {
|
||||
if (tag.key().equals("Name") && tag.value().equals("MyHost")) {
|
||||
foundName = true;
|
||||
}
|
||||
if (tag.key().equals("Hello") && tag.value().equals("World")) {
|
||||
foundHello = true;
|
||||
}
|
||||
}
|
||||
assertTrue(foundName);
|
||||
assertTrue(foundHello);
|
||||
// check env.sh access
|
||||
final ApplicationProcess<String, SailingAnalyticsMetrics, SailingAnalyticsMaster<String>, SailingAnalyticsReplica<String>> process = new ApplicationProcessImpl<>(8888, host, "/home/sailing/servers/server");
|
||||
final String envSh = process.getEnvSh(optionalTimeout);
|
||||
assertFalse(envSh.isEmpty());
|
||||
assertTrue(envSh.contains("SERVER_NAME="+serverName));
|
||||
assertEquals(14888, process.getTelnetPortToOSGiConsole(optionalTimeout));
|
||||
} finally {
|
||||
landscape.terminate(host);
|
||||
landscape.deleteKeyPair(region, keyName);
|
||||
}
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.sap.sailing.landscape.test;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.sap.sailing.landscape.SailingReleaseRepository;
|
||||
import com.sap.sse.common.Util;
|
||||
|
||||
public class TestReleaseRepository {
|
||||
|
||||
@Test
|
||||
public void testForAtLeastOneRelease() {
|
||||
assertFalse(Util.isEmpty(SailingReleaseRepository.INSTANCE));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testForAtLeastOneMasterRelease() {
|
||||
assertNotNull(SailingReleaseRepository.INSTANCE.getLatestMasterRelease());
|
||||
}
|
||||
}
|
||||
@@ -9,4 +9,8 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Require-Bundle: com.sap.sse.landscape,
|
||||
com.sap.sse.landscape.aws,
|
||||
com.sap.sse.common,
|
||||
com.jcraft.jsch;bundle-version="0.1.54"
|
||||
com.jcraft.jsch;bundle-version="0.1.54",
|
||||
com.amazon.aws.aws-java-api;bundle-version="2.14.24",
|
||||
com.sap.sse.shared.android,
|
||||
org.apache.httpcomponents.httpcore;bundle-version="4.4.0"
|
||||
Export-Package: com.sap.sailing.landscape
|
||||
|
||||
+4
-4
@@ -1,21 +1,21 @@
|
||||
package com.sap.sailing.landscape;
|
||||
|
||||
import com.sap.sse.landscape.application.ApplicationProcessMetrics;
|
||||
import com.sap.sse.landscape.RotatingFileBasedLog;
|
||||
import com.sap.sse.landscape.application.Scope;
|
||||
import com.sap.sse.landscape.aws.AwsInstance;
|
||||
import com.sap.sse.landscape.aws.ReverseProxy;
|
||||
|
||||
public interface SailingAnalyticsHost<ShardingKey, MetricsT extends ApplicationProcessMetrics> extends AwsInstance<ShardingKey, MetricsT> {
|
||||
public interface SailingAnalyticsHost<ShardingKey> extends AwsInstance<ShardingKey, SailingAnalyticsMetrics> {
|
||||
/**
|
||||
* Obtains an object through which an Apache reverse proxy running on this sailing analytics host can be configured.
|
||||
* It is mainly used to decide how to route based on a URL's hostname or other {@link Scope} identification, and to
|
||||
* expand base URLs to, e.g., the URL of a specific event in that scope or an overview page of an event series or
|
||||
* simply the home/landing page. It furthermore handles logging in a consistent way.
|
||||
*/
|
||||
ReverseProxy<ShardingKey, MetricsT, SailingAnalyticsMaster<ShardingKey, MetricsT>, SailingAnalyticsReplica<ShardingKey, MetricsT>> getReverseProxy();
|
||||
ReverseProxy<ShardingKey, SailingAnalyticsMetrics, SailingAnalyticsMaster<ShardingKey>, SailingAnalyticsReplica<ShardingKey>, RotatingFileBasedLog> getReverseProxy();
|
||||
|
||||
/**
|
||||
* Obtains the Sailing Analytics processes running on this host. Can be zero or more.
|
||||
*/
|
||||
Iterable<SailingAnalyticsProcess<ShardingKey, MetricsT>> getSailingAnalyticsProcesses();
|
||||
Iterable<SailingAnalyticsProcess<ShardingKey>> getSailingAnalyticsProcesses();
|
||||
}
|
||||
|
||||
+2
-3
@@ -1,9 +1,8 @@
|
||||
package com.sap.sailing.landscape;
|
||||
|
||||
import com.sap.sse.landscape.application.ApplicationMasterProcess;
|
||||
import com.sap.sse.landscape.application.ApplicationProcessMetrics;
|
||||
|
||||
public interface SailingAnalyticsMaster<ShardingKey, MetricsT extends ApplicationProcessMetrics> extends SailingAnalyticsProcess<ShardingKey, MetricsT>,
|
||||
ApplicationMasterProcess<ShardingKey, MetricsT, SailingAnalyticsMaster<ShardingKey, MetricsT>, SailingAnalyticsReplica<ShardingKey, MetricsT>> {
|
||||
public interface SailingAnalyticsMaster<ShardingKey> extends SailingAnalyticsProcess<ShardingKey>,
|
||||
ApplicationMasterProcess<ShardingKey, SailingAnalyticsMetrics, SailingAnalyticsMaster<ShardingKey>, SailingAnalyticsReplica<ShardingKey>> {
|
||||
|
||||
}
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package com.sap.sailing.landscape;
|
||||
|
||||
import com.sap.sse.landscape.application.ApplicationProcessMetrics;
|
||||
|
||||
public interface SailingAnalyticsMetrics extends ApplicationProcessMetrics {
|
||||
|
||||
}
|
||||
+10
-6
@@ -1,10 +1,14 @@
|
||||
package com.sap.sailing.landscape;
|
||||
|
||||
import com.sap.sse.landscape.application.ApplicationProcess;
|
||||
import com.sap.sse.landscape.application.ApplicationProcessMetrics;
|
||||
import java.io.IOException;
|
||||
import java.util.Optional;
|
||||
|
||||
public interface SailingAnalyticsProcess<ShardingKey, MetricsT extends ApplicationProcessMetrics> extends
|
||||
ApplicationProcess<ShardingKey, MetricsT, SailingAnalyticsMaster<ShardingKey, MetricsT>, SailingAnalyticsReplica<ShardingKey, MetricsT>> {
|
||||
int getTelnetPort();
|
||||
int getExpeditionUdpPort();
|
||||
import com.jcraft.jsch.JSchException;
|
||||
import com.jcraft.jsch.SftpException;
|
||||
import com.sap.sse.common.Duration;
|
||||
import com.sap.sse.landscape.application.ApplicationProcess;
|
||||
|
||||
public interface SailingAnalyticsProcess<ShardingKey> extends
|
||||
ApplicationProcess<ShardingKey, SailingAnalyticsMetrics, SailingAnalyticsMaster<ShardingKey>, SailingAnalyticsReplica<ShardingKey>> {
|
||||
int getExpeditionUdpPort(Optional<Duration> optionalTimeout) throws NumberFormatException, JSchException, IOException, InterruptedException, SftpException;
|
||||
}
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.sap.sailing.landscape;
|
||||
|
||||
public enum SailingAnalyticsProcessConfigurationVariable {
|
||||
/**
|
||||
* The user data variable that specifies the UDP port the application listens to
|
||||
*/
|
||||
EXPEDITION_PORT;
|
||||
}
|
||||
+2
-3
@@ -1,9 +1,8 @@
|
||||
package com.sap.sailing.landscape;
|
||||
|
||||
import com.sap.sse.landscape.application.ApplicationProcessMetrics;
|
||||
import com.sap.sse.landscape.application.ApplicationReplicaProcess;
|
||||
|
||||
public interface SailingAnalyticsReplica<ShardingKey, MetricsT extends ApplicationProcessMetrics> extends SailingAnalyticsProcess<ShardingKey, MetricsT>,
|
||||
ApplicationReplicaProcess<ShardingKey, MetricsT, SailingAnalyticsMaster<ShardingKey, MetricsT>, SailingAnalyticsReplica<ShardingKey, MetricsT>> {
|
||||
public interface SailingAnalyticsReplica<ShardingKey> extends SailingAnalyticsProcess<ShardingKey>,
|
||||
ApplicationReplicaProcess<ShardingKey, SailingAnalyticsMetrics, SailingAnalyticsMaster<ShardingKey>, SailingAnalyticsReplica<ShardingKey>> {
|
||||
|
||||
}
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.sap.sailing.landscape;
|
||||
|
||||
import com.sap.sse.landscape.ReleaseRepository;
|
||||
import com.sap.sse.landscape.impl.ReleaseRepositoryImpl;
|
||||
|
||||
public interface SailingReleaseRepository extends ReleaseRepository {
|
||||
ReleaseRepository INSTANCE = new ReleaseRepositoryImpl("http://releases.sapsailing.com", "build");
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.sap.sailing.landscape.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.sap.sse.landscape.ProcessConfigurationVariable;
|
||||
import com.sap.sse.landscape.ReplicationCredentials;
|
||||
|
||||
public class BearerTokenReplicationCredentials implements ReplicationCredentials {
|
||||
private final String bearerToken;
|
||||
|
||||
public BearerTokenReplicationCredentials(String bearerToken) {
|
||||
this.bearerToken = bearerToken;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<ProcessConfigurationVariable, String> getUserData() {
|
||||
final Map<ProcessConfigurationVariable, String> result = new HashMap<>();
|
||||
result.put(ProcessConfigurationVariable.REPLICATE_MASTER_BEARER_TOKEN, bearerToken);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.sap.sailing.landscape.impl;
|
||||
|
||||
import com.sap.sailing.landscape.SailingAnalyticsHost;
|
||||
import com.sap.sailing.landscape.SailingAnalyticsMaster;
|
||||
import com.sap.sailing.landscape.SailingAnalyticsMetrics;
|
||||
import com.sap.sailing.landscape.SailingAnalyticsProcess;
|
||||
import com.sap.sailing.landscape.SailingAnalyticsReplica;
|
||||
import com.sap.sse.landscape.RotatingFileBasedLog;
|
||||
import com.sap.sse.landscape.aws.AwsAvailabilityZone;
|
||||
import com.sap.sse.landscape.aws.AwsLandscape;
|
||||
import com.sap.sse.landscape.aws.ReverseProxy;
|
||||
import com.sap.sse.landscape.aws.impl.AwsInstanceImpl;
|
||||
|
||||
public class SailingAnalyticsHostImpl<ShardingKey> extends AwsInstanceImpl<ShardingKey, SailingAnalyticsMetrics> implements SailingAnalyticsHost<ShardingKey> {
|
||||
public SailingAnalyticsHostImpl(String instanceId, AwsAvailabilityZone availabilityZone,
|
||||
AwsLandscape<ShardingKey, SailingAnalyticsMetrics, ?, ?> landscape) {
|
||||
super(instanceId, availabilityZone, landscape);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReverseProxy<ShardingKey, SailingAnalyticsMetrics, SailingAnalyticsMaster<ShardingKey>, SailingAnalyticsReplica<ShardingKey>, RotatingFileBasedLog> getReverseProxy() {
|
||||
// TODO Implement SailingAnalyticsHost<ShardingKey>.getReverseProxy(...)
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<SailingAnalyticsProcess<ShardingKey>> getSailingAnalyticsProcesses() {
|
||||
// TODO Implement SailingAnalyticsHost<ShardingKey>.getSailingAnalyticsProcesses(...)
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
package com.sap.sailing.landscape.impl;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.Optional;
|
||||
|
||||
import com.jcraft.jsch.JSchException;
|
||||
import com.jcraft.jsch.SftpException;
|
||||
import com.sap.sailing.landscape.SailingAnalyticsMaster;
|
||||
import com.sap.sailing.landscape.SailingAnalyticsMetrics;
|
||||
import com.sap.sailing.landscape.SailingAnalyticsProcess;
|
||||
import com.sap.sailing.landscape.SailingAnalyticsProcessConfigurationVariable;
|
||||
import com.sap.sailing.landscape.SailingAnalyticsReplica;
|
||||
import com.sap.sse.common.Duration;
|
||||
import com.sap.sse.landscape.Host;
|
||||
import com.sap.sse.landscape.application.impl.ApplicationProcessImpl;
|
||||
|
||||
public class SailingAnalyticsProcessImpl<ShardingKey> extends ApplicationProcessImpl<ShardingKey, SailingAnalyticsMetrics,
|
||||
SailingAnalyticsMaster<ShardingKey>, SailingAnalyticsReplica<ShardingKey>> implements SailingAnalyticsProcess<ShardingKey> {
|
||||
private static final String HEALTH_CHECK_PATH = "/gwt/status";
|
||||
|
||||
public SailingAnalyticsProcessImpl(int port, Host host) {
|
||||
super(port, host, "/home/sailing/servers/server");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHealthCheckPath() {
|
||||
return HEALTH_CHECK_PATH;
|
||||
}
|
||||
|
||||
private URL getHealthCheckUrl(Optional<Duration> optionalTimeout) throws MalformedURLException {
|
||||
return new URL("http", getHost().getPublicAddress(optionalTimeout).getCanonicalHostName(), getPort(), getHealthCheckPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReady(Optional<Duration> optionalTimeout) throws IOException {
|
||||
final HttpURLConnection connection = (HttpURLConnection) getHealthCheckUrl(optionalTimeout).openConnection();
|
||||
return connection.getResponseCode() == 200;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getExpeditionUdpPort(Optional<Duration> optionalTimeout) throws NumberFormatException, JSchException, IOException, InterruptedException, SftpException {
|
||||
return Integer.parseInt(getEnvShValueFor(getEnvSh(optionalTimeout), SailingAnalyticsProcessConfigurationVariable.EXPEDITION_PORT.name(), optionalTimeout));
|
||||
}
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package com.sap.sailing.landscape.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.sap.sse.landscape.ProcessConfigurationVariable;
|
||||
import com.sap.sse.landscape.ReplicationCredentials;
|
||||
|
||||
public class UsernamePasswordReplicationCredentials implements ReplicationCredentials {
|
||||
private final String username;
|
||||
private final String password;
|
||||
|
||||
public UsernamePasswordReplicationCredentials(String username, String password) {
|
||||
this.username = username;
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<ProcessConfigurationVariable, String> getUserData() {
|
||||
final Map<ProcessConfigurationVariable, String> result = new HashMap<>();
|
||||
result.put(ProcessConfigurationVariable.REPLICATE_MASTER_USERNAME, username);
|
||||
result.put(ProcessConfigurationVariable.REPLICATE_MASTER_PASSWORD, password);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
package com.sap.sailing.landscape.procedures;
|
||||
|
||||
import com.sap.sailing.landscape.SailingAnalyticsHost;
|
||||
import com.sap.sailing.landscape.SailingAnalyticsMaster;
|
||||
import com.sap.sailing.landscape.SailingAnalyticsMetrics;
|
||||
import com.sap.sailing.landscape.SailingAnalyticsProcess;
|
||||
import com.sap.sailing.landscape.SailingAnalyticsReplica;
|
||||
import com.sap.sse.landscape.Landscape;
|
||||
import com.sap.sse.landscape.orchestration.Procedure;
|
||||
|
||||
/**
|
||||
* Deploys a single {@link SailingAnalyticsProcess} to a given {@link SailingAnalyticsHost} which ideally has been
|
||||
* launched using the {@link StartMultiServer} procedure, but may also work for hosts started in another way.<p>
|
||||
*
|
||||
* TODO This is similar to {@link StartSailingAnalyticsHost} but doesn't need to fire up a new host. The assembly
|
||||
* of user data that {@link StartSailingAnalyticsHost} implements shall be factored and used here as well to append
|
||||
* to a barebones {@code env.sh} as obtained from a trivial installation. This trivial installation would start by
|
||||
* creating the {@link #serverName} folder under {@code /home/sailing/servers}, then copy the {@code refreshInstance.sh}
|
||||
* script there, run {@code ./refreshInstance.sh install-release}, then {@code ./refreshInstance.sh install-env environment-name},
|
||||
* then append specific variable values to the end of the {@code env.sh} file. In both cases, a set of variable assignments
|
||||
* needs to be generated which becomes the "user data" for {@link StartSailingAnalyticsHost} and becomes an appendix to
|
||||
* {@code env.sh} in this case.
|
||||
*
|
||||
* @author Axel Uhl (D043530)
|
||||
*
|
||||
* @param <ShardingKey>
|
||||
* @param <HostT>
|
||||
*/
|
||||
public class DeployProcessOnMultiServer<ShardingKey, HostT extends SailingAnalyticsHost<ShardingKey>> implements
|
||||
Procedure<ShardingKey, SailingAnalyticsMetrics, SailingAnalyticsMaster<ShardingKey>, SailingAnalyticsReplica<ShardingKey>> {
|
||||
private final Landscape<ShardingKey, SailingAnalyticsMetrics, SailingAnalyticsMaster<ShardingKey>, SailingAnalyticsReplica<ShardingKey>> landscape;
|
||||
private final SailingAnalyticsHost<ShardingKey> hostToDeployTo;
|
||||
private final String serverName;
|
||||
|
||||
/**
|
||||
* The process launched by this procedure. {@link #hostToDeployTo} is expected to be identical to
|
||||
* {@link SailingAnalyticsProcess#getHost() process.getHost()}.
|
||||
*/
|
||||
private SailingAnalyticsProcess<ShardingKey> process;
|
||||
|
||||
public DeployProcessOnMultiServer(Landscape<ShardingKey, SailingAnalyticsMetrics, SailingAnalyticsMaster<ShardingKey>, SailingAnalyticsReplica<ShardingKey>> landscape,
|
||||
SailingAnalyticsHost<ShardingKey> hostToDeployTo, String serverName) {
|
||||
super();
|
||||
this.landscape = landscape;
|
||||
this.hostToDeployTo = hostToDeployTo;
|
||||
this.serverName = serverName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
// TODO Implement Runnable.run(...)
|
||||
|
||||
}
|
||||
|
||||
public SailingAnalyticsProcess<ShardingKey> getProcess() {
|
||||
return process;
|
||||
}
|
||||
|
||||
public void setProcess(SailingAnalyticsProcess<ShardingKey> process) {
|
||||
this.process = process;
|
||||
}
|
||||
|
||||
public SailingAnalyticsHost<ShardingKey> getHostToDeployTo() {
|
||||
return hostToDeployTo;
|
||||
}
|
||||
|
||||
public String getServerName() {
|
||||
return serverName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Landscape<ShardingKey, SailingAnalyticsMetrics, SailingAnalyticsMaster<ShardingKey>, SailingAnalyticsReplica<ShardingKey>> getLandscape() {
|
||||
return landscape;
|
||||
}
|
||||
}
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
package com.sap.sailing.landscape.procedures;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.Optional;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.sap.sse.common.Duration;
|
||||
import com.sap.sse.landscape.application.ApplicationMasterProcess;
|
||||
import com.sap.sse.landscape.application.ApplicationProcessMetrics;
|
||||
import com.sap.sse.landscape.application.ApplicationReplicaProcess;
|
||||
import com.sap.sse.landscape.aws.AwsInstance;
|
||||
import com.sap.sse.landscape.ssh.SshCommandChannel;
|
||||
|
||||
import software.amazon.awssdk.services.ec2.model.InstanceType;
|
||||
|
||||
/**
|
||||
* Starts an empty multi-server. The image will cause a {@code /home/sailing/servers/server} directory to exist, but
|
||||
* after successfully launching, that directory will be removed. A {@link DeployProcessOnMultiServer} procedure needs to
|
||||
* be run with the {@link #getHost()} of this procedure telling the host on which to deploy the process.<p>
|
||||
*
|
||||
* The implementation specializes the {@link UpgradeAmi} procedure in {@link Builder#setNoShutdown(boolean) no-shutdown} mode.
|
||||
* After running that part, the {@code httpd} service is launched.<p>
|
||||
*
|
||||
* You want to at least specify an {@link Builder#setInstanceName(String) instance name} and {@link Builder#setInstanceType(InstanceType)}.
|
||||
*
|
||||
* @author Axel Uhl (D043530)
|
||||
*
|
||||
* @param <ShardingKey>
|
||||
* @param <HostT>
|
||||
*/
|
||||
public class StartMultiServer<ShardingKey, MetricsT extends ApplicationProcessMetrics,
|
||||
MasterProcessT extends ApplicationMasterProcess<ShardingKey, MetricsT, MasterProcessT, ReplicaProcessT>,
|
||||
ReplicaProcessT extends ApplicationReplicaProcess<ShardingKey, MetricsT, MasterProcessT, ReplicaProcessT>,
|
||||
HostT extends AwsInstance<ShardingKey, MetricsT>>
|
||||
extends UpgradeAmi<ShardingKey, MetricsT, MasterProcessT, ReplicaProcessT, HostT> {
|
||||
private static final Logger logger = Logger.getLogger(StartMultiServer.class.getName());
|
||||
private Optional<Duration> optionalTimeout;
|
||||
|
||||
/**
|
||||
* Under all circumstances, this builder will return {@code true} for {@link #isNoShutdown()}, making sure
|
||||
* that after the upgrade progress the server does not try to re-boot.
|
||||
*
|
||||
* @author Axel Uhl (D043530)
|
||||
*/
|
||||
public static interface Builder<ShardingKey, MetricsT extends ApplicationProcessMetrics,
|
||||
MasterProcessT extends ApplicationMasterProcess<ShardingKey, MetricsT, MasterProcessT, ReplicaProcessT>,
|
||||
ReplicaProcessT extends ApplicationReplicaProcess<ShardingKey, MetricsT, MasterProcessT, ReplicaProcessT>,
|
||||
HostT extends AwsInstance<ShardingKey, MetricsT>>
|
||||
extends UpgradeAmi.Builder<ShardingKey, MetricsT, MasterProcessT, ReplicaProcessT, HostT> {
|
||||
@Override
|
||||
default boolean isNoShutdown() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
protected static class BuilderImpl<ShardingKey, MetricsT extends ApplicationProcessMetrics,
|
||||
MasterProcessT extends ApplicationMasterProcess<ShardingKey, MetricsT, MasterProcessT, ReplicaProcessT>,
|
||||
ReplicaProcessT extends ApplicationReplicaProcess<ShardingKey, MetricsT, MasterProcessT, ReplicaProcessT>,
|
||||
HostT extends AwsInstance<ShardingKey, MetricsT>>
|
||||
extends UpgradeAmi.BuilderImpl<ShardingKey, MetricsT, MasterProcessT, ReplicaProcessT, HostT>
|
||||
implements Builder<ShardingKey, MetricsT, MasterProcessT, ReplicaProcessT, HostT> {
|
||||
@Override
|
||||
public StartMultiServer<ShardingKey, MetricsT, MasterProcessT, ReplicaProcessT, HostT> build() {
|
||||
return new StartMultiServer<>(this);
|
||||
}
|
||||
}
|
||||
|
||||
public static <ShardingKey, MetricsT extends ApplicationProcessMetrics,
|
||||
MasterProcessT extends ApplicationMasterProcess<ShardingKey, MetricsT, MasterProcessT, ReplicaProcessT>,
|
||||
ReplicaProcessT extends ApplicationReplicaProcess<ShardingKey, MetricsT, MasterProcessT, ReplicaProcessT>,
|
||||
HostT extends AwsInstance<ShardingKey, MetricsT>> Builder<ShardingKey, MetricsT, MasterProcessT, ReplicaProcessT, HostT> builder() {
|
||||
return new BuilderImpl<>();
|
||||
}
|
||||
|
||||
protected StartMultiServer(Builder<ShardingKey, MetricsT, MasterProcessT, ReplicaProcessT, HostT> builder) {
|
||||
super(builder);
|
||||
this.optionalTimeout = builder.getOptionalTimeout();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
super.run();
|
||||
final SshCommandChannel sshCommandChannel = getHost().createRootSshChannel(optionalTimeout);
|
||||
final ByteArrayOutputStream stderr = new ByteArrayOutputStream();
|
||||
sshCommandChannel.sendCommandLineSynchronously("service httpd start", stderr);
|
||||
final String instanceId = getHost().getInstanceId();
|
||||
logger.info("stdout for starting httpd service on instance "+instanceId+": "+sshCommandChannel.getStreamContentsAsString());
|
||||
logger.info("stderr for starting httpd service on instance \"+instanceId+\": "+stderr.toString());
|
||||
logger.info("exit status for starting httpd service on instance \"+instanceId+\": "+sshCommandChannel.getExitStatus());
|
||||
}
|
||||
}
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
package com.sap.sailing.landscape.procedures;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import com.sap.sailing.landscape.SailingAnalyticsHost;
|
||||
import com.sap.sailing.landscape.SailingAnalyticsMaster;
|
||||
import com.sap.sailing.landscape.SailingAnalyticsMetrics;
|
||||
import com.sap.sailing.landscape.SailingAnalyticsReplica;
|
||||
import com.sap.sailing.landscape.SailingReleaseRepository;
|
||||
import com.sap.sse.landscape.Release;
|
||||
import com.sap.sse.landscape.aws.impl.AmazonMachineImage;
|
||||
import com.sap.sse.landscape.aws.orchestration.StartAwsHost;
|
||||
import com.sap.sse.landscape.orchestration.Procedure;
|
||||
|
||||
/**
|
||||
* TODO handle the naming problem: base name drives instance "Name" tag generation ("SL ... (Master)"), exchange name,
|
||||
* database name and SERVER_NAME. When moving up the inheritance hierarchy, name is interpreted in some places as the instance name
|
||||
* which obviously doesn't equal the "Name" tag value. So, we have to clearly distinguish these.
|
||||
*
|
||||
* @author Axel Uhl (D043530)
|
||||
*
|
||||
* @param <ShardingKey>
|
||||
*/
|
||||
public abstract class StartSailingAnalyticsHost<ShardingKey,
|
||||
HostT extends SailingAnalyticsHost<ShardingKey>>
|
||||
extends StartAwsHost<ShardingKey, SailingAnalyticsMetrics, SailingAnalyticsMaster<ShardingKey>, SailingAnalyticsReplica<ShardingKey>, HostT>
|
||||
implements Procedure<ShardingKey, SailingAnalyticsMetrics, SailingAnalyticsMaster<ShardingKey>, SailingAnalyticsReplica<ShardingKey>> {
|
||||
private final static String IMAGE_TYPE_TAG_VALUE_SAILING = "sailing-analytics-server";
|
||||
private final static String INSTANCE_NAME_DEFAULT_PREFIX = "SL ";
|
||||
|
||||
/**
|
||||
* The following defaults, in addition to the defaults implemented by the more general {@link StartAwsHost.Builder},
|
||||
* are:
|
||||
* <ul>
|
||||
* <li>If no {@link #setInstanceName(String) instance name} is provided, the instance name is constructed from the {@link #getServerName() server name}
|
||||
* by pre-pending the prefix "SL ".</li>
|
||||
* <li>Uses the latest machine image of the type described by
|
||||
* {@link StartSailingAnalyticsHost#IMAGE_TYPE_TAG_VALUE_SAILING} if no explicit {@link #setMachineImage(AmazonMachineImage) machine image is set}
|
||||
* and no {@link #setImageType(String) image type is set} of which the latest version would be used otherwise.</li>
|
||||
* <li>If no {@link Release} is explicitly {@link #setRelease set}, or that {@link Optional} is empty,
|
||||
* {@link SailingReleaseRepository#INSTANCE}{@link SailingReleaseRepository#getLatestMasterRelease()
|
||||
* getLatestMasterRelease()} will be used instead.</li>
|
||||
* </ul>
|
||||
*
|
||||
* @author Axel Uhl (D043530)
|
||||
*/
|
||||
public static interface Builder<T extends StartSailingAnalyticsHost<ShardingKey, HostT>, ShardingKey, HostT extends SailingAnalyticsHost<ShardingKey>>
|
||||
extends StartAwsHost.Builder<T, ShardingKey, SailingAnalyticsMetrics, SailingAnalyticsMaster<ShardingKey>, SailingAnalyticsReplica<ShardingKey>, HostT> {
|
||||
}
|
||||
|
||||
protected abstract static class BuilderImpl<T extends StartSailingAnalyticsHost<ShardingKey, HostT>, ShardingKey, HostT extends SailingAnalyticsHost<ShardingKey>>
|
||||
extends StartAwsHost.BuilderImpl<T, ShardingKey, SailingAnalyticsMetrics, SailingAnalyticsMaster<ShardingKey>, SailingAnalyticsReplica<ShardingKey>, HostT>
|
||||
implements Builder<T, ShardingKey, HostT> {
|
||||
@Override
|
||||
public String getImageType() {
|
||||
return super.getImageType() == null ? StartSailingAnalyticsHost.IMAGE_TYPE_TAG_VALUE_SAILING : super.getImageType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<Release> getRelease() {
|
||||
return Optional.of(super.getRelease().orElse(SailingReleaseRepository.INSTANCE.getLatestMasterRelease()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInstanceName() {
|
||||
return super.getInstanceName() == null ? INSTANCE_NAME_DEFAULT_PREFIX+getServerName() : super.getInstanceName();
|
||||
}
|
||||
}
|
||||
|
||||
protected StartSailingAnalyticsHost(Builder<? extends StartSailingAnalyticsHost<ShardingKey,HostT>, ShardingKey, HostT> builder) {
|
||||
super(builder);
|
||||
}
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package com.sap.sailing.landscape.procedures;
|
||||
|
||||
import com.sap.sailing.landscape.SailingAnalyticsHost;
|
||||
import com.sap.sse.landscape.ProcessConfigurationVariable;
|
||||
|
||||
/**
|
||||
* This procedure does two things: it {@link StartSailingAnalyticsHost starts} a {@link SailingAnalyticsHost}, and
|
||||
* (currently implicitly, based on the way the /etc/init.d/sailing script works) also starts a "master" process
|
||||
* that is expected to have the default working directory {@code /home/sailing/servers/server}.<p>
|
||||
*
|
||||
* TODO What we should probably be doing instead is harmonize the way the set-up / launching of a regular default master
|
||||
* works with how a {@link StartMultiServer multi-server is started}. We could start both empty, with only the default
|
||||
* reverse proxy mappings for {@code internal-server-status} and the plain access through the {@code ec2-...} hostname.
|
||||
* From there on, all process launching and stopping would work through the {@link DeployProcessOnMultiServer} procedure
|
||||
* (which then should be renamed to {@code DeployApplicationProcessOnServer}). That procedure then would have the
|
||||
*
|
||||
* @author Axel Uhl (D043530)
|
||||
*/
|
||||
public class StartSailingAnalyticsMaster<ShardingKey>
|
||||
extends StartSailingAnalyticsHost<ShardingKey, SailingAnalyticsHost<ShardingKey>> {
|
||||
public static interface Builder<ShardingKey>
|
||||
extends StartSailingAnalyticsHost.Builder<StartSailingAnalyticsMaster<ShardingKey>, ShardingKey, SailingAnalyticsHost<ShardingKey>> {
|
||||
}
|
||||
|
||||
// TODO model an AwsLandscape subclass describing the specifics of the Sailing landscape, with a central security service that a master replicates by default
|
||||
|
||||
protected static class BuilderImpl<ShardingKey>
|
||||
extends StartSailingAnalyticsHost.BuilderImpl<StartSailingAnalyticsMaster<ShardingKey>, ShardingKey, SailingAnalyticsHost<ShardingKey>>
|
||||
implements Builder<ShardingKey> {
|
||||
@Override
|
||||
public StartSailingAnalyticsMaster<ShardingKey> build() {
|
||||
return new StartSailingAnalyticsMaster<ShardingKey>(this);
|
||||
}
|
||||
}
|
||||
|
||||
public static <ShardingKey> Builder<ShardingKey> builder() {
|
||||
return new BuilderImpl<>();
|
||||
}
|
||||
|
||||
protected StartSailingAnalyticsMaster(Builder<ShardingKey> builder) {
|
||||
super(builder);
|
||||
addUserData(ProcessConfigurationVariable.USE_ENVIRONMENT, "live-master-server"); // TODO maybe this should be handled by this procedure adding the correct defaults, e.g., for replicating security/sharedsailing?
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.sap.sailing.landscape.procedures;
|
||||
|
||||
import com.sap.sailing.landscape.SailingAnalyticsHost;
|
||||
import com.sap.sse.landscape.ProcessConfigurationVariable;
|
||||
|
||||
public class StartSailingAnalyticsReplica<ShardingKey>
|
||||
extends StartSailingAnalyticsHost<ShardingKey, SailingAnalyticsHost<ShardingKey>> {
|
||||
public static interface Builder<ShardingKey>
|
||||
extends StartSailingAnalyticsHost.Builder<StartSailingAnalyticsReplica<ShardingKey>, ShardingKey, SailingAnalyticsHost<ShardingKey>> {
|
||||
}
|
||||
|
||||
protected static class BuilderImpl<ShardingKey>
|
||||
extends StartSailingAnalyticsHost.BuilderImpl<StartSailingAnalyticsReplica<ShardingKey>, ShardingKey, SailingAnalyticsHost<ShardingKey>>
|
||||
implements Builder<ShardingKey> {
|
||||
@Override
|
||||
public StartSailingAnalyticsReplica<ShardingKey> build() {
|
||||
return new StartSailingAnalyticsReplica<ShardingKey>(this);
|
||||
}
|
||||
}
|
||||
|
||||
public static <ShardingKey> Builder<ShardingKey> builder() {
|
||||
return new BuilderImpl<>();
|
||||
}
|
||||
|
||||
protected StartSailingAnalyticsReplica(Builder<ShardingKey> builder) {
|
||||
super(builder);
|
||||
addUserData(ProcessConfigurationVariable.USE_ENVIRONMENT, "live-replica-server"); // TODO maybe this should be handled by this procedure adding the correct defaults, e.g., for replicating security/sharedsailing?
|
||||
}
|
||||
}
|
||||
+114
@@ -0,0 +1,114 @@
|
||||
package com.sap.sailing.landscape.procedures;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import com.sap.sse.landscape.MachineImage;
|
||||
import com.sap.sse.landscape.application.ApplicationMasterProcess;
|
||||
import com.sap.sse.landscape.application.ApplicationProcessMetrics;
|
||||
import com.sap.sse.landscape.application.ApplicationReplicaProcess;
|
||||
import com.sap.sse.landscape.aws.AwsInstance;
|
||||
import com.sap.sse.landscape.aws.orchestration.StartAwsHost;
|
||||
import com.sap.sse.landscape.orchestration.Procedure;
|
||||
|
||||
/**
|
||||
* Upgrades an existing Amazon Machine Image that is expected to be prepared for such an upgrade, by
|
||||
* invoking it with very specific user data that trigger the automatic upgrade. The resulting AMI can
|
||||
* be obtained after this procedure has completed by calling {@link #getUpgradedAmi()}.
|
||||
*
|
||||
* @author Axel Uhl (D043530)
|
||||
*
|
||||
* @param <ShardingKey>
|
||||
* @param <HostT>
|
||||
*/
|
||||
public class UpgradeAmi<ShardingKey, MetricsT extends ApplicationProcessMetrics,
|
||||
MasterProcessT extends ApplicationMasterProcess<ShardingKey, MetricsT, MasterProcessT, ReplicaProcessT>,
|
||||
ReplicaProcessT extends ApplicationReplicaProcess<ShardingKey, MetricsT, MasterProcessT, ReplicaProcessT>,
|
||||
HostT extends AwsInstance<ShardingKey, MetricsT>>
|
||||
extends StartAwsHost<ShardingKey, MetricsT, MasterProcessT, ReplicaProcessT, HostT>
|
||||
implements Procedure<ShardingKey, MetricsT, MasterProcessT, ReplicaProcessT> {
|
||||
private static final String IMAGE_UPGRADE_USER_DATA = "image-upgrade";
|
||||
private static final String NO_SHUTDOWN_USER_DATA = "no-shutdown";
|
||||
|
||||
private MachineImage upgradedAmi;
|
||||
|
||||
/**
|
||||
* Additional default rules in addition to what the {@link StartAwsHost.Builder parent builder} defines:
|
||||
*
|
||||
* <ul>
|
||||
* <li>If no {@link #getInstanceName() instance name} is set, the default instance name will be constructed as
|
||||
* {@code IMAGE_UPGRADE+" for "+machineImage.getId()}</li>
|
||||
* <li>The user data are set to the string defined by {@link UpgradeAmi#IMAGE_UPGRADE_USER_DATA}, forcing the image to
|
||||
* boot without trying to launch a process instance.</li>
|
||||
* </ul>
|
||||
* @author Axel Uhl (D043530)
|
||||
*/
|
||||
public static interface Builder<ShardingKey, MetricsT extends ApplicationProcessMetrics,
|
||||
MasterProcessT extends ApplicationMasterProcess<ShardingKey, MetricsT, MasterProcessT, ReplicaProcessT>,
|
||||
ReplicaProcessT extends ApplicationReplicaProcess<ShardingKey, MetricsT, MasterProcessT, ReplicaProcessT>,
|
||||
HostT extends AwsInstance<ShardingKey, MetricsT>>
|
||||
extends StartAwsHost.Builder<UpgradeAmi<ShardingKey, MetricsT, MasterProcessT, ReplicaProcessT, HostT>, ShardingKey, MetricsT, MasterProcessT, ReplicaProcessT, HostT> {
|
||||
boolean isNoShutdown();
|
||||
|
||||
Builder<ShardingKey, MetricsT, MasterProcessT, ReplicaProcessT, HostT> setNoShutdown(boolean noShutdown);
|
||||
}
|
||||
|
||||
protected static class BuilderImpl<ShardingKey, MetricsT extends ApplicationProcessMetrics,
|
||||
MasterProcessT extends ApplicationMasterProcess<ShardingKey, MetricsT, MasterProcessT, ReplicaProcessT>,
|
||||
ReplicaProcessT extends ApplicationReplicaProcess<ShardingKey, MetricsT, MasterProcessT, ReplicaProcessT>,
|
||||
HostT extends AwsInstance<ShardingKey, MetricsT>>
|
||||
extends StartAwsHost.BuilderImpl<UpgradeAmi<ShardingKey, MetricsT, MasterProcessT, ReplicaProcessT, HostT>, ShardingKey, MetricsT, MasterProcessT, ReplicaProcessT, HostT>
|
||||
implements Builder<ShardingKey, MetricsT, MasterProcessT, ReplicaProcessT, HostT> {
|
||||
private boolean noShutdown;
|
||||
|
||||
@Override
|
||||
public UpgradeAmi<ShardingKey, MetricsT, MasterProcessT, ReplicaProcessT, HostT> build() {
|
||||
return new UpgradeAmi<>(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNoShutdown() {
|
||||
return noShutdown;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Builder<ShardingKey, MetricsT, MasterProcessT, ReplicaProcessT, HostT> setNoShutdown(boolean noShutdown) {
|
||||
this.noShutdown = noShutdown;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInstanceName() {
|
||||
return super.getInstanceName() == null ? IMAGE_UPGRADE_USER_DATA+" for "+getMachineImage().getId() : super.getInstanceName();
|
||||
}
|
||||
}
|
||||
|
||||
public static <ShardingKey, MetricsT extends ApplicationProcessMetrics,
|
||||
MasterProcessT extends ApplicationMasterProcess<ShardingKey, MetricsT, MasterProcessT, ReplicaProcessT>,
|
||||
ReplicaProcessT extends ApplicationReplicaProcess<ShardingKey, MetricsT, MasterProcessT, ReplicaProcessT>,
|
||||
HostT extends AwsInstance<ShardingKey, MetricsT>> Builder<ShardingKey, MetricsT, MasterProcessT,ReplicaProcessT, HostT> builder() {
|
||||
return new BuilderImpl<>();
|
||||
}
|
||||
|
||||
public UpgradeAmi(Builder<ShardingKey, MetricsT, MasterProcessT, ReplicaProcessT, HostT> builder) {
|
||||
super(builder);
|
||||
addUserData(Collections.singleton(IMAGE_UPGRADE_USER_DATA));
|
||||
if (builder.isNoShutdown()) {
|
||||
addUserData(Collections.singleton(NO_SHUTDOWN_USER_DATA));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
super.run(); // launches the machine in upgrade mode and shuts it down again, preparing for AMI creation
|
||||
// TODO now comes the waiting for the shutdown and initiating the creation of an AMI for the instance
|
||||
// TODO then comes the tagging of the volume snapshots created
|
||||
// TODO then tag the resulting AMI according to the original image's tags, except for the name where automatic version number increment should be implemented
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the resulting AMI that has the upgraded version of everything
|
||||
*/
|
||||
public MachineImage getUpgradedAmi() {
|
||||
return upgradedAmi;
|
||||
}
|
||||
}
|
||||
+1
@@ -25,5 +25,6 @@ public class MongoClientURITest {
|
||||
assertEquals(12345, config.getPort());
|
||||
assertEquals("mydb", config.getDatabaseName());
|
||||
assertSame(ReadPreference.primary(), config.getMongoClientURI().getOptions().getReadPreference());
|
||||
assertEquals("rs0", config.getMongoClientURI().getOptions().getRequiredReplicaSetName());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,9 +41,9 @@ Import-Package:
|
||||
javax.ws.rs.core;version="1.1.1",
|
||||
javax.xml.bind,
|
||||
org.apache.http,
|
||||
org.apache.http.client;version="[4.2.6,4.3.0)",
|
||||
org.apache.http.client.methods;version="[4.2.6,4.3.0)",
|
||||
org.apache.http.impl.client;version="[4.2.6,4.3.0)",
|
||||
org.apache.http.client;version="4.5.5",
|
||||
org.apache.http.client.methods;version="4.5.5",
|
||||
org.apache.http.impl.client;version="4.5.5",
|
||||
org.json.simple,
|
||||
org.json.simple.parser
|
||||
Web-ContextPath: /polars
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@ import java.util.logging.Logger;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.impl.client.SystemDefaultHttpClient;
|
||||
import org.apache.http.impl.client.HttpClientBuilder;
|
||||
import org.json.simple.parser.ParseException;
|
||||
|
||||
import com.sap.sailing.polars.ReplicablePolarService;
|
||||
@@ -69,7 +69,7 @@ public class PolarDataClient {
|
||||
}
|
||||
|
||||
protected InputStream getContentFromResponse() throws IOException, ParseException {
|
||||
HttpClient client = new SystemDefaultHttpClient();
|
||||
HttpClient client = HttpClientBuilder.create().build();
|
||||
HttpGet getProcessor = new HttpGet(getAPIString());
|
||||
HttpResponse processorResponse = client.execute(getProcessor);
|
||||
return processorResponse.getEntity().getContent();
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
/bin/
|
||||
/debug.log
|
||||
|
||||
+3
-7
@@ -718,16 +718,12 @@ public class LeaderboardsResource extends AbstractLeaderboardsResource {
|
||||
@QueryParam(RaceLogServletConstants.PARAMS_RACE_FLEET_NAME) String fleetName,
|
||||
@QueryParam(RaceLogServletConstants.PARAMS_TRACK_WIND) Boolean trackWind,
|
||||
@QueryParam(RaceLogServletConstants.PARAMS_CORRECT_WIND_DIRECTION_BY_MAGNETIC_DECLINATION) Boolean correctWindDirectionByMagneticDeclination,
|
||||
@QueryParam(RaceLogServletConstants.PARAMS_TRACKED_RACE_NAME) String optionalTrackedRaceName,
|
||||
@QueryParam("secret") String secret)
|
||||
@QueryParam(RaceLogServletConstants.PARAMS_TRACKED_RACE_NAME) String optionalTrackedRaceName)
|
||||
throws NotDenotedForRaceLogTrackingException, Exception {
|
||||
final LeaderboardAndRaceColumnAndFleetAndResponse leaderboardAndRaceColumnAndFleetAndResponse = getLeaderboardAndRaceColumnAndFleet(
|
||||
leaderboardName, raceColumnName, fleetName);
|
||||
boolean skip = getService().skipChecksDueToCorrectSecret(leaderboardName, secret);
|
||||
if (!skip) {
|
||||
SecurityUtils.getSubject().checkPermission(SecuredDomainType.LEADERBOARD.getStringPermissionForObject(
|
||||
DefaultActions.UPDATE, leaderboardAndRaceColumnAndFleetAndResponse.getLeaderboard()));
|
||||
}
|
||||
SecurityUtils.getSubject().checkPermission(SecuredDomainType.LEADERBOARD.getStringPermissionForObject(
|
||||
DefaultActions.UPDATE, leaderboardAndRaceColumnAndFleetAndResponse.getLeaderboard()));
|
||||
final Callable<Response> innerAction = () -> {
|
||||
final Response result;
|
||||
if (leaderboardAndRaceColumnAndFleetAndResponse.getFleet() != null) {
|
||||
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
package com.sap.sailing.server.test;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertSame;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.sap.sailing.domain.base.Regatta;
|
||||
import com.sap.sailing.domain.common.CompetitorRegistrationType;
|
||||
import com.sap.sailing.domain.common.RankingMetrics;
|
||||
import com.sap.sailing.domain.common.dto.RegattaCreationParametersDTO;
|
||||
import com.sap.sailing.domain.common.dto.SeriesCreationParametersDTO;
|
||||
import com.sap.sailing.domain.leaderboard.RegattaLeaderboard;
|
||||
import com.sap.sailing.domain.leaderboard.impl.DelegatingRegattaLeaderboardWithCompetitorElimination;
|
||||
import com.sap.sailing.domain.leaderboard.impl.LowPoint;
|
||||
import com.sap.sailing.domain.persistence.PersistenceFactory;
|
||||
import com.sap.sailing.server.impl.RacingEventServiceImpl;
|
||||
import com.sap.sailing.server.interfaces.RacingEventService;
|
||||
import com.sap.sailing.server.operationaltransformation.AddSpecificRegatta;
|
||||
import com.sap.sailing.server.operationaltransformation.CreateRegattaLeaderboard;
|
||||
import com.sap.sailing.server.operationaltransformation.CreateRegattaLeaderboardWithEliminations;
|
||||
import com.sap.sailing.server.operationaltransformation.RemoveLeaderboard;
|
||||
import com.sap.sailing.server.operationaltransformation.RemoveRegatta;
|
||||
import com.sap.sse.security.SecurityService;
|
||||
import com.sap.sse.security.testsupport.SecurityServiceMockFactory;
|
||||
|
||||
public class LeaderboardWithEliminationTransitiveRemovalTest {
|
||||
private RacingEventService server;
|
||||
private Regatta regatta;
|
||||
private RegattaLeaderboard regattaLeaderboard;
|
||||
private DelegatingRegattaLeaderboardWithCompetitorElimination regattaLeaderboardWithEliminations;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
PersistenceFactory.INSTANCE.getDefaultMongoObjectFactory().getDatabase().drop();
|
||||
final SecurityService securityService = SecurityServiceMockFactory.mockSecurityService();
|
||||
server = new RacingEventServiceImpl() {
|
||||
@Override
|
||||
public SecurityService getSecurityService() {
|
||||
return securityService;
|
||||
}
|
||||
};
|
||||
final LinkedHashMap<String, SeriesCreationParametersDTO> seriesStructure = new LinkedHashMap<>();
|
||||
final RegattaCreationParametersDTO regattaStructure = new RegattaCreationParametersDTO(seriesStructure);
|
||||
regatta = server.apply(new AddSpecificRegatta("Test", "Laser Int.", /* canBoatsOfCompetitorsChangePerRace */ false,
|
||||
/* competitorRegistrationType */ CompetitorRegistrationType.CLOSED, /* registrationLinkSecret */ null,
|
||||
/* startDate */ null, /* endDate */ null, /* id */ UUID.randomUUID(),
|
||||
regattaStructure, /* persistent */ true, new LowPoint(),
|
||||
/* courseAreaIds */ Collections.singleton(server.getBaseDomainFactory().getOrCreateCourseArea(UUID.randomUUID(), "Default").getId()),
|
||||
/* buoyZoneRadiusInHullLengths */ null, /* useStartTimeInference */ false,
|
||||
/* controlTrackingFromStartAndFinishTimes */ true, /* autoRestartTrackingUponCompetitorSetChange */ false,
|
||||
RankingMetrics.ONE_DESIGN));
|
||||
regattaLeaderboard = server.apply(new CreateRegattaLeaderboard(regatta.getRegattaIdentifier(),
|
||||
/* leaderboardDisplayName */ null, /* discardThresholds */ new int[0]));
|
||||
regattaLeaderboardWithEliminations =
|
||||
server.apply(new CreateRegattaLeaderboardWithEliminations("With Eliminations", /* display name */ null,
|
||||
regattaLeaderboard.getName()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAllThere() {
|
||||
assertNotNull(regatta);
|
||||
assertNotNull(regattaLeaderboard);
|
||||
assertNotNull(regattaLeaderboardWithEliminations);
|
||||
assertSame(regatta, regattaLeaderboard.getRegatta());
|
||||
assertSame(regatta, regattaLeaderboardWithEliminations.getRegatta());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRemovingRegattaRemovesAllLeaderboards() {
|
||||
server.apply(new RemoveRegatta(regatta.getRegattaIdentifier()));
|
||||
assertNull(server.getLeaderboardByName(regattaLeaderboard.getName()));
|
||||
assertNull(server.getLeaderboardByName(regattaLeaderboardWithEliminations.getName()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRemovingRegattaLeaderboardRemovesLeaderboardWithEliminations() {
|
||||
server.apply(new RemoveLeaderboard(regattaLeaderboard.getName()));
|
||||
assertNull(server.getLeaderboardByName(regattaLeaderboard.getName()));
|
||||
assertNull(server.getLeaderboardByName(regattaLeaderboardWithEliminations.getName()));
|
||||
}
|
||||
}
|
||||
@@ -10,8 +10,8 @@ Require-Bundle: com.sap.sailing.domain.common;bundle-version="1.0.0",
|
||||
com.sap.sailing.domain.tractracadapter,
|
||||
com.sap.sse,
|
||||
com.sap.sse.common,
|
||||
com.sap.sse.security.common,
|
||||
org.apache.httpcomponents.httpclient;bundle-version="[4.2.6,4.3.0)",
|
||||
com.sap.sse.security.common,
|
||||
org.apache.httpcomponents.httpclient;bundle-version="4.5.5",
|
||||
org.json.simple;bundle-version="1.1.0"
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Import-Package: org.osgi.framework;version="1.6.0"
|
||||
|
||||
@@ -82,13 +82,6 @@
|
||||
version="1.1.2"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.apache.servicemix.bundles.aws-java-sdk"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="1.10.73.1"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.sun.jersey.contribs.jersey-multipart"
|
||||
download-size="0"
|
||||
|
||||
BIN
Binary file not shown.
-7
@@ -1,7 +0,0 @@
|
||||
OSGI-ified version of AWS Java SDK from http://mvnrepository.com/artifact/org.apache.servicemix.bundles/org.apache.servicemix.bundles.aws-java-sdk
|
||||
Due to bug (https://issues.apache.org/jira/browse/SMX4-1921): add awssdk_config_default.json (obtained from original AWS Java SDK) to downloaded jar.
|
||||
Note: with bug 3683 we're upgrading to version 1.10.17_1 of the org.apache.servicemix.bundles.aws-java-sdk component. It has an entry
|
||||
|
||||
5004 Fri Apr 29 18:48:10 CEST 2016 com/amazonaws/internal/config/awssdk_config_default.json
|
||||
|
||||
and hence suggests that the patch described above as necessary for version 1.9.8_1 may no longer be necessary.
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?pde version="3.8"?>
|
||||
<target name="Race Analysis Target" sequenceNumber="160">
|
||||
<target name="Race Analysis Target" sequenceNumber="164">
|
||||
<locations>
|
||||
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
|
||||
<unit id="javax.ws.rs" version="1.1.1.v20130318-1750"/>
|
||||
@@ -29,8 +29,8 @@
|
||||
<unit id="javax.xml.ws" version="2.1.0.v200902101523"/>
|
||||
<unit id="org.apache.commons.beanutils" version="1.8.0.v201205091237"/>
|
||||
<unit id="org.apache.commons.beanutils.source" version="1.8.0.v201205091237"/>
|
||||
<unit id="org.apache.commons.codec" version="1.6.0.v201305230611"/>
|
||||
<unit id="org.apache.commons.codec.source" version="1.6.0.v201305230611"/>
|
||||
<unit id="org.apache.commons.codec" version="1.10.0.v20180409-1845"/>
|
||||
<unit id="org.apache.commons.codec.source" version="1.10.0.v20180409-1845"/>
|
||||
<unit id="org.apache.commons.collections" version="3.2.2.v201511171945"/>
|
||||
<unit id="org.apache.commons.collections.source" version="3.2.2.v201511171945"/>
|
||||
<unit id="org.apache.commons.fileupload" version="1.2.2.v20111214-1400"/>
|
||||
@@ -43,10 +43,11 @@
|
||||
<unit id="org.apache.commons.math.source" version="2.1.0.v201105210652"/>
|
||||
<unit id="org.apache.commons.math3" version="3.5.0.v20160301-1110"/>
|
||||
<unit id="org.apache.commons.math3.source" version="3.5.0.v20160301-1110"/>
|
||||
<unit id="org.apache.httpcomponents.httpclient" version="4.2.6.v201311072007"/>
|
||||
<unit id="org.apache.httpcomponents.httpclient.source" version="4.2.6.v201311072007"/>
|
||||
<unit id="org.apache.httpcomponents.httpcore" version="4.2.5.v201311072007"/>
|
||||
<unit id="org.apache.httpcomponents.httpcore.source" version="4.2.5.v201311072007"/>
|
||||
<unit id="org.apache.commons.logging" version="1.2.0.v20180409-1502"/>
|
||||
<unit id="org.apache.httpcomponents.httpclient" version="4.5.5.v20180409-1525"/>
|
||||
<unit id="org.apache.httpcomponents.httpclient.source" version="4.5.5.v20180409-1525"/>
|
||||
<unit id="org.apache.httpcomponents.httpcore" version="4.4.9.v20180409-1525"/>
|
||||
<unit id="org.apache.httpcomponents.httpcore.source" version="4.4.9.v20180409-1525"/>
|
||||
<unit id="org.apache.poi" version="3.9.0.v201405241750"/>
|
||||
<unit id="org.apache.poi.ooxml" version="3.9.0.v201405241905"/>
|
||||
<unit id="org.apache.poi.ooxml.schemas" version="3.9.0.v201405241750"/>
|
||||
@@ -120,7 +121,7 @@
|
||||
<repository location="https://p2.sapsailing.com/p2/sailing/"/>
|
||||
</location>
|
||||
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
|
||||
<unit id="com.amazon.aws.aws-java-api.feature.group" version="2.14.24"/>
|
||||
<unit id="com.amazon.aws.aws-java-api.feature.group" version="2.15.16"/>
|
||||
<repository location="https://p2.sapsailing.com/p2/aws-sdk/"/>
|
||||
</location>
|
||||
</locations>
|
||||
@@ -166,6 +167,7 @@
|
||||
<plugin id="org.apache.commons.math.source"/>
|
||||
<plugin id="org.apache.commons.math3"/>
|
||||
<plugin id="org.apache.commons.math3.source"/>
|
||||
<plugin id="org.apache.commons.logging"/>
|
||||
<plugin id="org.apache.felix.gogo.command"/>
|
||||
<plugin id="org.apache.felix.gogo.command.source"/>
|
||||
<plugin id="org.apache.felix.gogo.runtime"/>
|
||||
@@ -285,4 +287,4 @@
|
||||
<plugin id="com.amazon.aws.aws-java-api.source"/>
|
||||
</includeBundles>
|
||||
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
</target>
|
||||
</target>
|
||||
+10
-11
@@ -22,11 +22,10 @@ import org.apache.http.Header;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.client.ClientProtocolException;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.config.RequestConfig;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.impl.client.SystemDefaultHttpClient;
|
||||
import org.apache.http.params.BasicHttpParams;
|
||||
import org.apache.http.params.HttpConnectionParams;
|
||||
import org.apache.http.params.HttpParams;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClientBuilder;
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.parser.JSONParser;
|
||||
@@ -102,13 +101,13 @@ public class ManeuverAndWindImporter {
|
||||
}
|
||||
|
||||
public HttpClient createNewHttpClient() {
|
||||
HttpParams httpParams = new BasicHttpParams();
|
||||
HttpConnectionParams.setConnectionTimeout(httpParams, CONNECTION_TIMEOUT_MILLIS);
|
||||
HttpClient client = new SystemDefaultHttpClient(httpParams);
|
||||
client.getParams().setParameter("http.socket.timeout", CONNECTION_TIMEOUT_MILLIS);
|
||||
client.getParams().setParameter("http.connection.timeout", CONNECTION_TIMEOUT_MILLIS);
|
||||
client.getParams().setParameter("http.connection-manager.timeout", new Long(CONNECTION_TIMEOUT_MILLIS));
|
||||
client.getParams().setParameter("http.protocol.head-body-timeout", CONNECTION_TIMEOUT_MILLIS);
|
||||
CloseableHttpClient client = HttpClientBuilder.create()
|
||||
.setDefaultRequestConfig(RequestConfig.custom()
|
||||
.setConnectTimeout(CONNECTION_TIMEOUT_MILLIS)
|
||||
.setConnectionRequestTimeout(CONNECTION_TIMEOUT_MILLIS)
|
||||
.setSocketTimeout(CONNECTION_TIMEOUT_MILLIS)
|
||||
.build())
|
||||
.build();
|
||||
return client;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@ import org.apache.commons.io.FileUtils;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.impl.client.SystemDefaultHttpClient;
|
||||
import org.apache.http.impl.client.HttpClientBuilder;
|
||||
import org.json.simple.parser.ParseException;
|
||||
|
||||
import com.sap.sailing.windestimation.util.LoggingUtil;
|
||||
@@ -42,7 +42,7 @@ public class PolarDataImporter {
|
||||
}
|
||||
|
||||
protected InputStream getContentFromResponse() throws IOException, ParseException {
|
||||
HttpClient client = new SystemDefaultHttpClient();
|
||||
HttpClient client = HttpClientBuilder.create().build();
|
||||
HttpGet getProcessor = new HttpGet(getAPIString());
|
||||
HttpResponse processorResponse = client.execute(getProcessor);
|
||||
return processorResponse.getEntity().getContent();
|
||||
|
||||
@@ -8,8 +8,8 @@ Bundle-Vendor: SAP
|
||||
Require-Bundle: org.eclipse.osgi;bundle-version="3.10.1",
|
||||
org.json.simple;bundle-version="1.1.0",
|
||||
org.mongodb.mongo-java-driver;bundle-version="3.6.4",
|
||||
org.apache.httpcomponents.httpclient;bundle-version="[4.2.5,4.3.0)",
|
||||
org.apache.httpcomponents.httpcore;bundle-version="[4.0.0,4.3.0)",
|
||||
org.apache.httpcomponents.httpclient;bundle-version="4.5.5",
|
||||
org.apache.httpcomponents.httpcore;bundle-version="4.4.9",
|
||||
com.sap.sse,
|
||||
com.sap.sse.common,
|
||||
com.sap.sailing.domain.shared.android,
|
||||
@@ -40,9 +40,9 @@ Import-Package: javax.ws.rs;version="1.1.1",
|
||||
javax.ws.rs.core;version="1.1.1",
|
||||
javax.xml.bind,
|
||||
org.apache.http,
|
||||
org.apache.http.client;version="[4.2.6,4.3.0)",
|
||||
org.apache.http.client.methods;version="[4.2.6,4.3.0)",
|
||||
org.apache.http.impl.client;version="[4.2.6,4.3.0)"
|
||||
org.apache.http.client;version="4.5.5",
|
||||
org.apache.http.client.methods;version="4.5.5",
|
||||
org.apache.http.impl.client;version="4.5.5"
|
||||
Web-ContextPath: /windestimation
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Bundle-ActivationPolicy: lazy
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@ import java.util.logging.Logger;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.impl.client.SystemDefaultHttpClient;
|
||||
import org.apache.http.impl.client.HttpClientBuilder;
|
||||
import org.json.simple.parser.ParseException;
|
||||
|
||||
import com.sap.sailing.windestimation.integration.ReplicableWindEstimationFactoryService;
|
||||
@@ -61,7 +61,7 @@ public class WindEstimationDataClient {
|
||||
}
|
||||
|
||||
protected InputStream getContentFromResponse() throws IOException, ParseException {
|
||||
HttpClient client = new SystemDefaultHttpClient();
|
||||
HttpClient client = HttpClientBuilder.create().build();
|
||||
HttpGet getProcessor = new HttpGet(getAPIString());
|
||||
HttpResponse processorResponse = client.execute(getProcessor);
|
||||
return processorResponse.getEntity().getContent();
|
||||
|
||||
@@ -40,5 +40,9 @@ public enum MimeType {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static MimeType[] mp4MimeTypes() {
|
||||
return new MimeType[] { mp4, mp4panorama, mp4panoramaflip};
|
||||
}
|
||||
|
||||
}
|
||||
@@ -38,6 +38,13 @@
|
||||
version="9.4.8.v20171121"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.eclipse.jetty.osgi.boot.warurl"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="9.4.8.v20171121"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="slf4j.jdk14"
|
||||
download-size="0"
|
||||
@@ -234,6 +241,12 @@
|
||||
install-size="0"
|
||||
version="2.6.0.v201404270220"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.apache.commons.logging"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="1.2.0.v20180409-1502"/>
|
||||
|
||||
<plugin
|
||||
id="jackson-jaxrs"
|
||||
|
||||
@@ -8,4 +8,8 @@ Fragment-Host: com.sap.sse.landscape.aws
|
||||
Automatic-Module-Name: com.sap.sse.landscape.aws.test
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Require-Bundle: org.hamcrest;bundle-version="1.1.0",
|
||||
org.junit;bundle-version="4.8.2"
|
||||
org.junit;bundle-version="4.8.2",
|
||||
org.objenesis;bundle-version="2.1.0",
|
||||
org.mongodb.mongo-java-driver;bundle-version="3.6.4"
|
||||
Import-Package: org.mockito,
|
||||
org.mockito.stubbing;version="1.10.14"
|
||||
|
||||
+107
-23
@@ -1,6 +1,7 @@
|
||||
package com.sap.sse.landscape.aws;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
@@ -9,10 +10,13 @@ import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.InetAddress;
|
||||
import java.net.URL;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Collections;
|
||||
import java.util.Optional;
|
||||
import java.util.Random;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Logger;
|
||||
@@ -23,18 +27,33 @@ import org.junit.Test;
|
||||
import com.jcraft.jsch.JSch;
|
||||
import com.jcraft.jsch.JSchException;
|
||||
import com.jcraft.jsch.KeyPair;
|
||||
import com.jcraft.jsch.SftpException;
|
||||
import com.sap.sse.common.Duration;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
import com.sap.sse.common.Util;
|
||||
import com.sap.sse.landscape.Release;
|
||||
import com.sap.sse.landscape.application.ApplicationMasterProcess;
|
||||
import com.sap.sse.landscape.application.ApplicationProcess;
|
||||
import com.sap.sse.landscape.application.ApplicationProcessMetrics;
|
||||
import com.sap.sse.landscape.application.ApplicationReplicaProcess;
|
||||
import com.sap.sse.landscape.application.impl.ApplicationProcessImpl;
|
||||
import com.sap.sse.landscape.aws.impl.AmazonMachineImage;
|
||||
import com.sap.sse.landscape.aws.impl.AwsRegion;
|
||||
import com.sap.sse.landscape.aws.orchestration.CreateDNSBasedLoadBalancerMapping;
|
||||
import com.sap.sse.landscape.impl.ReleaseRepositoryImpl;
|
||||
import com.sap.sse.landscape.ssh.SSHKeyPair;
|
||||
import com.sap.sse.landscape.ssh.SshCommandChannel;
|
||||
|
||||
import software.amazon.awssdk.regions.Region;
|
||||
import software.amazon.awssdk.services.ec2.model.Instance;
|
||||
import software.amazon.awssdk.services.ec2.model.InstanceType;
|
||||
import software.amazon.awssdk.services.ec2.model.KeyPairInfo;
|
||||
import software.amazon.awssdk.services.ec2.model.Tag;
|
||||
import software.amazon.awssdk.services.elasticloadbalancingv2.model.ActionTypeEnum;
|
||||
import software.amazon.awssdk.services.elasticloadbalancingv2.model.Rule;
|
||||
import software.amazon.awssdk.services.route53.model.ChangeInfo;
|
||||
import software.amazon.awssdk.services.route53.model.ChangeStatus;
|
||||
import software.amazon.awssdk.services.route53.model.RRType;
|
||||
|
||||
/**
|
||||
* Tests for the AWS SDK landscape wrapper in bundle {@code com.sap.sse.landscape.aws}. To run these tests
|
||||
@@ -47,6 +66,7 @@ import software.amazon.awssdk.services.route53.model.ChangeStatus;
|
||||
*/
|
||||
public class ConnectivityTest {
|
||||
private static final Logger logger = Logger.getLogger(ConnectivityTest.class.getName());
|
||||
private static final Optional<Duration> optionalTimeout = Optional.of(Duration.ONE_MINUTE.times(5));
|
||||
private AwsLandscape<String, ApplicationProcessMetrics, ?, ?> landscape;
|
||||
private AwsRegion region;
|
||||
private byte[] keyPass;
|
||||
@@ -59,13 +79,59 @@ public class ConnectivityTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConnectivity() {
|
||||
public <MasterT extends ApplicationMasterProcess<String, ApplicationProcessMetrics, MasterT, ReplicaT>, ReplicaT extends ApplicationReplicaProcess<String, ApplicationProcessMetrics, MasterT, ReplicaT>>
|
||||
void testConnectivity() throws JSchException, IOException, SftpException, NumberFormatException, InterruptedException {
|
||||
final String TARGET_GROUP_NAME_PREFIX = "S-test-";
|
||||
final String hostedZoneName = "wiesen-weg.de";
|
||||
final String hostname = "test-"+new Random().nextInt()+"."+hostedZoneName;
|
||||
final String keyName = "MyKey-"+UUID.randomUUID();
|
||||
createKeyPair(keyName);
|
||||
final AwsInstance<String, ApplicationProcessMetrics> host = landscape.launchHost(landscape.getImage(region, "ami-01b4b27a5699e33e6"),
|
||||
InstanceType.T3_SMALL, landscape.getAvailabilityZoneByName(region, "eu-west-2b"), "Axel", Collections.singleton(()->"sg-0b2afd48960251280"));
|
||||
InstanceType.T3_SMALL, landscape.getAvailabilityZoneByName(region, "eu-west-2b"), keyName, Collections.singleton(()->"sg-0b2afd48960251280"),
|
||||
Optional.of(Tags.with("Name", "MyHost").and("Hello", "World")));
|
||||
try {
|
||||
assertNotNull(host);
|
||||
final Instance instance = landscape.getInstance(host.getInstanceId(), region);
|
||||
boolean foundName = false;
|
||||
boolean foundHello = false;
|
||||
for (final Tag tag : instance.tags()) {
|
||||
if (tag.key().equals("Name") && tag.value().equals("MyHost")) {
|
||||
foundName = true;
|
||||
}
|
||||
if (tag.key().equals("Hello") && tag.value().equals("World")) {
|
||||
foundHello = true;
|
||||
}
|
||||
}
|
||||
assertTrue(foundName);
|
||||
assertTrue(foundHello);
|
||||
// check env.sh access
|
||||
final ApplicationProcess<String, ApplicationProcessMetrics, MasterT, ReplicaT> process = new ApplicationProcessImpl<>(8888, host, "/home/sailing/servers/server");
|
||||
final String envSh = process.getEnvSh(optionalTimeout);
|
||||
assertFalse(envSh.isEmpty());
|
||||
assertTrue(envSh.contains("SERVER_NAME="));
|
||||
final Release release = process.getRelease(new ReleaseRepositoryImpl("http://releases.sapsailing.com", "build"), optionalTimeout);
|
||||
assertNotNull(release);
|
||||
assertEquals(14888, process.getTelnetPortToOSGiConsole(optionalTimeout));
|
||||
@SuppressWarnings("unchecked")
|
||||
final AwsLandscape<String, ApplicationProcessMetrics, MasterT, ReplicaT> castLandscape = (AwsLandscape<String, ApplicationProcessMetrics, MasterT, ReplicaT>) landscape;
|
||||
final CreateDNSBasedLoadBalancerMapping<String, ApplicationProcessMetrics, MasterT, ReplicaT, AwsInstance<String, ApplicationProcessMetrics>> createDNSBasedLoadBalancerMappingProcedure =
|
||||
new CreateDNSBasedLoadBalancerMapping<String, ApplicationProcessMetrics, MasterT, ReplicaT, AwsInstance<String, ApplicationProcessMetrics>>(
|
||||
process, hostname, TARGET_GROUP_NAME_PREFIX, castLandscape, optionalTimeout);
|
||||
final String wiesenWegId = landscape.getDNSHostedZoneId(hostedZoneName);
|
||||
try {
|
||||
createDNSBasedLoadBalancerMappingProcedure.run();
|
||||
assertNotNull(createDNSBasedLoadBalancerMappingProcedure.getLoadBalancerUsed());
|
||||
assertNotNull(createDNSBasedLoadBalancerMappingProcedure.getMasterTargetGroupCreated());
|
||||
assertEquals(TARGET_GROUP_NAME_PREFIX+process.getServerName(optionalTimeout), createDNSBasedLoadBalancerMappingProcedure.getPublicTargetGroupCreated().getName());
|
||||
} finally {
|
||||
if (createDNSBasedLoadBalancerMappingProcedure.getLoadBalancerUsed() != null) {
|
||||
createDNSBasedLoadBalancerMappingProcedure.getLoadBalancerUsed().delete();
|
||||
landscape.removeDNSRecord(wiesenWegId, hostname, RRType.CNAME, createDNSBasedLoadBalancerMappingProcedure.getLoadBalancerUsed().getDNSName());
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
landscape.terminate(host);
|
||||
landscape.deleteKeyPair(region, keyName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,31 +197,27 @@ public class ConnectivityTest {
|
||||
|
||||
private void testSshConnectWithKey(final String keyName) throws InterruptedException, JSchException, IOException {
|
||||
final AwsInstance<String, ApplicationProcessMetrics> host = landscape.launchHost(landscape.getImage(region, "ami-01b4b27a5699e33e6"),
|
||||
InstanceType.T3_SMALL, landscape.getAvailabilityZoneByName(region, "eu-west-2b"), keyName, Collections.singleton(()->"sg-0b2afd48960251280"));
|
||||
InstanceType.T3_SMALL, landscape.getAvailabilityZoneByName(region, "eu-west-2b"), keyName, Collections.singleton(()->"sg-0b2afd48960251280"), /* tags */ Optional.empty());
|
||||
try {
|
||||
assertNotNull(host);
|
||||
logger.info("Created instance with ID "+host.getInstanceId());
|
||||
logger.info("Waiting for public IP address...");
|
||||
// wait for public IPv4 address to become available:
|
||||
InetAddress address = host.getPublicAddress(Duration.ONE_SECOND.times(20));
|
||||
InetAddress address = host.getPublicAddress(optionalTimeout);
|
||||
assertNotNull(address);
|
||||
logger.info("Obtained public IP address "+address);
|
||||
SshCommandChannel shellChannel = null;
|
||||
int sshConnectAttempts = 20;
|
||||
while (shellChannel == null && sshConnectAttempts-- > 0) {
|
||||
try {
|
||||
shellChannel = host.createRootSshChannel();
|
||||
} catch (JSchException e) {
|
||||
logger.info(e.getMessage()
|
||||
+ " while trying to connect. Probably timeout trying early SSH connection. Retrying "
|
||||
+ sshConnectAttempts + " more times...");
|
||||
Thread.sleep(10000);
|
||||
}
|
||||
}
|
||||
SshCommandChannel shellChannel = host.createRootSshChannel(optionalTimeout);
|
||||
assertNotNull(shellChannel);
|
||||
logger.info("Shell channel connected. Waiting for it to become responsive...");
|
||||
shellChannel.sendCommandLineSynchronously("pwd", System.err);
|
||||
assertEquals("/root\n", turnAllLineSeparatorsIntoLineFeed(new String(shellChannel.getStreamContentsAsByteArray())));
|
||||
// now try a simple command, checking for the "init" process to be found
|
||||
final SshCommandChannel commandChannel = host.createRootSshChannel(Optional.empty());
|
||||
final String processToLookFor = "init";
|
||||
commandChannel.sendCommandLineSynchronously("ps axlw | grep "+processToLookFor, new ByteArrayOutputStream());
|
||||
final String output = new String(commandChannel.getStreamContentsAsByteArray());
|
||||
assertTrue(output.contains(processToLookFor));
|
||||
assertEquals(0, commandChannel.getExitStatus());
|
||||
} finally {
|
||||
landscape.terminate(host);
|
||||
landscape.deleteKeyPair(region, keyName);
|
||||
@@ -181,31 +243,44 @@ public class ConnectivityTest {
|
||||
|
||||
@Test
|
||||
public void setDNSRecordTest() {
|
||||
final String hostname = "my-test-host-"+new Random().nextInt()+".wiesen-weg.de.";
|
||||
final String testHostedZoneDnsName = "wiesen-weg.de";
|
||||
final String hostname = "my-test-host-"+new Random().nextInt()+"."+testHostedZoneDnsName+".";
|
||||
final String ipAddress = "1.2.3.4";
|
||||
final String dnsHostedZoneId = landscape.getDNSHostedZoneId(testHostedZoneDnsName);
|
||||
try {
|
||||
ChangeInfo changeInfo = landscape.setDNSRecordToValue(landscape.getDefaultDNSHostedZoneId(), hostname, ipAddress);
|
||||
ChangeInfo changeInfo = landscape.setDNSRecordToValue(dnsHostedZoneId, hostname, ipAddress);
|
||||
int attempts = 10;
|
||||
while ((changeInfo=landscape.getUpdatedChangeInfo(changeInfo)).status() != ChangeStatus.INSYNC && --attempts > 0) {
|
||||
Thread.sleep(5000);
|
||||
Thread.sleep(10000);
|
||||
};
|
||||
assertEquals(ChangeStatus.INSYNC, changeInfo.status());
|
||||
} catch (Exception e) {
|
||||
fail(e.getMessage());
|
||||
} finally {
|
||||
landscape.removeDNSRecord(landscape.getDefaultDNSHostedZoneId(), hostname, ipAddress);
|
||||
landscape.removeDNSRecord(dnsHostedZoneId, hostname, ipAddress);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void createEmptyLoadBalancerTest() {
|
||||
public void createEmptyLoadBalancerTest() throws InterruptedException {
|
||||
final String albName = "MyAlb"+new Random().nextInt();
|
||||
final ApplicationLoadBalancer alb = landscape.createLoadBalancer(albName, region);
|
||||
final ApplicationLoadBalancer<String, ApplicationProcessMetrics> alb = landscape.createLoadBalancer(albName, region);
|
||||
try {
|
||||
assertNotNull(alb);
|
||||
assertEquals(albName, alb.getName());
|
||||
assertTrue(Util.contains(Util.map(landscape.getLoadBalancers(region), ApplicationLoadBalancer::getArn), alb.getArn()));
|
||||
// now add two rules to the load balancer and check they arrive:
|
||||
final String hostnameCondition = "a.wiesen-weg.de";
|
||||
@SuppressWarnings("unchecked")
|
||||
final Iterable<Rule> rulesCreated = alb
|
||||
.addRules(Rule.builder()
|
||||
.priority("5")
|
||||
.conditions(r -> r.field("host-header").hostHeaderConfig(hhc -> hhc.values(hostnameCondition)))
|
||||
.actions(a -> a.type(ActionTypeEnum.FIXED_RESPONSE).fixedResponseConfig(frc -> frc.statusCode("200").messageBody("Hello world"))).build());
|
||||
assertEquals(1, Util.size(rulesCreated));
|
||||
assertTrue(hostnameCondition, rulesCreated.iterator().next().conditions().iterator().next().hostHeaderConfig().values().contains(hostnameCondition));
|
||||
} finally {
|
||||
landscape.deleteLoadBalancer(alb);
|
||||
alb.delete();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -220,4 +295,13 @@ public class ConnectivityTest {
|
||||
landscape.deleteTargetGroup(targetGroup);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCentralReverseProxyInEuWest2IsAvailable() throws IOException, InterruptedException, JSchException {
|
||||
final ReverseProxyCluster<String, ApplicationProcessMetrics, ?, ?, ?> proxy = landscape.getCentralReverseProxy(new AwsRegion("eu-west-2"));
|
||||
assertEquals(1, Util.size(proxy.getHosts()));
|
||||
final HttpURLConnection healthCheckConnection = (HttpURLConnection) new URL("http://"+proxy.getHosts().iterator().next().getPublicAddress().getCanonicalHostName()+proxy.getHealthCheckPath()).openConnection();
|
||||
assertEquals(200, healthCheckConnection.getResponseCode());
|
||||
healthCheckConnection.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.sap.sse.landscape.aws;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mockito.Mockito;
|
||||
|
||||
import com.sap.sse.common.Duration;
|
||||
import com.sap.sse.landscape.Host;
|
||||
import com.sap.sse.landscape.mongodb.impl.MongoProcessImpl;
|
||||
import com.sap.sse.landscape.mongodb.impl.MongoProcessInReplicaSetImpl;
|
||||
import com.sap.sse.landscape.mongodb.impl.MongoReplicaSetImpl;
|
||||
|
||||
public class MongoTests {
|
||||
private static final Optional<Duration> optionalTimeout = Optional.of(Duration.ONE_MINUTE.times(5));
|
||||
|
||||
private Host localhost;
|
||||
private MongoProcessImpl mongoProcess;
|
||||
private MongoProcessInReplicaSetImpl mongoProcessInReplicaSet;
|
||||
private MongoReplicaSetImpl mongoReplicaSet;
|
||||
|
||||
@Before
|
||||
public void setUp() throws UnknownHostException {
|
||||
localhost = Mockito.mock(Host.class);
|
||||
Mockito.when(localhost.getPublicAddress()).thenReturn(InetAddress.getByName("127.0.0.1"));
|
||||
mongoProcess = new MongoProcessImpl(localhost);
|
||||
mongoReplicaSet = new MongoReplicaSetImpl("rs0");
|
||||
mongoProcessInReplicaSet = new MongoProcessInReplicaSetImpl(mongoReplicaSet, 10222, localhost);
|
||||
mongoReplicaSet.addReplica(mongoProcessInReplicaSet);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMongoReadiness() {
|
||||
assertTrue(mongoProcess.isReady(optionalTimeout));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMongoProcessInReplicaSetIsAvailable() {
|
||||
assertTrue(mongoProcessInReplicaSet.isReady(optionalTimeout));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMongoProcessInReplicaSetCanReportPriority() throws URISyntaxException {
|
||||
assertTrue(mongoProcessInReplicaSet.isInReplicaSet());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMd5() throws URISyntaxException {
|
||||
final String hash = mongoReplicaSet.getMD5Hash("local");
|
||||
assertNotNull(hash);
|
||||
assertTrue(!hash.isEmpty());
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,10 @@ Require-Bundle: com.amazon.aws.aws-java-api;bundle-version="2.13.50",
|
||||
com.jcraft.jsch;bundle-version="0.1.54",
|
||||
com.sap.sse.landscape.aws.persistence,
|
||||
com.sap.sse.security,
|
||||
com.sap.sse.mongodb
|
||||
com.sap.sse.mongodb,
|
||||
com.sap.sse.shared.android
|
||||
Import-Package: org.osgi.framework;version="1.8.0"
|
||||
Bundle-Activator: com.sap.sse.landscape.aws.impl.Activator
|
||||
Export-Package: com.sap.sse.landscape.aws
|
||||
Export-Package: com.sap.sse.landscape.aws,
|
||||
com.sap.sse.landscape.aws.impl,
|
||||
com.sap.sse.landscape.aws.orchestration
|
||||
|
||||
+61
-6
@@ -2,6 +2,10 @@ package com.sap.sse.landscape.aws;
|
||||
|
||||
import com.sap.sse.common.Named;
|
||||
import com.sap.sse.landscape.Region;
|
||||
import com.sap.sse.landscape.application.ApplicationProcessMetrics;
|
||||
|
||||
import software.amazon.awssdk.services.elasticloadbalancingv2.model.Listener;
|
||||
import software.amazon.awssdk.services.elasticloadbalancingv2.model.Rule;
|
||||
|
||||
/**
|
||||
* Represents an AWS Application Load Balancer (ALB). When created, a default configuration with the following
|
||||
@@ -9,25 +13,76 @@ import com.sap.sse.landscape.Region;
|
||||
* and {@code access_logs.s3.prefix}, enabling {@code deletion_protection.enabled} and setting
|
||||
* {@code idle_timeout.timeout_seconds} to the maximum value of 4000s, furthermore spanning all availability
|
||||
* zones available in the region in which the ALB is deployed and using a specific security group that
|
||||
* allows for HTTP and HTTPS traffic.
|
||||
* allows for HTTP and HTTPS traffic.<p>
|
||||
*
|
||||
* Furthermore, two listeners are always established: the HTTP listener forwards to a dedicated target group that
|
||||
* has as its target(s) the central reverse proxy/proxies. Any HTTP request arriving there will be re-written to
|
||||
* a corresponding HTTPS request and is then expected to arrive at the HTTPS listener of the same ALB.<p>
|
||||
*
|
||||
* The HTTPS listener contains a default route that also forwards to central reverse proxy/proxies, requiring
|
||||
* another ALB-specific target group for HTTPS traffic.<p>
|
||||
*
|
||||
* The two default rules and the two listeners are not entirely exposed by this interface. Instead, clients
|
||||
* will only see the non-default rule set of the HTTPS listener which is used to dynamically configure the
|
||||
* landscape.
|
||||
*
|
||||
* @author Axel Uhl (D043530)
|
||||
*
|
||||
*/
|
||||
public interface ApplicationLoadBalancer extends Named {
|
||||
public interface ApplicationLoadBalancer<ShardingKey, MetricsT extends ApplicationProcessMetrics> extends Named {
|
||||
/**
|
||||
* The DNS name of this load balancer; can be used, e.g., to set a CNAME DNS record pointing
|
||||
* to this load balancer.
|
||||
*/
|
||||
String getDNSName();
|
||||
|
||||
Iterable<LoadBalancerRule> getRules();
|
||||
Iterable<Rule> getRules();
|
||||
|
||||
void addRules(Iterable<LoadBalancerRule> rulesToAdd);
|
||||
|
||||
void deleteRules(Iterable<LoadBalancerRule> rulesToDelete);
|
||||
void deleteRules(Rule... rulesToDelete);
|
||||
|
||||
Region getRegion();
|
||||
|
||||
String getArn();
|
||||
|
||||
/**
|
||||
* Application load balancer rules have a {@link Rule#priority() priority} which must be unique in the scope of a
|
||||
* load balancer's listener. This way, when rules come and go, holes in the priority numbering scheme will start to exist.
|
||||
* If a set of rules is to be added ({@code rulesToAdd}), consider using {@link #assignUnusedPriorities} to make room
|
||||
* for interleaved or contiguous addition of the new rules.
|
||||
*
|
||||
* @param rulesToAdd
|
||||
* rules (without an ARN set yet), specifying which rules to add to the HTTPS listener of this load
|
||||
* balancer. All rules must have a priority that is not used currently by the listener.
|
||||
* @return the rules created, with ARNs set
|
||||
*/
|
||||
Iterable<Rule> addRules(Rule... rulesToAdd);
|
||||
|
||||
/**
|
||||
* As the rule {@link Rule#priority() priorities} within a load balancer's listener have to be unique, this method
|
||||
* supports adding rules by assigning yet unused priorities to them. It keeps the order in which the {@code rules}
|
||||
* are passed. If {@code forceContiguous} is {@code false}, for each rule the next available priority is chosen and
|
||||
* assigned by creating a copy of the {@link Rule} object and adding it to the resulting sequence. This can lead to
|
||||
* existing rules interleaving with the rules to add while ensuring that the {@code rules} have priorities in
|
||||
* numerically ascending order, consistent with the order in which they were passed to this method.
|
||||
* <p>
|
||||
*
|
||||
* If {@code forceContiguous} is {@code true}, the rules that result will have contiguously increasing priority
|
||||
* values, hence not interleaving with other existing rules. If there are enough contiguous unused priorities
|
||||
* available, they are selected and assigned by creating copies of the {@link Rule} objects and adding them in their
|
||||
* original order to the resulting sequence. Otherwise, the existing rules are "compressed" by re-numbering their
|
||||
* priorities to make space for the new rules at the end of the list.
|
||||
*
|
||||
* @return copies of the original rules, with unused {@link Rule#priority() priorities} assigned, as passed already
|
||||
* to {@link #addRules(Rule...)}.
|
||||
*/
|
||||
Iterable<Rule> addRulesAssigningUnusedPriorities(boolean forceContiguous, Rule... rules);
|
||||
|
||||
Iterable<TargetGroup<ShardingKey, MetricsT>> getTargetGroups();
|
||||
|
||||
/**
|
||||
* Deletes this application load balancer and all its {@link #getTargetGroups target groups}.
|
||||
*/
|
||||
void delete() throws InterruptedException;
|
||||
|
||||
void deleteListener(Listener listener);
|
||||
}
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
package com.sap.sse.landscape.aws;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.PipedInputStream;
|
||||
import java.io.PipedOutputStream;
|
||||
|
||||
import com.jcraft.jsch.Channel;
|
||||
import com.jcraft.jsch.ChannelSftp;
|
||||
import com.jcraft.jsch.JSchException;
|
||||
import com.sap.sse.landscape.Host;
|
||||
import com.sap.sse.landscape.MachineImage;
|
||||
import com.sap.sse.landscape.application.ApplicationProcessMetrics;
|
||||
@@ -20,27 +12,7 @@ import com.sap.sse.landscape.application.ApplicationProcessMetrics;
|
||||
*
|
||||
*/
|
||||
public interface AwsInstance<ShardingKey, MetricsT extends ApplicationProcessMetrics> extends Host {
|
||||
/**
|
||||
* Connects to an SSH session for the username specified, using the SSH key pair used to launch the instance, and
|
||||
* opens a "shell" channel. Use the {@link Channel} returned by {@link Channel#setInputStream(java.io.InputStream)
|
||||
* setting an input stream} from which the commands to be sent to the server will be read, and by
|
||||
* {@link Channel#setOutputStream(java.io.OutputStream) setting the output stream} to which the server will send its
|
||||
* output. You will usually want to use either a {@link ByteArrayInputStream} to provide a set of predefined
|
||||
* commands to sent to the server, and a {@link PipedInputStream} wrapped around a {@link PipedOutputStream} which
|
||||
* you set to the channel.
|
||||
*/
|
||||
SshCommandChannel createSshChannel(String sshUserName) throws JSchException, IOException, InterruptedException;
|
||||
|
||||
/**
|
||||
* Connects to an SSH session for the "root" user with a "shell" channel
|
||||
*
|
||||
* @see #createSshChannel(String)
|
||||
*/
|
||||
SshCommandChannel createRootSshChannel() throws JSchException, IOException, InterruptedException;
|
||||
|
||||
ChannelSftp createSftpChannel(String sshUserName) throws JSchException, IOException;
|
||||
|
||||
ChannelSftp createRootSftpChannel() throws JSchException, IOException;
|
||||
|
||||
String getInstanceId();
|
||||
|
||||
void terminate();
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user