Search in sources :

Example 1 with EnterpriseIdPartition

use of org.opennms.netmgt.xml.eventconf.EnterpriseIdPartition in project opennms by OpenNMS.

the class MockEventConfDao method reload.

@Override
public void reload() throws DataAccessException {
    InputStream is = null;
    InputStreamReader isr = null;
    try {
        is = m_resource.getInputStream();
        isr = new InputStreamReader(is);
        final Reader reader = isr;
        m_events = JaxbUtils.unmarshal(Events.class, reader);
        m_events.loadEventFiles(m_resource);
        m_events.initialize(new EnterpriseIdPartition(), new EventOrdering());
    } catch (final IOException e) {
        throw new DataRetrievalFailureException("Failed to read from " + m_resource.toString(), e);
    } finally {
        IOUtils.closeQuietly(isr);
        IOUtils.closeQuietly(is);
    }
}
Also used : EnterpriseIdPartition(org.opennms.netmgt.xml.eventconf.EnterpriseIdPartition) InputStreamReader(java.io.InputStreamReader) EventOrdering(org.opennms.netmgt.xml.eventconf.EventOrdering) Events(org.opennms.netmgt.xml.eventconf.Events) InputStream(java.io.InputStream) Reader(java.io.Reader) InputStreamReader(java.io.InputStreamReader) IOException(java.io.IOException) DataRetrievalFailureException(org.springframework.dao.DataRetrievalFailureException)

Aggregations

IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 InputStreamReader (java.io.InputStreamReader)1 Reader (java.io.Reader)1 EnterpriseIdPartition (org.opennms.netmgt.xml.eventconf.EnterpriseIdPartition)1 EventOrdering (org.opennms.netmgt.xml.eventconf.EventOrdering)1 Events (org.opennms.netmgt.xml.eventconf.Events)1 DataRetrievalFailureException (org.springframework.dao.DataRetrievalFailureException)1