REM:
1. 调试修改检测对象接口
2. 对应修改检测对象名、检测IP、IP类型和清洗类型
   出参为状态码和结果描述
This commit is contained in:
chenlinghy 2020-03-25 09:25:26 +08:00
parent 48b6ec0e50
commit c588e25344
2 changed files with 93 additions and 0 deletions

View File

@ -0,0 +1,48 @@
package com.cmcc.hy.phoenix.dptech;
public class TestaddDetectionObjectForUMC {
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网段添加指定名称的检测对象
detectionDevices检测设备列表
cleaningDevices清洗设备列表
detectionName检测对象名称
ipSegment检测IP段
ipType:IP类型v4:0v6:1
cleaningType:清洗类型Probe自动3Probe手动4第三方自动1第三方手动2
*/
AbnormalFlowCleaningServiceStub.AddDetectionObjectForUMC AddDO = new AbnormalFlowCleaningServiceStub.AddDetectionObjectForUMC();
AddDO.setDetectionDevices("192.168.1.1");
AddDO.setCleaningDevices("10.88.76.41");
AddDO.setDetectionName("4");
AddDO.setIpSegment("10.88.78.20-10.88.78.22");
AddDO.setIpType(0);
AddDO.setCleaningType(3);
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
resultReVal返回状态码
ResultInfo请求执行结果描述
*/
AbnormalFlowCleaningServiceStub.AddDetectionObjectForUMCResponse AddDOresp = stub.addDetectionObjectForUMC(AddDO);
System.out.println("ResultInfo: " + AddDOresp.localOut.getResultInfo());
System.out.println("resultReVal: " + AddDOresp.localOut.getResultRetVal());
} catch (org.apache.axis2.AxisFault ex) {
System.out.println(ex.toString());
} catch (java.rmi.RemoteException ex2) {
System.out.println(ex2.toString());
}
}
}

View File

@ -0,0 +1,45 @@
package com.cmcc.hy.phoenix.dptech;
public class TestmodifyDetectionObjectForUMC {
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段更新为新的检测IP网段
detectionName检测对象名称
ipSegment检测IP段
ipType:IP类型v4:0v6:1
cleaningType:清洗类型Probe自动3Probe手动4第三方自动1第三方手动2
*/
AbnormalFlowCleaningServiceStub.ModifyDetectionObjectForUMC ModDO = new AbnormalFlowCleaningServiceStub.ModifyDetectionObjectForUMC();
ModDO.setDetectionName("4");
ModDO.setIpSegment("10.88.78.120-10.88.78.125");
ModDO.setIpType(0);
ModDO.setCleaningType(4);
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
resultReVal返回状态码
ResultInfo请求执行结果描述
*/
AbnormalFlowCleaningServiceStub.ModifyDetectionObjectForUMCResponse ModDOresp = stub.modifyDetectionObjectForUMC(ModDO);
System.out.println("ResultInfo: " + ModDOresp.localOut.getResultInfo());
System.out.println("resultReVal: " + ModDOresp.localOut.getResultRetVal());
} catch (org.apache.axis2.AxisFault ex) {
System.out.println(ex.toString());
} catch (java.rmi.RemoteException ex2) {
System.out.println(ex2.toString());
}
}
}