Merge remote-tracking branch 'origin/master'
# Conflicts: # src/Main.java # src/ProtegeGX/ProtegeGX.java
This commit is contained in:
10
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
10
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<profile version="1.0">
|
||||||
|
<option name="myName" value="Project Default" />
|
||||||
|
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
|
||||||
|
<option name="processCode" value="true" />
|
||||||
|
<option name="processLiterals" value="true" />
|
||||||
|
<option name="processComments" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
</profile>
|
||||||
|
</component>
|
||||||
30
.idea/libraries/io_javalin.xml
generated
Normal file
30
.idea/libraries/io_javalin.xml
generated
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="io.javalin" type="repository">
|
||||||
|
<properties maven-id="io.javalin:javalin:6.3.0" />
|
||||||
|
<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$/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!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</component>
|
||||||
10
.idea/libraries/projectlombok_lombok.xml
generated
Normal file
10
.idea/libraries/projectlombok_lombok.xml
generated
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="projectlombok.lombok" type="repository">
|
||||||
|
<properties maven-id="org.projectlombok:lombok:1.18.34" />
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.34/lombok-1.18.34.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</component>
|
||||||
4
.idea/misc.xml
generated
4
.idea/misc.xml
generated
@@ -1,5 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
|
<component name="PWA">
|
||||||
|
<option name="enabled" value="true" />
|
||||||
|
<option name="wasEnabledAtLeastOnce" value="true" />
|
||||||
|
</component>
|
||||||
<component name="ProjectInspectionProfilesVisibleTreeState">
|
<component name="ProjectInspectionProfilesVisibleTreeState">
|
||||||
<entry key="Project Default">
|
<entry key="Project Default">
|
||||||
<profile-state>
|
<profile-state>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
<exclude-output />
|
<exclude-output />
|
||||||
<content url="file://$MODULE_DIR$">
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/Web" isTestSource="false" />
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="inheritedJdk" />
|
<orderEntry type="inheritedJdk" />
|
||||||
@@ -17,5 +18,7 @@
|
|||||||
</library>
|
</library>
|
||||||
</orderEntry>
|
</orderEntry>
|
||||||
<orderEntry type="library" name="tinylog" level="project" />
|
<orderEntry type="library" name="tinylog" level="project" />
|
||||||
|
<orderEntry type="library" name="io.javalin" level="project" />
|
||||||
|
<orderEntry type="library" name="projectlombok.lombok" level="project" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
||||||
@@ -1,10 +1,7 @@
|
|||||||
import AASMini.AASMini;
|
import AASMini.AASMini;
|
||||||
import ProtegeGX.ProtegeGX;
|
|
||||||
|
|
||||||
public class Main {
|
public class Main {
|
||||||
private static AASMini aas;
|
private static AASMini aas;
|
||||||
private static ProtegeGX protegeGX;
|
|
||||||
|
|
||||||
private static String aasIP = "192.168.10.10";
|
private static String aasIP = "192.168.10.10";
|
||||||
private static int aasPort = 8080;
|
private static int aasPort = 8080;
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
@@ -12,14 +9,10 @@ public class Main {
|
|||||||
public void run() {
|
public void run() {
|
||||||
System.out.println("Shutting down...");
|
System.out.println("Shutting down...");
|
||||||
if (aas!=null) aas.Disconnect();
|
if (aas!=null) aas.Disconnect();
|
||||||
if (protegeGX!=null) protegeGX.Disconnect();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
System.out.println("Protege to AAS Mini Connector");
|
System.out.println("Protege to AAS Mini Connector");
|
||||||
|
|
||||||
protegeGX = new ProtegeGX();
|
|
||||||
|
|
||||||
aas = new AASMini(aasIP, aasPort);
|
aas = new AASMini(aasIP, aasPort);
|
||||||
aas.Connect();
|
aas.Connect();
|
||||||
}
|
}
|
||||||
|
|||||||
12
src/ProtegeGX/ProtegeData.java
Normal file
12
src/ProtegeGX/ProtegeData.java
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
package ProtegeGX;
|
||||||
|
|
||||||
|
public class ProtegeData {
|
||||||
|
public String ReaderID;
|
||||||
|
public String CardID;
|
||||||
|
public String Description;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString(){
|
||||||
|
return "ReaderID = " + ReaderID + ", CardID = " + CardID + ", Description = " + Description;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,12 +1,4 @@
|
|||||||
package ProtegeGX;
|
package ProtegeGX;
|
||||||
|
|
||||||
public class ProtegeGX {
|
public class ProtegeGX {
|
||||||
public ProtegeGX(){
|
|
||||||
System.out.println("ProtegeGX Constructor");
|
|
||||||
//TODO belum ada codingan, tunggu apache cxf jar nya
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Disconnect(){
|
|
||||||
//TODO belum ada codingan, tunggu apache cxf jar nya
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
51
src/Web/WebServer.java
Normal file
51
src/Web/WebServer.java
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
package Web;
|
||||||
|
|
||||||
|
import io.javalin.Javalin;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
|
import static io.javalin.apibuilder.ApiBuilder.get;
|
||||||
|
import static io.javalin.apibuilder.ApiBuilder.path;
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
|
public class WebServer {
|
||||||
|
@Setter private Consumer<String> aasAPI;
|
||||||
|
@Setter private Consumer<String> protegeGXAPI;
|
||||||
|
|
||||||
|
private void updateAASAPI(String data){
|
||||||
|
if (aasAPI!=null) aasAPI.accept(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateProtegeGXAPI(String data){
|
||||||
|
if (protegeGXAPI!=null) protegeGXAPI.accept(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
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"));
|
||||||
|
});
|
||||||
|
// API for ProtegeGX
|
||||||
|
path("protegegx", ()->{
|
||||||
|
//TODO implement API for ProtegeGX
|
||||||
|
get(ctx -> ctx.result("ProtegeGX API"));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Start(int listenport){
|
||||||
|
app.start(listenport);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Stop(){
|
||||||
|
app.stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user