use of org.opennms.netmgt.xml.eventconf.Events in project opennms by OpenNMS.
the class SpectrumTrapImporter method main.
public static void main(String[] argv) {
SpectrumTrapImporter importer = new SpectrumTrapImporter();
importer.configureArgs(argv);
try {
importer.afterPropertiesSet();
} catch (Throwable e) {
importer.printHelp("Fatal exception caught at startup: " + e.getMessage());
System.exit(1);
}
Events events = new Events();
try {
events = importer.makeEvents();
} catch (IOException e) {
importer.printHelp("Fatal exception caught at runtime: " + e.getMessage());
}
try {
//events.marshal(importer.getOutputWriter());
StringWriter sw = new StringWriter();
events.marshal(sw);
importer.prettyPrintXML(sw.toString());
} catch (MarshalException e) {
importer.printHelp("Fatal exception while marshaling output: " + e.getMessage());
} catch (ValidationException e) {
importer.printHelp("Fatal exception while validating output: " + e.getMessage());
} catch (IOException e) {
importer.printHelp("Fatal I/O exception: " + e.getMessage(), e);
} catch (SAXException e) {
importer.printHelp("Fatal SAX exception: " + e.getMessage());
} catch (ParserConfigurationException e) {
importer.printHelp("Fatal parser configuration exception: " + e.getMessage());
}
}
Aggregations