本文整理汇总了Java中org.opennms.netmgt.config.PollerConfigFactory.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java PollerConfigFactory.getInstance方法的具体用法?Java PollerConfigFactory.getInstance怎么用?Java PollerConfigFactory.getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opennms.netmgt.config.PollerConfigFactory
的用法示例。
在下文中一共展示了PollerConfigFactory.getInstance方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSubInterfacesForNewInterface
import org.opennms.netmgt.config.PollerConfigFactory; //导入方法依赖的package包/类
private void getSubInterfacesForNewInterface(Connection dbc,
DbNodeEntry node, InetAddress ifaddr, IfCollector collector,
Date now, int nodeId, int ifIndex) throws SQLException {
if (!collector.hasSnmpCollection()) {
return;
}
CapsdConfig cFactory = CapsdConfigFactory.getInstance();
PollerConfig pollerCfgFactory = PollerConfigFactory.getInstance();
IfSnmpCollector snmpc = collector.getSnmpCollector();
// Made it this far...lets add the IP sub-interfaces
addSubIpInterfaces(dbc, node, collector, now, nodeId, cFactory, pollerCfgFactory,
snmpc);
}
示例2: initPollerConfigFactory
import org.opennms.netmgt.config.PollerConfigFactory; //导入方法依赖的package包/类
private void initPollerConfigFactory() throws ServletException {
try {
PollerConfigFactory.init();
} catch (Throwable e) {
throw new ServletException(e);
}
m_pollerFactory = PollerConfigFactory.getInstance();
m_pollerConfig = m_pollerFactory.getConfiguration();
if (m_pollerConfig == null) {
throw new ServletException("Poller Configuration file is empty");
}
}
示例3: init
import org.opennms.netmgt.config.PollerConfigFactory; //导入方法依赖的package包/类
/**
* <p>init</p>
*
* @throws javax.servlet.ServletException if any.
*/
public void init() throws ServletException {
ServletConfig config = this.getServletConfig();
try {
props.load(new FileInputStream(ConfigFileConstants.getFile(ConfigFileConstants.POLLER_CONF_FILE_NAME)));
PollerConfigFactory.init();
pollerFactory = PollerConfigFactory.getInstance();
pollerConfig = pollerFactory.getConfiguration();
if (pollerConfig == null) {
// response.sendRedirect( "error.jsp?error=2");
errorflag = true;
throw new ServletException("Poller Configuration file is empty");
}
CapsdConfigFactory.init();
capsdFactory = CapsdConfigFactory.getInstance();
capsdConfig = capsdFactory.getConfiguration();
if (capsdConfig == null) {
// response.sendRedirect( "error.jsp?error=3");
errorflag = true;
throw new ServletException("Capsd Configuration file is empty");
}
} catch (Throwable e) {
throw new ServletException(e.getMessage());
}
initPollerServices();
initCapsdProtocols();
this.redirectSuccess = config.getInitParameter("redirect.success");
if (this.redirectSuccess == null) {
throw new ServletException("Missing required init parameter: redirect.success");
}
}
示例4: reloadFiles
import org.opennms.netmgt.config.PollerConfigFactory; //导入方法依赖的package包/类
/**
* <p>reloadFiles</p>
*
* @throws javax.servlet.ServletException if any.
*/
public void reloadFiles() throws ServletException {
ServletConfig config = this.getServletConfig();
try {
props.load(new FileInputStream(ConfigFileConstants.getFile(ConfigFileConstants.POLLER_CONF_FILE_NAME)));
PollerConfigFactory.init();
pollerFactory = PollerConfigFactory.getInstance();
pollerConfig = pollerFactory.getConfiguration();
if (pollerConfig == null) {
// response.sendRedirect( "error.jsp?error=2");
errorflag = true;
throw new ServletException("Poller Configuration file is empty");
}
CapsdConfigFactory.init();
capsdFactory = CapsdConfigFactory.getInstance();
capsdConfig = capsdFactory.getConfiguration();
if (capsdConfig == null) {
errorflag = true;
// response.sendRedirect( "error.jsp?error=3");
throw new ServletException("Capsd Configuration file is empty");
}
} catch (Throwable e) {
throw new ServletException(e.getMessage());
}
initPollerServices();
initCapsdProtocols();
this.redirectSuccess = config.getInitParameter("redirect.success");
if (this.redirectSuccess == null) {
throw new ServletException("Missing required init parameter: redirect.success");
}
}
示例5: init
import org.opennms.netmgt.config.PollerConfigFactory; //导入方法依赖的package包/类
/**
* <p>init</p>
*
* @throws javax.servlet.ServletException if any.
*/
public void init() throws ServletException {
ServletConfig config = this.getServletConfig();
try {
props.load(new FileInputStream(ConfigFileConstants.getFile(ConfigFileConstants.POLLER_CONF_FILE_NAME)));
PollerConfigFactory.init();
pollerFactory = PollerConfigFactory.getInstance();
pollerConfig = pollerFactory.getConfiguration();
if (pollerConfig == null) {
throw new ServletException("Poller Configuration file is empty");
}
CapsdConfigFactory.init();
capsdFactory = CapsdConfigFactory.getInstance();
capsdConfig = capsdFactory.getConfiguration();
if (capsdConfig == null) {
throw new ServletException("Poller Configuration file is empty");
}
} catch (Throwable e) {
throw new ServletException(e.getMessage());
}
initPollerServices();
initCapsdProtocols();
this.redirectSuccess = config.getInitParameter("redirect.success");
if (this.redirectSuccess == null) {
throw new ServletException("Missing required init parameter: redirect.success");
}
}
示例6: reloadFiles
import org.opennms.netmgt.config.PollerConfigFactory; //导入方法依赖的package包/类
/**
* <p>reloadFiles</p>
*
* @throws javax.servlet.ServletException if any.
*/
public void reloadFiles() throws ServletException {
ServletConfig config = this.getServletConfig();
try {
props.load(new FileInputStream(ConfigFileConstants.getFile(ConfigFileConstants.POLLER_CONF_FILE_NAME)));
PollerConfigFactory.init();
pollerFactory = PollerConfigFactory.getInstance();
pollerConfig = pollerFactory.getConfiguration();
if (pollerConfig == null) {
throw new ServletException("Poller Configuration file is empty");
}
CapsdConfigFactory.init();
capsdFactory = CapsdConfigFactory.getInstance();
capsdConfig = capsdFactory.getConfiguration();
if (capsdConfig == null) {
throw new ServletException("Poller Configuration file is empty");
}
} catch (Throwable e) {
throw new ServletException(e.getMessage());
}
initPollerServices();
initCapsdProtocols();
this.redirectSuccess = config.getInitParameter("redirect.success");
if (this.redirectSuccess == null) {
throw new ServletException("Missing required init parameter: redirect.success");
}
}
示例7: getPackageForNewInterface
import org.opennms.netmgt.config.PollerConfigFactory; //导入方法依赖的package包/类
private org.opennms.netmgt.config.poller.Package getPackageForNewInterface(
Connection dbc, InetAddress ifaddr, DbIpInterfaceEntry ipIfEntry,
boolean addrUnmanaged) throws SQLException {
if (addrUnmanaged) {
return null;
}
PollerConfig pollerCfgFactory = PollerConfigFactory.getInstance();
org.opennms.netmgt.config.poller.Package ipPkg = null;
/*
* The newly discoveried IP addr is not in the Package IPList Mapping
* yet, so rebuild the list.
*/
pollerCfgFactory.rebuildPackageIpListMap();
boolean ipToBePolled = false;
ipPkg = pollerCfgFactory.getFirstPackageMatch(str(ifaddr));
if (ipPkg != null) {
ipToBePolled = true;
}
if (log().isDebugEnabled()) {
log().debug("addInterfaces: " + ifaddr + " is to be polled = "
+ ipToBePolled);
}
if (!ipToBePolled) {
// update ismanaged to 'N' in ipinterface
ipIfEntry.setManagedState(DbIpInterfaceEntry.STATE_NOT_POLLED);
ipIfEntry.store(dbc);
}
return ipPkg;
}