corba连接华为M2000告警系统问题

天鹰之翼 发布于 2015/06/10 15:21
阅读 499
收藏 0
各位大侠:
    大家好。老大让写个客户端,来调用华为M2000告警系统获取告警信息,由于第一次接触这个,再加上文档不全,只能从网上收集相关的资料,网上这方面的信息实在太少了,好不容易找到这么点,接下来不知道应该怎么获取,请了解这方面的大侠指点一下,不胜感激了。。
 
public void testCorba(String[] args){
		try {
			Properties prop = System.getProperties();
			prop.put("org.omg.CORBA.ORBClass", "org.jacorb.orb.ORB");
            prop.put("org.omg.CORBA.ORBSingletonClass", "org.jacorb.orb.ORBSingleton");
            prop.put("org.omg.PortableInterceptor.ORBInitializerClass.bidir_init", "org.jacorb.orb.giop.BiDirConnectionInitializer");
 
            orb = ORB.init(args, prop);
			log("初始化ORB对象成功");
		}catch (Exception e) {
			e.printStackTrace();
		}
		
		String ior = "";
		try {
			LineNumberReader input = new LineNumberReader(new FileReader("src/1.ior"));
			ior = input.readLine();
		} catch (FileNotFoundException e1) {
			e1.printStackTrace();
		} catch (IOException e1) {
			e1.printStackTrace();
		}
		
		Object obj = orb.string_to_object(ior);
		
		//接入口模块
		String epirpVersion="";
        EPIRP epirp= EPIRPHelper.narrow(obj);
        String[] epirpVersions = {};
		try {
			epirpVersions = epirp.get_EP_IRP_versions();//获取版本
		} catch (GetEPIRPVersions e2) {
			e2.printStackTrace();
		}
        
        log("EPIRP的版本信息:");
        for (String str:epirpVersions) {
            log("EPIRP Version:    "+str);
            if (null!=str && !"".equals(str.trim())){
                epirpVersion=str;
                log("最终版本为:    "+str);
            }
        }
        
        log("管理域控制对象概述信息列表:");
        SupportedIRPListTypeHolder supportedIrpList=new SupportedIRPListTypeHolder();
        try {
			if("OK".equals(epirp.get_IRP_outline(epirpVersion, supportedIrpList))){
			    SupportedIRPListTypeElement[] typeHolder=supportedIrpList.value;
			    for (SupportedIRPListTypeElement irpListEle:typeHolder){
			        String dnType=irpListEle.systemDN;

			        log("dnType:    "+dnType.length());
			        for (IRPElement irpElement : irpListEle.irpList) {
			             
			            System.out.println("========================================");
			            System.out.println("irpId:    " + irpElement.irpId);
			            System.out.println("irpManagementScope: ");
			            for (String s : irpElement.irpManagementScope.value()) {
			                System.out.println("  =="+s);
			            }    
			        }
			    }
			}else{
			    log("获取管理域控制对象概述信息列表失败");
			}
		} catch (GetIRPOutline e1) {
			e1.printStackTrace();
		} catch (InvalidIRPVersion e1) {
			e1.printStackTrace();
		}
}


加载中
返回顶部
顶部