private PollerConfiguration getPollerConfiguration() { PollerConfiguration pollconfig = null; try { PollerConfigFactory.init(); PollerConfigFactory.reload(); pollconfig = PollerConfigFactory.getInstance().getConfiguration(); } catch (MarshalException me) { me.printStackTrace(); } catch (ValidationException ve) { ve.printStackTrace(); } catch (IOException ioe) { ioe.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } return pollconfig; }
private void setPollerConfiguration(PollerConfiguration pollconfig) { try { pollconfig.validate(); BufferedWriter bw = new BufferedWriter( new FileWriter( WTProperties.getValue("SNMPConfig.directory") + "poller-configuration.xml")); pollconfig.marshal(bw); bw.flush(); bw.close(); } catch (MarshalException me) { me.printStackTrace(); } catch (ValidationException ve) { ve.printStackTrace(); } catch (IOException ioe) { ioe.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } }