• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java MibLoader类的典型用法和代码示例

java 9次浏览

本文整理汇总了Java中net.percederberg.mibble.MibLoader的典型用法代码示例。如果您正苦于以下问题:Java MibLoader类的具体用法?Java MibLoader怎么用?Java MibLoader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

MibLoader类属于net.percederberg.mibble包,在下文中一共展示了MibLoader类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: convert

点赞 3

import net.percederberg.mibble.MibLoader; //导入依赖的package包/类
public void convert() throws IOException, MibLoaderException {
    m_loader = new MibLoader();

    URL url;
    try {
        url = new URL(m_mibLocation);
    } catch (MalformedURLException e) {
        url = null;
    }

    if (url == null) {
        File file = new File(m_mibLocation);
        m_loader.addDir(file.getParentFile());
        m_mib = m_loader.load(file);
    } else {
        m_mib = m_loader.load(url);
    }
}
 

开发者ID:qoswork,
项目名称:opennmszh,
代码行数:19,
代码来源:Mib2Events.java

示例2: loadTrapMib

点赞 2

import net.percederberg.mibble.MibLoader; //导入依赖的package包/类
private static Mib loadTrapMib() throws IOException, MibLoaderException {
  MibLoader loader = new MibLoader();
  loader.load(SMI_DEFINITIONS);
  URL url = MibbleTrapV1Support.class.getResource(TRAP_DEFINITIONS);
  if (url == null) {
    throw new FileNotFoundException("cannot find resource " + TRAP_DEFINITIONS);
  }
  return loader.load(url);
}
 

开发者ID:soulwing,
项目名称:tnm4j,
代码行数:10,
代码来源:MibbleTrapV1Support.java

示例3: main

点赞 2

import net.percederberg.mibble.MibLoader; //导入依赖的package包/类
public static void main(String[] args) throws Exception 
{
    File      mibs = new File("./src/mib-compiler/mibs/");
    File iana_mibs = new File(mibs, "iana");
    File ietf_mibs = new File(mibs, "ietf");
    // setup the loader
    MibLoader loader = new MibLoader();
    loader.addDir(iana_mibs);
    loader.addDir(ietf_mibs);
    // compile the IANA mibs
    compilePackage(iana_mibs, loader, "iana");
    // compile the IETF mibs
    compilePackage(ietf_mibs, loader, "ietf");
}
 

开发者ID:intrbiz,
项目名称:SNMP-IB,
代码行数:15,
代码来源:MIBCompiler.java

示例4: compilePackage

点赞 2

import net.percederberg.mibble.MibLoader; //导入依赖的package包/类
private static void compilePackage(File dir, MibLoader loader, String pack) throws Exception
{
    // make package dir
    new File("./src/main/java/com/intrbiz/snmp/mib/defs/" + pack).mkdirs();
    // our index
    MIBIndex idx = new MIBIndex();
    // process the MIBs
    for (File aMib : dir.listFiles())
    {
        System.out.println("Compiling: " + aMib.getAbsolutePath());    
        Mib mib = loader.load(aMib);
        if (mib.getRootSymbol() != null)
        {
            // valid MIBs will have a root symbol
            compileMIB(mib, pack, idx);
        }
    }
    // write the MIB index
    try
    {
        JAXBContext ctx = JAXBContext.newInstance(MIBIndex.class, MIBInfo.class);
        Marshaller m = ctx.createMarshaller();
        m.setProperty(Marshaller.JAXB_FRAGMENT, true);
        m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
        try (FileWriter fw = new FileWriter(new File(new File("./src/main/java/com/intrbiz/snmp/mib/defs/" + pack), "index.xml")))
        {
            m.marshal(idx, fw);
            fw.flush();
        }
    }
    catch (JAXBException e)
    {
        e.printStackTrace();
    }
}
 

开发者ID:intrbiz,
项目名称:SNMP-IB,
代码行数:36,
代码来源:MIBCompiler.java

示例5: setUp

点赞 2

import net.percederberg.mibble.MibLoader; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  MibLoader loader = new MibLoader();
  mib = loader.load("RFC1213-MIB");
}
 

开发者ID:soulwing,
项目名称:tnm4j,
代码行数:6,
代码来源:CachingFormatterFactoryTest.java

示例6: setUp

点赞 2

import net.percederberg.mibble.MibLoader; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  mib = new MibbleMib(repository, formatterFactory, indexExtractorFactory);
  MibLoader loader = new MibLoader();
  delegate = loader.load(Constants.RFC1213_MIB);
}
 

开发者ID:soulwing,
项目名称:tnm4j,
代码行数:7,
代码来源:MibbleMibTest.java

示例7: MibIndex

点赞 2

import net.percederberg.mibble.MibLoader; //导入依赖的package包/类
/**
 * Constructs a new instance.
 */
public MibIndex() {
    loader = new MibLoader();
    loader.addResourceDir(MIB_DIR);
}
 

开发者ID:genman,
项目名称:rhq-plugins,
代码行数:8,
代码来源:MibIndex.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)