mirror of
https://gitee.com/BDWare/cp.git
synced 2025-04-28 07:02:15 +00:00
support repoID in doip service
This commit is contained in:
parent
50991a89d0
commit
9e55d56e85
@ -12,8 +12,10 @@ import org.bdware.doip.endpoint.server.DoipServerImpl;
|
|||||||
import org.bdware.doip.endpoint.server.DoipServiceInfo;
|
import org.bdware.doip.endpoint.server.DoipServiceInfo;
|
||||||
import org.bdware.doip.endpoint.server.StartServerCallback;
|
import org.bdware.doip.endpoint.server.StartServerCallback;
|
||||||
import org.bdware.sc.ContractProcess;
|
import org.bdware.sc.ContractProcess;
|
||||||
|
import org.bdware.sc.boundry.JavaScriptEntry;
|
||||||
import org.bdware.sc.crdt.SharableVarManager;
|
import org.bdware.sc.crdt.SharableVarManager;
|
||||||
import org.bdware.sc.handler.DOOPRequestHandler;
|
import org.bdware.sc.handler.DOOPRequestHandler;
|
||||||
|
import org.zz.gmhelper.SM2KeyPair;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -63,13 +65,21 @@ public class DoipLocalSingleton {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
SM2KeyPair keyPair = JavaScriptEntry.getKeyPair();
|
||||||
String repoID = "bdtest/BDRepo/" + UUID.randomUUID().toString();
|
String repoID = "bdtest/BDRepo/" + UUID.randomUUID().toString();
|
||||||
String owner = ContractProcess.instance.getContract().getOwner();
|
String owner = ContractProcess.instance.getContract().getOwner();
|
||||||
String repoType = "Repository";
|
String repoType = "BDO";
|
||||||
EndpointConfig config = null;
|
EndpointConfig config = null;
|
||||||
try {
|
try {
|
||||||
if (otherConfigs != null && otherConfigs.isJsonObject()) {
|
if (otherConfigs != null && otherConfigs.isJsonObject()) {
|
||||||
config = new TempConfigStorage(otherConfigs.toString()).loadAsEndpointConfig();
|
config = new TempConfigStorage(otherConfigs.toString()).loadAsEndpointConfig();
|
||||||
|
if (otherConfigs.getAsJsonObject().has("repoID")) {
|
||||||
|
repoID = otherConfigs.getAsJsonObject().get("repoID").getAsString();
|
||||||
|
}
|
||||||
|
if (config.privateKey == null || config.publicKey == null) {
|
||||||
|
config.privateKey = keyPair.getPrivateKeyStr();
|
||||||
|
config.publicKey = keyPair.getPublicKeyStr();
|
||||||
|
}
|
||||||
if (config.routerURI != null) {
|
if (config.routerURI != null) {
|
||||||
AuditIrpClient irpClient = new AuditIrpClient(config);
|
AuditIrpClient irpClient = new AuditIrpClient(config);
|
||||||
EndpointInfo endpointInfo = irpClient.getEndpointInfo();
|
EndpointInfo endpointInfo = irpClient.getEndpointInfo();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user