mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-04 01:59:35 +00:00
Merge branch 'master' into feature/procedure_wizard
This commit is contained in:
commit
abcebf2f04
382 files changed
+11240
-10584
No files matched your search
@@ -1,7 +0,0 @@
|
||||
<?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"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
@@ -1,28 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>com.sap.sse.gateway</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>
|
||||
@@ -1,7 +0,0 @@
|
||||
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.source=1.8
|
||||
@@ -1,3 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
pluginProject.extensions=false
|
||||
resolve.requirebundle=false
|
||||
@@ -1,15 +0,0 @@
|
||||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Gateway
|
||||
Bundle-SymbolicName: com.sap.sse.gateway
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Bundle-Vendor: SAP
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Import-Package: javax.servlet;version="3.1.0",
|
||||
javax.servlet.http;version="3.1.0",
|
||||
org.osgi.framework;version="1.8.0",
|
||||
org.osgi.util.tracker;version="1.5.1"
|
||||
Require-Bundle: com.sap.sse.common,
|
||||
com.sap.sse
|
||||
Export-Package: com.sap.sse.gateway
|
||||
Bundle-ActivationPolicy: lazy
|
||||
@@ -1,4 +0,0 @@
|
||||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.
|
||||
@@ -1,12 +0,0 @@
|
||||
<?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.sse.gateway</artifactId>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
</project>
|
||||
@@ -1,63 +0,0 @@
|
||||
package com.sap.sse.gateway;
|
||||
|
||||
import javax.servlet.ServletConfig;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
||||
import com.sap.sse.InvalidDateException;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
import com.sap.sse.util.DateParser;
|
||||
|
||||
/**
|
||||
* A servlet that holds an OSGi service reference
|
||||
*
|
||||
* @author Axel Uhl (D043530)
|
||||
*
|
||||
* @param <S> the service type
|
||||
*/
|
||||
public abstract class AbstractHttpServlet extends HttpServlet {
|
||||
private static final long serialVersionUID = -6514453597593669376L;
|
||||
|
||||
protected static final String PARAM_NAME_TIME = "time";
|
||||
|
||||
protected static final String PARAM_NAME_TIME_MILLIS = "timeasmillis";
|
||||
|
||||
private static final String OSGI_RFC66_WEBBUNDLE_BUNDLECONTEXT_NAME = "osgi-bundlecontext";
|
||||
|
||||
private BundleContext context;
|
||||
|
||||
@Override
|
||||
public void init(ServletConfig config) throws ServletException {
|
||||
super.init(config);
|
||||
context = (BundleContext) config.getServletContext().getAttribute(OSGI_RFC66_WEBBUNDLE_BUNDLECONTEXT_NAME);
|
||||
}
|
||||
|
||||
protected BundleContext getContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
protected TimePoint readTimePointParam(HttpServletRequest req, String nameOfISOTimeParam, String nameOfMillisTime) throws InvalidDateException {
|
||||
return readTimePointParam(req, nameOfISOTimeParam, nameOfMillisTime, null);
|
||||
}
|
||||
|
||||
protected TimePoint readTimePointParam(HttpServletRequest req, String nameOfISOTimeParam, String nameOfMillisTime,
|
||||
TimePoint defaultValue) throws InvalidDateException {
|
||||
String time = req.getParameter(nameOfISOTimeParam);
|
||||
TimePoint timePoint;
|
||||
if (time != null && time.length() > 0) {
|
||||
timePoint = new MillisecondsTimePoint(DateParser.parse(time).getTime());
|
||||
} else {
|
||||
String timeAsMillis = req.getParameter(nameOfMillisTime);
|
||||
if (timeAsMillis != null && timeAsMillis.length() > 0) {
|
||||
timePoint = new MillisecondsTimePoint(Long.valueOf(timeAsMillis));
|
||||
} else {
|
||||
timePoint = defaultValue;
|
||||
}
|
||||
}
|
||||
return timePoint;
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
package com.sap.sse.gateway;
|
||||
|
||||
import javax.servlet.ServletConfig;
|
||||
import javax.servlet.ServletException;
|
||||
|
||||
import org.osgi.util.tracker.ServiceTracker;
|
||||
|
||||
/**
|
||||
* A servlet that holds an OSGi service reference
|
||||
*
|
||||
* @author Axel Uhl (D043530)
|
||||
*
|
||||
* @param <S> the service type
|
||||
*/
|
||||
public abstract class HttpServletWithService<S> extends AbstractHttpServlet {
|
||||
private static final long serialVersionUID = -6514453597593669376L;
|
||||
|
||||
private ServiceTracker<S, S> racingEventServiceTracker;
|
||||
|
||||
private final String serviceClassName;
|
||||
|
||||
protected HttpServletWithService(Class<S> serviceClass) {
|
||||
this.serviceClassName = serviceClass.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(ServletConfig config) throws ServletException {
|
||||
super.init(config);
|
||||
racingEventServiceTracker = new ServiceTracker<S, S>(getContext(), serviceClassName, null);
|
||||
racingEventServiceTracker.open();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
super.destroy();
|
||||
if (racingEventServiceTracker != null) {
|
||||
racingEventServiceTracker.close();
|
||||
}
|
||||
}
|
||||
|
||||
public S getService() {
|
||||
return racingEventServiceTracker.getService();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user