# Conflicts:
#	pom.xml
#	src/main/java/com/sunyard/SydApiException.java
#	src/main/java/racal/sunyard/main/SydApi4j.java
#	src/test/java/com/sunyard/sydapi/test/TestAllMethods.java
This commit is contained in:
cheney
2022-10-26 17:24:39 +08:00
parent d0ea067870
commit 24161e2ad5
29 changed files with 1806 additions and 3 deletions
@@ -0,0 +1,63 @@
package com.sunyard.pool;
/**
* 到加密机的链接信息
*/
public class HsmLinkInfo {
private String pcIp;
private int iPort;
private int iConnectTimeOut;
private int iDealTimeOut;
public HsmLinkInfo(String pcIp, int iPort, int iConnectTimeOut, int iDealTimeOut) {
this.pcIp = pcIp;
this.iPort = iPort;
this.iConnectTimeOut = iConnectTimeOut;
this.iDealTimeOut = iDealTimeOut;
}
public static HsmLinkInfo[] mutiHsmLinkInfo(String[] pcIpList, int[] iPortList, int iConnectTimeOut, int iAllDealTimeOut) {
if (null == pcIpList &&
null == iPortList &&
pcIpList.length != iPortList.length) {
throw new IllegalArgumentException("入参错误");
}
if ( iAllDealTimeOut < pcIpList.length) {
throw new IllegalArgumentException("入参错误");
}
// 交易时间进行处理
int iDealTimeOut = iAllDealTimeOut / pcIpList.length;
HsmLinkInfo[]hsms = new HsmLinkInfo[ pcIpList.length ];
for ( int i = 0 ; i < pcIpList.length ; i++ ) {
hsms[ i ] = new HsmLinkInfo( pcIpList[i], iPortList[i], iConnectTimeOut, iDealTimeOut );
}
return hsms;
}
public String getPcIp() {
return pcIp;
}
public int getiPort() {
return iPort;
}
public int getiConnectTimeOut() {
return iConnectTimeOut;
}
public int getiDealTimeOut() {
return iDealTimeOut;
}
}