本文整理匯總了Java中org.opennms.netmgt.config.poller.PollerConfiguration類的典型用法代碼示例。如果您正苦於以下問題:Java PollerConfiguration類的具體用法?Java PollerConfiguration怎麽用?Java PollerConfiguration使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
PollerConfiguration類屬於org.opennms.netmgt.config.poller包,在下文中一共展示了PollerConfiguration類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: updateServiceCompounds
import org.opennms.netmgt.config.poller.PollerConfiguration; //導入依賴的package包/類
Map<String, ServiceCompound> updateServiceCompounds(Map<String, ServiceCompound> serviceCompounds) throws IOException, MarshalException, ValidationException {
PollerConfiguration pollerConfiguration = readPollerConfiguration();
for (Monitor monitor : pollerConfiguration.getMonitorCollection()) {
if (!serviceCompounds.containsKey(monitor.getService())) {
serviceCompounds.put(monitor.getService(), new ServiceCompound(monitor.getService()));
}
serviceCompounds.get(monitor.getService()).setMonitor(monitor);
}
for (org.opennms.netmgt.config.poller.Package pollerPackage : pollerConfiguration.getPackageCollection()) {
for (Service service : pollerPackage.getServiceCollection()) {
if (!serviceCompounds.containsKey(service.getName())) {
serviceCompounds.put(service.getName(), new ServiceCompound(service.getName()));
}
serviceCompounds.get(service.getName()).setPollerService(service);
}
}
return serviceCompounds;
}
示例2: update
import org.opennms.netmgt.config.poller.PollerConfiguration; //導入依賴的package包/類
/**
* <p>update</p>
*
* @throws java.io.IOException if any.
* @throws org.exolab.castor.xml.MarshalException if any.
* @throws org.exolab.castor.xml.ValidationException if any.
*/
public void update() throws IOException, MarshalException, ValidationException {
getWriteLock().lock();
try {
final File cfgFile = ConfigFileConstants.getFile(ConfigFileConstants.POLLER_CONFIG_FILE_NAME);
if (cfgFile.lastModified() > m_currentVersion) {
m_currentVersion = cfgFile.lastModified();
LogUtils.debugf(this, "init: config file path: %s", cfgFile.getPath());
InputStream stream = null;
try {
stream = new FileInputStream(cfgFile);
m_config = CastorUtils.unmarshal(PollerConfiguration.class, stream);
} finally {
IOUtils.closeQuietly(stream);
}
init();
LogUtils.debugf(this, "init: finished loading config file: %s", cfgFile.getPath());
}
} finally {
getWriteLock().unlock();
}
}
示例3: getConfiguration
import org.opennms.netmgt.config.poller.PollerConfiguration; //導入依賴的package包/類
/**
* Return the poller configuration object.
*
* @return a {@link org.opennms.netmgt.config.poller.PollerConfiguration} object.
*/
@Override
public PollerConfiguration getConfiguration() {
getReadLock().lock();
try {
return m_config;
} finally {
getReadLock().unlock();
}
}
示例4: getConfiguration
import org.opennms.netmgt.config.poller.PollerConfiguration; //導入依賴的package包/類
/**
* Return the poller configuration object.
*
* @return a {@link org.opennms.netmgt.config.poller.PollerConfiguration} object.
*/
public PollerConfiguration getConfiguration() {
getReadLock().lock();
try {
return m_config;
} finally {
getReadLock().unlock();
}
}
示例5: readPollerConfiguration
import org.opennms.netmgt.config.poller.PollerConfiguration; //導入依賴的package包/類
private PollerConfiguration readPollerConfiguration() throws IOException, MarshalException, ValidationException {
PollerConfigFactory.init();
PollerConfigFactory pollerConfigFactory = new PollerConfigFactory(0, new FileInputStream(new File(CONFIG_FOLDER.concat(File.separator + CONFIG_FILE))), "LocalServer?", false);
return pollerConfigFactory.getConfiguration();
}
示例6: testPollerConfiguration
import org.opennms.netmgt.config.poller.PollerConfiguration; //導入依賴的package包/類
@Test
public void testPollerConfiguration() throws Exception {
unmarshal("poller-configuration.xml", PollerConfiguration.class);
}
示例7: testExamplePollerConfiguration
import org.opennms.netmgt.config.poller.PollerConfiguration; //導入依賴的package包/類
@Test
public void testExamplePollerConfiguration() throws Exception {
unmarshalExample("poller-configuration.xml", PollerConfiguration.class);
}
示例8: update
import org.opennms.netmgt.config.poller.PollerConfiguration; //導入依賴的package包/類
@Override
public void update() throws IOException, MarshalException, ValidationException {
m_config = CastorUtils.unmarshal(PollerConfiguration.class, new ByteArrayInputStream(m_xml.getBytes("UTF-8")));
setUpInternalData();
}
示例9: getConfiguration
import org.opennms.netmgt.config.poller.PollerConfiguration; //導入依賴的package包/類
public PollerConfiguration getConfiguration() {
// FIXME: need to actually implement this
return null;
}
示例10: update
import org.opennms.netmgt.config.poller.PollerConfiguration; //導入依賴的package包/類
@SuppressWarnings("deprecation")
public void update() throws IOException, MarshalException, ValidationException {
m_config = CastorUtils.unmarshal(PollerConfiguration.class, new StringReader(m_xml));
setUpInternalData();
}
示例11: getJavaClass
import org.opennms.netmgt.config.poller.PollerConfiguration; //導入依賴的package包/類
/**
* Method getJavaClass.
*
* @return the Java class represented by this descriptor.
*/
@Override()
public java.lang.Class<?> getJavaClass(
) {
return org.opennms.netmgt.config.poller.PollerConfiguration.class;
}
示例12: update
import org.opennms.netmgt.config.poller.PollerConfiguration; //導入依賴的package包/類
public void update() throws IOException, MarshalException, ValidationException {
m_config = CastorUtils.unmarshal(PollerConfiguration.class, new ByteArrayInputStream(m_xml.getBytes("UTF-8")));
setUpInternalData();
}
示例13: PollerConfigManager
import org.opennms.netmgt.config.poller.PollerConfiguration; //導入依賴的package包/類
/**
* <p>Constructor for PollerConfigManager.</p>
*
* @param stream a {@link java.io.InputStream} object.
* @param localServer a {@link java.lang.String} object.
* @param verifyServer a boolean.
* @throws org.exolab.castor.xml.MarshalException if any.
* @throws org.exolab.castor.xml.ValidationException if any.
*/
public PollerConfigManager(final InputStream stream, final String localServer, final boolean verifyServer) throws MarshalException, ValidationException {
m_localServer = localServer;
m_verifyServer = verifyServer;
m_config = CastorUtils.unmarshal(PollerConfiguration.class, stream);
setUpInternalData();
}
示例14: getConfiguration
import org.opennms.netmgt.config.poller.PollerConfiguration; //導入依賴的package包/類
/**
* <p>getConfiguration</p>
*
* @return a {@link org.opennms.netmgt.config.poller.PollerConfiguration} object.
*/
PollerConfiguration getConfiguration();
示例15: getConfiguration
import org.opennms.netmgt.config.poller.PollerConfiguration; //導入依賴的package包/類
/**
* <p>getConfiguration</p>
*
* @return a {@link org.opennms.netmgt.config.poller.PollerConfiguration} object.
*/
public abstract PollerConfiguration getConfiguration();