Skip to content

Commit

Permalink
epcis-facade base made, copyright update
Browse files Browse the repository at this point in the history
  • Loading branch information
JaewookByun committed Jan 4, 2024
1 parent 47d32b1 commit 18172e6
Show file tree
Hide file tree
Showing 72 changed files with 1,699 additions and 107 deletions.
36 changes: 36 additions & 0 deletions epcis-extension/epcis-facade/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
23 changes: 23 additions & 0 deletions epcis-extension/epcis-facade/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>epcis-facade</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/test/java=UTF-8
encoding/<project>=UTF-8
11 changes: 11 additions & 0 deletions epcis-extension/epcis-facade/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=21
org.eclipse.jdt.core.compiler.compliance=21
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=21
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
42 changes: 42 additions & 0 deletions epcis-extension/epcis-facade/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.oliot.epcis</groupId>
<artifactId>epcis-facade</artifactId>
<version>0.0.1</version>
<packaging>jar</packaging>
<name>epcis-facade</name>
<url>https://github.com/JaewookByun/epcis</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<vertx.version>4.5.0</vertx.version>
</properties>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-core</artifactId>
<version>${vertx.version}</version>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-web</artifactId>
<version>${vertx.version}</version>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-web-client</artifactId>
<version>${vertx.version}</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
package org.oliot.epcis.server;

import org.oliot.epcis.server.handler.JSONCaptureServiceHandler;
import org.oliot.epcis.server.handler.MetadataHandler;
import org.oliot.epcis.server.handler.RESTQueryServiceHandler;
import org.oliot.epcis.server.handler.SOAPQueryServiceHandler;
import org.oliot.epcis.server.handler.XMLCaptureServiceHandler;

import io.vertx.core.AbstractVerticle;
import io.vertx.core.Promise;
import io.vertx.core.Vertx;
import io.vertx.core.http.HttpMethod;
import io.vertx.core.http.HttpServer;
import io.vertx.ext.web.Router;
import io.vertx.ext.web.handler.BodyHandler;
import io.vertx.ext.web.handler.CorsHandler;

/**
* Copyright (C) 2020-2024. (Jaewook Byun) all rights reserved.
* <p>
* This project is an open source implementation of Electronic Product Code
* Information Service (EPCIS) v2.0,
* <p>
*
* @author Jaewook Byun, Ph.D., Assistant Professor, Sejong University,
* jwbyun@sejong.ac.kr, Associate Director, Auto-ID Labs, Korea,
* bjw0829@gmail.com
*/
public class EPCISServer extends AbstractVerticle {

private int port = 80;

@Override
public void start(Promise<Void> startPromise) {
final HttpServer server = vertx.createHttpServer();
final Router router = Router.router(vertx);

setRouter(router);

registerMetadataHandler(router);
registerXMLCaptureServiceHandler(router);
registerJSONCaptureServiceHandler(router);
registerSOAPQueryServiceHandler(router);
registerRESTQueryServiceHandler(router);

server.requestHandler(router).listen(port);
System.out.println("Server turns on with a port: " + port);
}

public void registerMetadataHandler(Router router) {
MetadataHandler.registerBaseHandler(router);
MetadataHandler.registerCaptureHandler(router);
MetadataHandler.registerCaptureIDHandler(router);
MetadataHandler.registerEventsHandler(router);
MetadataHandler.registerVocabualariesHandler(router);
MetadataHandler.registerGetEventHandler(router);
MetadataHandler.registerGetVocabularyHandler(router);
MetadataHandler.registerQueryHandler(router);

MetadataHandler.registerGetEventTypesHandler(router);
MetadataHandler.registerGetEventTypeQueriesHandler(router);
MetadataHandler.registerGetEventsWithEventType(router);

MetadataHandler.registerGetEPCsHandler(router);
MetadataHandler.registerGetEPCQueriesHandler(router);
MetadataHandler.registerGetEventsWithEPC(router);
MetadataHandler.registerGetVocabulariesWithEPC(router);

MetadataHandler.registerGetBizStepsHandler(router);
MetadataHandler.registerGetBizStepQueriesHandler(router);
MetadataHandler.registerGetEventsWithBizStep(router);

MetadataHandler.registerGetBizLocationsHandler(router);
MetadataHandler.registerGetBizLocationQueriesHandler(router);
MetadataHandler.registerGetEventsWithBizLocation(router);
MetadataHandler.registerGetVocabulariesWithBizLocation(router);

MetadataHandler.registerGetReadPointsHandler(router);
MetadataHandler.registerGetReadPointQueriesHandler(router);
MetadataHandler.registerGetEventsWithReadPoint(router);
MetadataHandler.registerGetVocabulariesWithReadPoint(router);

MetadataHandler.registerGetDispositionsHandler(router);
MetadataHandler.registerGetDispositionQueriesHandler(router);
MetadataHandler.registerGetEventsWithDisposition(router);

MetadataHandler.registerGetQueriesHandler(router);
MetadataHandler.registerNamedQueryHandler(router);
MetadataHandler.registerGetEventsWithNamedQuery(router);
MetadataHandler.registerGetVocabulariesWithNamedQuery(router);
MetadataHandler.registerGetPostSubscriptions(router);
MetadataHandler.registerGetDeleteSubscription(router);
}

private void registerXMLCaptureServiceHandler(Router router) {
XMLCaptureServiceHandler.registerPostCaptureHandler(router);
XMLCaptureServiceHandler.registerGetCaptureIDHandler(router);
XMLCaptureServiceHandler.registerPostEventsHandler(router);
XMLCaptureServiceHandler.registerGetCaptureHandler(router);
}

private void registerJSONCaptureServiceHandler(Router router) {
JSONCaptureServiceHandler.registerPostCaptureHandler(router);
JSONCaptureServiceHandler.registerGetCaptureIDHandler(router);
JSONCaptureServiceHandler.registerPostEventsHandler(router);
JSONCaptureServiceHandler.registerGetCaptureHandler(router);
}

private void registerSOAPQueryServiceHandler(Router router) {
SOAPQueryServiceHandler.registerQueryHandler(router);
}

public void registerRESTQueryServiceHandler(Router router) {
RESTQueryServiceHandler.registerGetEventsHandler(router);
RESTQueryServiceHandler.registerGetVocabulariesHandler(router);
RESTQueryServiceHandler.registerGetEventHandler(router);
RESTQueryServiceHandler.registerGetVocabularyHandler(router);

RESTQueryServiceHandler.registerGetEventTypes(router);
RESTQueryServiceHandler.registerGetEPCs(router);
RESTQueryServiceHandler.registerGetBizSteps(router);
RESTQueryServiceHandler.registerGetBizLocations(router);
RESTQueryServiceHandler.registerGetReadPoints(router);
RESTQueryServiceHandler.registerGetDispositions(router);

RESTQueryServiceHandler.registerGetEventTypeQueries(router);
RESTQueryServiceHandler.registerGetEPCQueries(router);
RESTQueryServiceHandler.registerGetBizStepQueries(router);
RESTQueryServiceHandler.registerGetBizLocationQueries(router);
RESTQueryServiceHandler.registerGetReadPointQueries(router);
RESTQueryServiceHandler.registerGetDispositionQueries(router);

RESTQueryServiceHandler.registerGetEventsWithEventTypeHandler(router);
RESTQueryServiceHandler.registerGetEventsWithEPCHandler(router);
RESTQueryServiceHandler.registerGetEventsWithBizStepHandler(router);
RESTQueryServiceHandler.registerGetEventsWithBizLocationHandler(router);
RESTQueryServiceHandler.registerGetEventsWithReadPointHandler(router);
RESTQueryServiceHandler.registerGetEventsWithDispositionHandler(router);

RESTQueryServiceHandler.registerGetVocabulariesWithEPCHandler(router);
RESTQueryServiceHandler.registerGetVocabulariesWithBizLocationHandler(router);
RESTQueryServiceHandler.registerGetVocabulariesWithReadPointHandler(router);

RESTQueryServiceHandler.registerPostQueryHandler(router);
RESTQueryServiceHandler.registerGetQueryHandler(router);
RESTQueryServiceHandler.registerDeleteQueryHandler(router);
RESTQueryServiceHandler.registerGetQueriesHandler(router);
RESTQueryServiceHandler.registerGetEventsWithNamedQueryHandler(router);
RESTQueryServiceHandler.registerGetVocabulariesWithNamedQueryHandler(router);

RESTQueryServiceHandler.registerPostSubscriptionHandler(router);
RESTQueryServiceHandler.registerDeleteSubscriptionHandler(router);
RESTQueryServiceHandler.registerGetSubscriptionsHandler(router);
}

private void setRouter(Router router) {
router.route()
.handler(CorsHandler.create().addOrigin("*").allowedHeader("Content-Type")
.allowedHeader("Access-Control-Allow-Credentials").allowedHeader("GS1-EPCIS-Version")
.allowedHeader("GS1-CBV-Version").allowedHeader("GS1-EPCIS-Max").allowedHeader("GS1-EPCIS-Min")
.allowedHeader("GS1-CBV-Max").allowedHeader("GS1-CBV-Min").allowedHeader("GS1-EPC-Format")
.allowedHeader("GS1-CBV-XML-Format").allowedHeader("GS1-EPCIS-Capture-Error-Behaviour")
.allowedHeader("Access-Control-Allow-Origin").allowedHeader("Access-Control-Allow-Headers")
.allowedHeader("Access-Control-Expose-Headers").allowedHeader("Access-Control-Request-Method")
.allowedMethod(HttpMethod.GET).allowedMethod(HttpMethod.POST).allowedMethod(HttpMethod.OPTIONS)
.allowedMethod(HttpMethod.DELETE))
.handler(BodyHandler.create());
}

public static void main(String[] args) {
Vertx vertx = Vertx.vertx();
vertx.deployVerticle(new EPCISServer());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package org.oliot.epcis.server.handler;

import io.vertx.ext.web.Router;

/**
* Copyright (C) 2020-2024. (Jaewook Byun) all rights reserved.
* <p>
* This project is an open source implementation of Electronic Product Code
* Information Service (EPCIS) v2.0,
*
* @author Jaewook Byun, Ph.D., Assistant Professor, Sejong University,
* jwbyun@sejong.ac.kr, Associate Director, Auto-ID Labs, Korea,
* bjw0829@gmail.com
*/
public class JSONCaptureServiceHandler {

public static void registerPostCaptureHandler(Router router) {
router.post("/epcis/capture").consumes("application/json").handler(routingContext -> {

});
}

public static void registerGetCaptureIDHandler(Router router) {
router.get("/epcis/capture/:captureID").consumes("application/json").handler(routingContext -> {

});
}

public static void registerPostEventsHandler(Router router) {
router.post("/epcis/events").consumes("application/json").blockingHandler(routingContext -> {

});
}

public static void registerGetCaptureHandler(Router router) {
router.get("/epcis/capture").consumes("application/json").handler(routingContext -> {

});
}
}
Loading

0 comments on commit 18172e6

Please sign in to comment.