First commit
This commit is contained in:
44
.idea/libraries/io_javalin.xml
generated
44
.idea/libraries/io_javalin.xml
generated
@@ -1,28 +1,30 @@
|
||||
<component name="libraryTable">
|
||||
<library name="io.javalin" type="repository">
|
||||
<properties maven-id="io.javalin:javalin:6.3.0" />
|
||||
<properties maven-id="io.javalin:javalin:4.6.8" />
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/javalin/javalin/6.3.0/javalin-6.3.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/slf4j/slf4j-api/2.0.16/slf4j-api-2.0.16.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jetty/jetty-server/11.0.23/jetty-server-11.0.23.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jetty/jetty-http/11.0.23/jetty-http-11.0.23.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jetty/jetty-util/11.0.23/jetty-util-11.0.23.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jetty/jetty-io/11.0.23/jetty-io-11.0.23.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jetty/toolchain/jetty-jakarta-servlet-api/5.0.2/jetty-jakarta-servlet-api-5.0.2.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jetty/websocket/websocket-jetty-server/11.0.23/websocket-jetty-server-11.0.23.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jetty/jetty-servlet/11.0.23/jetty-servlet-11.0.23.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jetty/jetty-security/11.0.23/jetty-security-11.0.23.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jetty/jetty-webapp/11.0.23/jetty-webapp-11.0.23.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jetty/jetty-xml/11.0.23/jetty-xml-11.0.23.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jetty/websocket/websocket-jetty-api/11.0.23/websocket-jetty-api-11.0.23.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jetty/websocket/websocket-jetty-common/11.0.23/websocket-jetty-common-11.0.23.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jetty/websocket/websocket-core-common/11.0.23/websocket-core-common-11.0.23.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jetty/websocket/websocket-servlet/11.0.23/websocket-servlet-11.0.23.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jetty/websocket/websocket-core-server/11.0.23/websocket-core-server-11.0.23.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.9.25/kotlin-stdlib-jdk8-1.9.25.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/kotlin/kotlin-stdlib/1.9.25/kotlin-stdlib-1.9.25.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/io/javalin/javalin/4.6.8/javalin-4.6.8.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jetty/jetty-server/9.4.51.v20230217/jetty-server-9.4.51.v20230217.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jetty/jetty-http/9.4.51.v20230217/jetty-http-9.4.51.v20230217.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jetty/jetty-util/9.4.51.v20230217/jetty-util-9.4.51.v20230217.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jetty/jetty-io/9.4.51.v20230217/jetty-io-9.4.51.v20230217.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jetty/jetty-webapp/9.4.51.v20230217/jetty-webapp-9.4.51.v20230217.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jetty/jetty-xml/9.4.51.v20230217/jetty-xml-9.4.51.v20230217.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jetty/jetty-servlet/9.4.51.v20230217/jetty-servlet-9.4.51.v20230217.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jetty/jetty-security/9.4.51.v20230217/jetty-security-9.4.51.v20230217.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jetty/jetty-util-ajax/9.4.51.v20230217/jetty-util-ajax-9.4.51.v20230217.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jetty/websocket/websocket-server/9.4.51.v20230217/websocket-server-9.4.51.v20230217.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jetty/websocket/websocket-common/9.4.51.v20230217/websocket-common-9.4.51.v20230217.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jetty/websocket/websocket-api/9.4.51.v20230217/websocket-api-9.4.51.v20230217.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jetty/websocket/websocket-client/9.4.51.v20230217/websocket-client-9.4.51.v20230217.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jetty/jetty-client/9.4.51.v20230217/jetty-client-9.4.51.v20230217.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/jetty/websocket/websocket-servlet/9.4.51.v20230217/websocket-servlet-9.4.51.v20230217.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.5.32/kotlin-stdlib-jdk8-1.5.32.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/kotlin/kotlin-stdlib/1.5.32/kotlin-stdlib-1.5.32.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/annotations/13.0/annotations-13.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.9.25/kotlin-stdlib-jdk7-1.9.25.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/kotlin/kotlin-stdlib-common/1.5.32/kotlin-stdlib-common-1.5.32.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.5.32/kotlin-stdlib-jdk7-1.5.32.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
||||
@@ -1,4 +1,20 @@
|
||||
package ProtegeGX;
|
||||
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class ProtegeGX {
|
||||
@Setter private Consumer<ProtegeData> onCardRead;
|
||||
|
||||
private void updateCardRead(String data) {
|
||||
if (onCardRead != null) {
|
||||
ProtegeData protegeData = new ProtegeData();
|
||||
onCardRead.accept(protegeData);
|
||||
}
|
||||
}
|
||||
public void Disconnect() {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package Web;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import io.javalin.Javalin;
|
||||
import io.javalin.http.staticfiles.Location;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.function.Function;
|
||||
@@ -31,14 +32,12 @@ public class WebServer {
|
||||
Javalin app;
|
||||
public WebServer(){
|
||||
app = Javalin.create(config -> {
|
||||
config.useVirtualThreads = true;
|
||||
config.staticFiles.add("/Web");
|
||||
config.router.apiBuilder(()->{
|
||||
// API for AAS Mini
|
||||
path("aasmini", ()->{
|
||||
//TODO implement API for AAS Mini
|
||||
get(ctx -> ctx.result("AAS Mini API"));
|
||||
post(ctx -> {
|
||||
config.addStaticFiles("/Web", Location.EXTERNAL);
|
||||
});
|
||||
app.get("/", ctx -> ctx.result("Hello World"));
|
||||
app.get("/aasmini", ctx -> ctx.result("AAS Mini API"));
|
||||
app.get("/protegegx", ctx -> ctx.result("ProtegeGX API"));
|
||||
app.post("/aasmini", ctx ->{
|
||||
try{
|
||||
WebRequest request = gson.fromJson(ctx.body(), WebRequest.class);
|
||||
WebResponse response = ProcessAAS(request);
|
||||
@@ -53,12 +52,7 @@ public class WebServer {
|
||||
ctx.result("Exception: "+e.getMessage());
|
||||
}
|
||||
});
|
||||
});
|
||||
// API for ProtegeGX
|
||||
path("protegegx", ()->{
|
||||
//TODO implement API for ProtegeGX
|
||||
get(ctx -> ctx.result("ProtegeGX API"));
|
||||
post(ctx -> {
|
||||
app.post("/protegegx", ctx ->{
|
||||
try{
|
||||
WebRequest request = gson.fromJson(ctx.body(), WebRequest.class);
|
||||
WebResponse response = ProcessProtegeGX(request);
|
||||
@@ -73,9 +67,6 @@ public class WebServer {
|
||||
ctx.result("Exception: "+e.getMessage());
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
public void Start(int listenport){
|
||||
|
||||
Reference in New Issue
Block a user