mirror of
https://gitee.com/BDWare/cp.git
synced 2025-01-10 01:44:08 +00:00
prune old doi logic
This commit is contained in:
parent
2514980e8b
commit
841f567a88
@ -48,7 +48,7 @@ dependencies {
|
|||||||
implementation 'com.sun.mail:javax.mail:1.6.2'
|
implementation 'com.sun.mail:javax.mail:1.6.2'
|
||||||
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
|
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
|
||||||
implementation 'org.bdware.bdcontract:sdk-java:1.0.2'
|
implementation 'org.bdware.bdcontract:sdk-java:1.0.2'
|
||||||
implementation 'org.bdware.doip:doip-audit-tool:1.1.9'
|
implementation 'org.bdware.doip:doip-audit-tool:1.2.0'
|
||||||
implementation 'org.bdware.doip:doip-sdk:1.3.8'
|
implementation 'org.bdware.doip:doip-sdk:1.3.8'
|
||||||
implementation fileTree(dir: 'lib', include: '*.jar')
|
implementation fileTree(dir: 'lib', include: '*.jar')
|
||||||
testImplementation 'junit:junit:4.13.2'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
@ -67,8 +67,8 @@ jar {
|
|||||||
// uncomment this when publish,
|
// uncomment this when publish,
|
||||||
// while develop at local use "false"
|
// while develop at local use "false"
|
||||||
configurations.runtimeClasspath.filter {
|
configurations.runtimeClasspath.filter {
|
||||||
it.getAbsolutePath().contains("/lib/")
|
//it.getAbsolutePath().contains("/lib/")
|
||||||
// false
|
false
|
||||||
}.collect {
|
}.collect {
|
||||||
it.isDirectory() ? it : zipTree(it)
|
it.isDirectory() ? it : zipTree(it)
|
||||||
}
|
}
|
||||||
|
@ -718,11 +718,6 @@ public class ContractProcess {
|
|||||||
onStartingDoipServer.setArg(arg);
|
onStartingDoipServer.setArg(arg);
|
||||||
LOGGER.debug("invoke onStartingDoipServer, param:" + onStartingDoipServer.getArg().toString());
|
LOGGER.debug("invoke onStartingDoipServer, param:" + onStartingDoipServer.getArg().toString());
|
||||||
onStartingDoipServer.setRequester(contract.getOwner());
|
onStartingDoipServer.setRequester(contract.getOwner());
|
||||||
if (contract.getDoipFlag() && null != contract.getDOI() && !contract.getDOI().isEmpty()) {
|
|
||||||
onStartingDoipServer.setRequesterDOI(contract.getDOI());
|
|
||||||
} else {
|
|
||||||
onStartingDoipServer.setRequesterDOI("empty");
|
|
||||||
}
|
|
||||||
FunctionNode funNode = cn.getFunction("onServerStart");
|
FunctionNode funNode = cn.getFunction("onServerStart");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -735,6 +730,7 @@ public class ContractProcess {
|
|||||||
LOGGER.info("Fetch the onStartingDoipServerRes from router successfully, the result is " + onStartingDoipServerRes);
|
LOGGER.info("Fetch the onStartingDoipServerRes from router successfully, the result is " + onStartingDoipServerRes);
|
||||||
int doipListenPort = DoipClusterServer.startDoipServer(startPort);
|
int doipListenPort = DoipClusterServer.startDoipServer(startPort);
|
||||||
returnValue.addProperty("doipListenPort", doipListenPort);
|
returnValue.addProperty("doipListenPort", doipListenPort);
|
||||||
|
this.contract.setDoipPort(doipListenPort);
|
||||||
returnValue.addProperty("doipStartPort", startPort);
|
returnValue.addProperty("doipStartPort", startPort);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("DoipLocalSingleton cannot starts properly, plz check the onServerStart function");
|
LOGGER.error("DoipLocalSingleton cannot starts properly, plz check the onServerStart function");
|
||||||
@ -800,9 +796,6 @@ public class ContractProcess {
|
|||||||
}
|
}
|
||||||
|
|
||||||
JavaScriptEntry.setSM2KeyPair(contract.getPublicKey(), contract.getKey());
|
JavaScriptEntry.setSM2KeyPair(contract.getPublicKey(), contract.getKey());
|
||||||
if (null != contract.getDOI() && !contract.getDOI().isEmpty()) {
|
|
||||||
JavaScriptEntry.doi = contract.getDOI();
|
|
||||||
}
|
|
||||||
if (null != contract.getAuthInfoPersistDOI()
|
if (null != contract.getAuthInfoPersistDOI()
|
||||||
&& !contract.getAuthInfoPersistDOI().isEmpty()) {
|
&& !contract.getAuthInfoPersistDOI().isEmpty()) {
|
||||||
JavaScriptEntry.authInfoPersistDOI = contract.getAuthInfoPersistDOI();
|
JavaScriptEntry.authInfoPersistDOI = contract.getAuthInfoPersistDOI();
|
||||||
@ -819,11 +812,6 @@ public class ContractProcess {
|
|||||||
onCreate.setArg(arg);
|
onCreate.setArg(arg);
|
||||||
LOGGER.debug("invoke onCreate, param:" + onCreate.getArg().toString());
|
LOGGER.debug("invoke onCreate, param:" + onCreate.getArg().toString());
|
||||||
onCreate.setRequester(contract.getOwner());
|
onCreate.setRequester(contract.getOwner());
|
||||||
if (contract.getDoipFlag() && null != contract.getDOI() && !contract.getDOI().isEmpty()) {
|
|
||||||
onCreate.setRequesterDOI(contract.getDOI());
|
|
||||||
} else {
|
|
||||||
onCreate.setRequesterDOI("empty");
|
|
||||||
}
|
|
||||||
FunctionNode funNode = cn.getFunction("onCreate");
|
FunctionNode funNode = cn.getFunction("onCreate");
|
||||||
return invoke(onCreate, funNode);
|
return invoke(onCreate, funNode);
|
||||||
}
|
}
|
||||||
@ -841,13 +829,6 @@ public class ContractProcess {
|
|||||||
else
|
else
|
||||||
onRecover.setArg(arg);
|
onRecover.setArg(arg);
|
||||||
onRecover.setRequester(contract.getOwner());
|
onRecover.setRequester(contract.getOwner());
|
||||||
if (contract.getDoipFlag()
|
|
||||||
&& (contract.getDOI() != null)
|
|
||||||
&& (contract.getDOI().length() > 0)) {
|
|
||||||
onRecover.setRequesterDOI(contract.getDOI());
|
|
||||||
} else {
|
|
||||||
onRecover.setRequesterDOI("empty");
|
|
||||||
}
|
|
||||||
FunctionNode funNode = cn.getFunction("onRecover");
|
FunctionNode funNode = cn.getFunction("onRecover");
|
||||||
return invoke(onRecover, funNode);
|
return invoke(onRecover, funNode);
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,6 @@ public class JavaScriptEntry {
|
|||||||
// public static int contractManagerPort;
|
// public static int contractManagerPort;
|
||||||
public static Random random;
|
public static Random random;
|
||||||
public static long invokeID;
|
public static long invokeID;
|
||||||
public static String doi;
|
|
||||||
public static String authInfoPersistDOI;
|
public static String authInfoPersistDOI;
|
||||||
public static SocketGet get; // public static CloseableHttpClient httpClient = getHttpClient();
|
public static SocketGet get; // public static CloseableHttpClient httpClient = getHttpClient();
|
||||||
public static int numOfCopies;
|
public static int numOfCopies;
|
||||||
@ -180,7 +179,6 @@ public class JavaScriptEntry {
|
|||||||
if (!app.verifySignature()) {
|
if (!app.verifySignature()) {
|
||||||
return "{\"status\":\"Exception\",\"data\":\"invalid signature\"}";
|
return "{\"status\":\"Exception\",\"data\":\"invalid signature\"}";
|
||||||
}
|
}
|
||||||
app.setRequesterDOI(doi);
|
|
||||||
app.setFromDebug(isDebug);
|
app.setFromDebug(isDebug);
|
||||||
if (numOfCopies > 1) {
|
if (numOfCopies > 1) {
|
||||||
// The caller is special.
|
// The caller is special.
|
||||||
@ -237,7 +235,6 @@ public class JavaScriptEntry {
|
|||||||
ContractRequest app = new ContractRequest();
|
ContractRequest app = new ContractRequest();
|
||||||
app.setContractID(contractID).setAction(action).setArg(JSONTool.convertMirrorToJson(arg));
|
app.setContractID(contractID).setAction(action).setArg(JSONTool.convertMirrorToJson(arg));
|
||||||
app.doSignature(keyPair);
|
app.doSignature(keyPair);
|
||||||
app.setRequesterDOI(doi);
|
|
||||||
app.setFromDebug(isDebug);
|
app.setFromDebug(isDebug);
|
||||||
ContractExecType type = ContractProcess.instance.getContract().getType();
|
ContractExecType type = ContractProcess.instance.getContract().getType();
|
||||||
if (type.needSeq()) {
|
if (type.needSeq()) {
|
||||||
@ -323,7 +320,6 @@ public class JavaScriptEntry {
|
|||||||
app.setContractID(contractID).setAction(action).setArg(arg);
|
app.setContractID(contractID).setAction(action).setArg(arg);
|
||||||
app.doSignature(keyPair);
|
app.doSignature(keyPair);
|
||||||
app.setRequestID((invokeID++) + "_" + random());
|
app.setRequestID((invokeID++) + "_" + random());
|
||||||
app.setRequesterDOI(doi);
|
|
||||||
get.asyncGet(
|
get.asyncGet(
|
||||||
"dd",
|
"dd",
|
||||||
"executeContract",
|
"executeContract",
|
||||||
|
@ -93,7 +93,6 @@ public class AsyncUtil {
|
|||||||
app.setContractID(contractID).setAction(action).setArg(arg);
|
app.setContractID(contractID).setAction(action).setArg(arg);
|
||||||
app.doSignature(JavaScriptEntry.getKeyPair());
|
app.doSignature(JavaScriptEntry.getKeyPair());
|
||||||
app.setRequestID((JavaScriptEntry.invokeID++) + "_" + JavaScriptEntry.random());
|
app.setRequestID((JavaScriptEntry.invokeID++) + "_" + JavaScriptEntry.random());
|
||||||
app.setRequesterDOI(JavaScriptEntry.doi);
|
|
||||||
JavaScriptEntry.get.asyncGet(
|
JavaScriptEntry.get.asyncGet(
|
||||||
"dd",
|
"dd",
|
||||||
"executeContract",
|
"executeContract",
|
||||||
|
Loading…
Reference in New Issue
Block a user