REM:
1. 调试获取全部旁路手动牵引策略接口
2. 调试添加旁路手动牵引策接口
3. 调试删除旁路手动牵引策接口
4. 调试修改旁路手动牵引策接口
5. 调试启动旁路手动牵引策接口
6. 调试停止旁路手动牵引策接口
This commit is contained in:
chenlinghy 2020-04-01 16:14:27 +08:00
parent e555a9cd08
commit c1d9e74db9
6 changed files with 283 additions and 0 deletions

View File

@ -0,0 +1,49 @@
package com.cmcc.hy.phoenix.dptech;
import java.rmi.RemoteException;
public class TestaddBypassManualTractionStrategyForUMC {
public static void main(String[] args) {
try{
org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator basicAuthentication =
new org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator();
basicAuthentication.setUsername("admin");
basicAuthentication.setPassword("UMCAdministrator");
AbnormalFlowCleaningServiceStub stub = new AbnormalFlowCleaningServiceStub();
/*
添加指定名称防护对象及保护IP段的旁路手动牵引策略配置信息
输入参数
policyName 旁路手动牵引策略名称
protectName 防护对象名称
ipRange 保护IP段临时仅支持单个IP段且仅支持IP-IP形式
*/
AbnormalFlowCleaningServiceStub.AddBypassManualTractionStrategyForUMC addBypass;
addBypass = new AbnormalFlowCleaningServiceStub.AddBypassManualTractionStrategyForUMC();
String policyName = "2";
String protectName = "23";
String ipRange = "192.168.4.2-192.168.4.5";
addBypass.setPolicyName(policyName);
addBypass.setProtectName(protectName);
addBypass.setIpRange(ipRange);
stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE);
stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE, basicAuthentication);
/*
response信息
输出参数
resultRetVal 返回状态码
resultInfo 请求执行结果描述
执行成功NtcRequestResultInfo类的resultRetVal属性值为0
执行失败NtcRequestResultInfo类的resultRetVal属性值为非0可获取resultInfo属性值查看失败提示信息
*/
AbnormalFlowCleaningServiceStub.AddBypassManualTractionStrategyForUMCResponse respaddByss;
respaddByss = stub.addBypassManualTractionStrategyForUMC(addBypass);
System.out.println("ResultInfo: " + respaddByss.localOut.getResultInfo());
System.out.println("resultReVal: " + respaddByss.localOut.getResultRetVal());
} catch (RemoteException ex) {
System.out.println(ex.toString());
}
}
}

View File

@ -0,0 +1,43 @@
package com.cmcc.hy.phoenix.dptech;
import java.rmi.RemoteException;
public class TestdelBypassManualTractionStrategyForUMC {
public static void main(String[] args) {
try{
org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator basicAuthentication =
new org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator();
basicAuthentication.setUsername("admin");
basicAuthentication.setPassword("UMCAdministrator");
AbnormalFlowCleaningServiceStub stub = new AbnormalFlowCleaningServiceStub();
/*
删除指定名称的旁路手动牵引策略
输入参数
policyName 旁路手动牵引策略名称
*/
AbnormalFlowCleaningServiceStub.DelBypassManualTractionStrategyForUMC delBypass;
delBypass = new AbnormalFlowCleaningServiceStub.DelBypassManualTractionStrategyForUMC();
String policyName = "2";
delBypass.setPolicyName(policyName);
stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE);
stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE, basicAuthentication);
/*
response信息
输出参数
resultRetVal 返回状态码
resultInfo 请求执行结果描述
执行成功NtcRequestResultInfo类的resultRetVal属性值为0
执行失败NtcRequestResultInfo类的resultRetVal属性值为非0可获取resultInfo属性值查看失败提示信息
*/
AbnormalFlowCleaningServiceStub.DelBypassManualTractionStrategyForUMCResponse respdelBypass;
respdelBypass = stub.delBypassManualTractionStrategyForUMC(delBypass);
System.out.println("ResultInfo: " + respdelBypass.localOut.getResultInfo());
System.out.println("resultReVal: " + respdelBypass.localOut.getResultRetVal());
} catch (RemoteException ex) {
System.out.println(ex.toString());
}
}
}

View File

@ -0,0 +1,48 @@
package com.cmcc.hy.phoenix.dptech;
import java.rmi.RemoteException;
public class TestgetAllBypassManualTractionStrategyFromUMC {
public static void main(String[] args) {
try{
org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator basicAuthentication =
new org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator();
basicAuthentication.setUsername("admin");
basicAuthentication.setPassword("UMCAdministrator");
AbnormalFlowCleaningServiceStub stub = new AbnormalFlowCleaningServiceStub();
/*
获取UMC已配置的全部旁路手动牵引策略信息
输入参数
*/
AbnormalFlowCleaningServiceStub.GetAllBypassManualTractionStrategyFromUMC getBypass;
getBypass = new AbnormalFlowCleaningServiceStub.GetAllBypassManualTractionStrategyFromUMC();
stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE);
stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE, basicAuthentication);
/*
response
输出参数数组形式
policyName 策略名称
protectName 防护对象名称
ipRange 保护IP段临时仅支持单个IP段且仅支持IP-IP形式
Enabled 是否启动启动true停止false
*/
AbnormalFlowCleaningServiceStub.GetAllBypassManualTractionStrategyFromUMCResponse respallBypass;
respallBypass = stub.getAllBypassManualTractionStrategyFromUMC(getBypass);
try {
for (AbnormalFlowCleaningServiceStub.BypassManualTractionStrategyForService v : respallBypass.localOut.getBypassManualTractionStrategyForService()) {
System.out.println("policyName: " + v.localPolicyName);
System.out.println("protectName: " + v.localProtectName);
System.out.println("ipRange: " + v.localIpRange);
System.out.println("Enabled: " + v.localEnabled);
}
}catch(NullPointerException ex){
System.out.println(ex.toString());
}
} catch (RemoteException ex) {
System.out.println(ex.toString());
}
}
}

View File

@ -0,0 +1,49 @@
package com.cmcc.hy.phoenix.dptech;
import java.rmi.RemoteException;
public class TestmodBypassManualTractionStrategyForUMC {
public static void main(String[] args) {
try{
org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator basicAuthentication =
new org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator();
basicAuthentication.setUsername("admin");
basicAuthentication.setPassword("UMCAdministrator");
AbnormalFlowCleaningServiceStub stub = new AbnormalFlowCleaningServiceStub();
/*
修改指定名称的旁路手动牵引策略配置信息
输入参数
policyName 旁路手动牵引策略名称
protectName 防护对象名称
ipRange 保护IP段临时仅支持单个IP段且仅支持IP-IP形式
*/
AbnormalFlowCleaningServiceStub.ModBypassManualTractionStrategyForUMC modBypass;
modBypass = new AbnormalFlowCleaningServiceStub.ModBypassManualTractionStrategyForUMC();
String policyName = "1";
String protectName = "10";
String ipRange = "192.168.3.3-192.168.3.5";
modBypass.setPolicyName(policyName);
modBypass.setProtectName(protectName);
modBypass.setIpRange(ipRange);
stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE);
stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE, basicAuthentication);
/*
response信息
输出参数
resultRetVal 返回状态码
resultInfo 请求执行结果描述
执行成功NtcRequestResultInfo类的resultRetVal属性值为0
执行失败NtcRequestResultInfo类的resultRetVal属性值为非0可获取resultInfo属性值查看失败提示信息
*/
AbnormalFlowCleaningServiceStub.ModBypassManualTractionStrategyForUMCResponse respmodBypass;
respmodBypass = stub.modBypassManualTractionStrategyForUMC(modBypass);
System.out.println("ResultInfo: " + respmodBypass.localOut.getResultInfo());
System.out.println("resultReVal: " + respmodBypass.localOut.getResultRetVal());
} catch (RemoteException ex) {
System.out.println(ex.toString());
}
}
}

View File

@ -0,0 +1,47 @@
package com.cmcc.hy.phoenix.dptech;
import java.rmi.RemoteException;
public class TeststartBypassManualTractionStrategyForUMC {
public static void main(String[] args) {
try{
org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator basicAuthentication =
new org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator();
basicAuthentication.setUsername("admin");
basicAuthentication.setPassword("UMCAdministrator");
AbnormalFlowCleaningServiceStub stub = new AbnormalFlowCleaningServiceStub();
/*
启动指定名称的旁路手动牵引策略启动旁路手动牵引策略UMC将立即启动引流清洗功能
输入参数
policyName 策略名称
cleaningDevices 指定清洗设备列表
1清洗设备需包含在对应防护对象中2如为空串代表默认选择对应防护对象中的全部清洗设备
*/
AbnormalFlowCleaningServiceStub.StartBypassManualTractionStrategyForUMC startBypass;
startBypass = new AbnormalFlowCleaningServiceStub.StartBypassManualTractionStrategyForUMC();
String policyName = "1";
String cleaningDevices = "10.88.76.41";
startBypass.setPolicyName(policyName);
startBypass.setCleaningDevices(cleaningDevices);
stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE);
stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE, basicAuthentication);
/*
response信息
输出参数
resultRetVal 返回状态码
resultInfo 请求执行结果描述
执行成功NtcRequestResultInfo类的resultRetVal属性值为0
执行失败NtcRequestResultInfo类的resultRetVal属性值为非0可获取resultInfo属性值查看失败提示信息
*/
AbnormalFlowCleaningServiceStub.StartBypassManualTractionStrategyForUMCResponse respstartBypass;
respstartBypass = stub.startBypassManualTractionStrategyForUMC(startBypass);
System.out.println("ResultInfo: " + respstartBypass.localOut.getResultInfo());
System.out.println("resultReVal: " + respstartBypass.localOut.getResultRetVal());
} catch (RemoteException ex) {
System.out.println(ex.toString());
}
}
}

View File

@ -0,0 +1,47 @@
package com.cmcc.hy.phoenix.dptech;
import java.rmi.RemoteException;
public class TeststopBypassManualTractionStrategyForUMC {
public static void main(String[] args) {
try{
org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator basicAuthentication =
new org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator();
basicAuthentication.setUsername("admin");
basicAuthentication.setPassword("UMCAdministrator");
AbnormalFlowCleaningServiceStub stub = new AbnormalFlowCleaningServiceStub();
/*
停止指定名称的旁路手动牵引策略启动旁路手动牵引策略UMC将立即启动引流清洗功能
输入参数
policyName 策略名称
cleaningDevices 指定清洗设备列表
1清洗设备需包含在对应防护对象中2如为空串代表默认选择对应防护对象中的全部清洗设备
*/
AbnormalFlowCleaningServiceStub.StopBypassManualTractionStrategyForUMC stopBypass;
stopBypass = new AbnormalFlowCleaningServiceStub.StopBypassManualTractionStrategyForUMC();
String policyName = "1";
String cleaningDevices = "10.88.76.41";
stopBypass.setPolicyName(policyName);
stopBypass.setCleaningDevices(cleaningDevices);
stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE);
stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE, basicAuthentication);
/*
response信息
输出参数
resultRetVal 返回状态码
resultInfo 请求执行结果描述
执行成功NtcRequestResultInfo类的resultRetVal属性值为0
执行失败NtcRequestResultInfo类的resultRetVal属性值为非0可获取resultInfo属性值查看失败提示信息
*/
AbnormalFlowCleaningServiceStub.StopBypassManualTractionStrategyForUMCResponse respstopBypass;
respstopBypass = stub.stopBypassManualTractionStrategyForUMC(stopBypass);
System.out.println("ResultInfo: " + respstopBypass.localOut.getResultInfo());
System.out.println("resultReVal: " + respstopBypass.localOut.getResultRetVal());
} catch (RemoteException ex) {
System.out.println(ex.toString());
}
}
}