diff --git a/src/main/java/org/bdware/server/doip/ContractRepositoryHandler.java b/src/main/java/org/bdware/server/doip/ContractRepositoryHandler.java index 62f7ddd..36857e5 100644 --- a/src/main/java/org/bdware/server/doip/ContractRepositoryHandler.java +++ b/src/main/java/org/bdware/server/doip/ContractRepositoryHandler.java @@ -5,12 +5,12 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; import io.netty.channel.ChannelHandler; -import org.bdware.doip.core.doipMessage.DoipMessage; -import org.bdware.doip.core.doipMessage.DoipResponseCode; -import org.bdware.doip.core.model.digitalObject.DigitalObject; -import org.bdware.doip.core.model.digitalObject.DoType; -import org.bdware.doip.core.model.digitalObject.Element; -import org.bdware.doip.core.model.operations.BasicOperations; +import org.bdware.doip.codec.digitalObject.DigitalObject; +import org.bdware.doip.codec.digitalObject.DoType; +import org.bdware.doip.codec.digitalObject.Element; +import org.bdware.doip.codec.doipMessage.DoipMessage; +import org.bdware.doip.codec.doipMessage.DoipResponseCode; +import org.bdware.doip.codec.operations.BasicOperations; import org.bdware.doip.endpoint.doipServer.DoipServiceInfo; import org.bdware.doip.endpoint.doipServer.Op; import org.bdware.doip.endpoint.doipServer.RepositoryHandlerBase; @@ -66,7 +66,7 @@ public class ContractRepositoryHandler extends RepositoryHandlerBase { client = CMActions.manager.getContractClientByDoi(doipMessage.header.parameters.id); } catch (Exception e) { } - if (client == null) { + if (client == null) { String doid = doipMessage.header.parameters.id; int off = doid.lastIndexOf("/"); if (off > 0) diff --git a/src/main/java/org/bdware/server/doip/ContractRepositoryMain.java b/src/main/java/org/bdware/server/doip/ContractRepositoryMain.java index a73083a..7ab0561 100644 --- a/src/main/java/org/bdware/server/doip/ContractRepositoryMain.java +++ b/src/main/java/org/bdware/server/doip/ContractRepositoryMain.java @@ -1,11 +1,7 @@ package org.bdware.server.doip; -import com.nimbusds.jose.jwk.JWK; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.bdware.doip.core.crypto.GlobalCertifications; -import org.bdware.doip.core.doipMessage.DoipMessageFormat; -import org.bdware.doip.core.utils.GlobalConfigurations; import org.bdware.doip.endpoint.doipServer.DoipListenerInfo; import org.bdware.doip.endpoint.doipServer.DoipServerImpl; import org.bdware.doip.endpoint.doipServer.DoipServiceInfo; @@ -34,10 +30,8 @@ public class ContractRepositoryMain { } List infos = new ArrayList<>(); - infos.add(new DoipListenerInfo(url, "2.1", DoipMessageFormat.PACKET)); - GlobalCertifications.jwKeyPair = JWK.parse("{\"kty\":\"EC\",\"d\":\"wMrGJjk877bKQ_AAvdb8DM1XpUFo6POSLYDXid6AfBw\",\"use\":\"sig\",\"crv\":\"P-256\",\"kid\":\"AIBD\\/dou.ADMIN\",\"x\":\"N0TydMwdnvkyHrXVh1zfc9_7DV6tRqfCGElhywzXJYo\",\"y\":\"rX5pGGML9efP2r8hoMSwxaR9gwVHmqaldsG-yfE_eUI\"}"); - GlobalConfigurations.userID = GlobalCertifications.jwKeyPair.getKeyID(); - DoipServiceInfo info = new DoipServiceInfo(doid, GlobalConfigurations.userID, "ContractRepo", infos); + infos.add(new DoipListenerInfo(url, "2.1")); + DoipServiceInfo info = new DoipServiceInfo(doid, "bdware.trust/Admin", "ContractRepo", infos); currentServer = new DoipServerImpl(info); currentServer.setRepositoryHandler(new ContractRepositoryHandler(info)); currentServer.start();