use of org.opennms.netmgt.collection.persistence.rrd.RrdPersisterFactory in project opennms by OpenNMS.
the class CollectorTestUtils method persistCollectionSet.
public static void persistCollectionSet(RrdStrategy<?, ?> rrdStrategy, ResourceStorageDao resourceStorageDao, CollectionSpecification spec, CollectionSet collectionSet) {
RrdRepository repository = spec.getRrdRepository("default");
System.err.println("repository = " + repository);
ServiceParameters params = spec.getServiceParameters();
System.err.println("service parameters = " + params);
RrdPersisterFactory persisterFactory = new RrdPersisterFactory();
persisterFactory.setRrdStrategy(rrdStrategy);
persisterFactory.setResourceStorageDao(resourceStorageDao);
CollectionSetVisitor persister = persisterFactory.createPersister(params, repository);
System.err.println("persister = " + persister);
collectionSet.visit(persister);
}
use of org.opennms.netmgt.collection.persistence.rrd.RrdPersisterFactory in project opennms by OpenNMS.
the class CollectorTestUtils method persistCollectionSet.
public static void persistCollectionSet(RrdStrategy<?, ?> rrdStrategy, ResourceStorageDao resourceStorageDao, CollectionSpecification spec, CollectionSet collectionSet) {
RrdRepository repository = spec.getRrdRepository("default");
System.err.println("repository = " + repository);
ServiceParameters params = spec.getServiceParameters();
System.err.println("service parameters = " + params);
RrdPersisterFactory persisterFactory = new RrdPersisterFactory();
persisterFactory.setRrdStrategy(rrdStrategy);
persisterFactory.setResourceStorageDao(resourceStorageDao);
CollectionSetVisitor persister = persisterFactory.createPersister(params, repository);
System.err.println("persister = " + persister);
collectionSet.visit(persister);
}
use of org.opennms.netmgt.collection.persistence.rrd.RrdPersisterFactory in project opennms by OpenNMS.
the class NMS7963IT method setUp.
/**
* Sets the up.
*
* @throws Exception the exception
*/
@Before
public void setUp() throws Exception {
MockLogAppender.setupLogging();
DefaultDataCollectionConfigDao dao = new DefaultDataCollectionConfigDao();
dao.setConfigDirectory("src/test/resources/etc/datacollection");
dao.setConfigResource(new FileSystemResource("src/test/resources/etc/datacollection-config.xml"));
dao.afterPropertiesSet();
DataCollectionConfigFactory.setInstance(dao);
m_rrdStrategy = new JRobinRrdStrategy();
m_resourceStorageDao = new FilesystemResourceStorageDao();
m_resourceStorageDao.setRrdDirectory(m_temporaryFolder.getRoot());
m_temporaryFolder.newFolder("snmp");
m_persisterFactory = new RrdPersisterFactory();
m_persisterFactory.setResourceStorageDao(m_resourceStorageDao);
m_persisterFactory.setRrdStrategy(m_rrdStrategy);
m_collectionAgent = new MockCollectionAgent(1, "mynode.local", InetAddrUtils.addr("127.0.0.1"));
m_nodeDao = EasyMock.createMock(NodeDao.class);
OnmsNode node = new OnmsNode();
node.setId(1);
node.setLabel("mynode.local");
node.setAssetRecord(new OnmsAssetRecord());
EasyMock.expect(m_nodeDao.get(1)).andReturn(node).anyTimes();
EasyMock.replay(m_nodeDao);
}
use of org.opennms.netmgt.collection.persistence.rrd.RrdPersisterFactory in project opennms by OpenNMS.
the class XmlCollectorITCase method initializeRrdStrategy.
/**
* Initialize RRD strategy.
*
* @throws Exception the exception
*/
protected void initializeRrdStrategy() throws Exception {
m_rrdStrategy = new JRobinRrdStrategy();
m_resourceStorageDao = new FilesystemResourceStorageDao();
m_resourceStorageDao.setRrdDirectory(m_temporaryFolder.getRoot());
m_temporaryFolder.newFolder("snmp");
m_persisterFactory = new RrdPersisterFactory();
m_persisterFactory.setResourceStorageDao(m_resourceStorageDao);
m_persisterFactory.setRrdStrategy(m_rrdStrategy);
}
use of org.opennms.netmgt.collection.persistence.rrd.RrdPersisterFactory in project opennms by OpenNMS.
the class LatencyStoringServiceMonitorAdaptorPersistenceTest method setUp.
@Before
@SuppressWarnings("unchecked")
public void setUp() throws Exception {
MockLogAppender.setupLogging();
m_resourceStorageDao = new FilesystemResourceStorageDao();
m_resourceStorageDao.setRrdDirectory(m_tempFolder.newFolder("response"));
m_persisterFactory = new RrdPersisterFactory();
m_persisterFactory.setResourceStorageDao(m_resourceStorageDao);
m_rrdStrategy = EasyMock.createMock(RrdStrategy.class);
m_persisterFactory.setRrdStrategy(m_rrdStrategy);
}
Aggregations