# 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
64 lines
1.5 KiB
Java
64 lines
1.5 KiB
Java
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;
|
|
}
|
|
|
|
}
|