diff --git a/src/test/java/com/cmcc/hy/phoenix/dptech/TestaddBypassManualTractionStrategyForUMC.java b/src/test/java/com/cmcc/hy/phoenix/dptech/TestaddBypassManualTractionStrategyForUMC.java new file mode 100644 index 00000000..30308b39 --- /dev/null +++ b/src/test/java/com/cmcc/hy/phoenix/dptech/TestaddBypassManualTractionStrategyForUMC.java @@ -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()); + } + } +} diff --git a/src/test/java/com/cmcc/hy/phoenix/dptech/TestdelBypassManualTractionStrategyForUMC.java b/src/test/java/com/cmcc/hy/phoenix/dptech/TestdelBypassManualTractionStrategyForUMC.java new file mode 100644 index 00000000..cc10b135 --- /dev/null +++ b/src/test/java/com/cmcc/hy/phoenix/dptech/TestdelBypassManualTractionStrategyForUMC.java @@ -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()); + } + } +} diff --git a/src/test/java/com/cmcc/hy/phoenix/dptech/TestgetAllBypassManualTractionStrategyFromUMC.java b/src/test/java/com/cmcc/hy/phoenix/dptech/TestgetAllBypassManualTractionStrategyFromUMC.java new file mode 100644 index 00000000..f2ac2521 --- /dev/null +++ b/src/test/java/com/cmcc/hy/phoenix/dptech/TestgetAllBypassManualTractionStrategyFromUMC.java @@ -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()); + } + } +} diff --git a/src/test/java/com/cmcc/hy/phoenix/dptech/TestmodBypassManualTractionStrategyForUMC.java b/src/test/java/com/cmcc/hy/phoenix/dptech/TestmodBypassManualTractionStrategyForUMC.java new file mode 100644 index 00000000..90a5bc53 --- /dev/null +++ b/src/test/java/com/cmcc/hy/phoenix/dptech/TestmodBypassManualTractionStrategyForUMC.java @@ -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()); + } + } +} diff --git a/src/test/java/com/cmcc/hy/phoenix/dptech/TeststartBypassManualTractionStrategyForUMC.java b/src/test/java/com/cmcc/hy/phoenix/dptech/TeststartBypassManualTractionStrategyForUMC.java new file mode 100644 index 00000000..2e2f2a38 --- /dev/null +++ b/src/test/java/com/cmcc/hy/phoenix/dptech/TeststartBypassManualTractionStrategyForUMC.java @@ -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()); + } + } +} diff --git a/src/test/java/com/cmcc/hy/phoenix/dptech/TeststopBypassManualTractionStrategyForUMC.java b/src/test/java/com/cmcc/hy/phoenix/dptech/TeststopBypassManualTractionStrategyForUMC.java new file mode 100644 index 00000000..3ce734e4 --- /dev/null +++ b/src/test/java/com/cmcc/hy/phoenix/dptech/TeststopBypassManualTractionStrategyForUMC.java @@ -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()); + } + } +}