private void print(StatisticsContainer s) { log.log(Level.DEBUG, s.timeperiod + " " + s.uri + " " + s.action + " " + s.success + " " + s.faults + " " + s.averageresponsetime + " " + s.max_request_size + " " + s.max_response_size + " " + s.max_responsetime + " " + s.mtbf + " " + s.availibity); }
public StatusHelper(String username, String password, org.miloss.fgsms.common.Constants.AuthMode mode, String keystore, String keystorepassword, String truststore, String truststorepassword) { try { this.username = username; this.password = password; this.mode = mode; } catch (Exception ex) { log.log(Level.WARN, "error initializing ssl sockets ", ex); } } private static final Logger log = LogHelper.getLog();
public static void safeClose(ResultSet con) { if (con != null) { try { con.close(); } catch (Throwable ex) { log.log(Level.INFO, null, ex); } } }
public static void safeClose(PreparedStatement con) { if (con != null) { try { con.close(); } catch (Throwable ex) { log.log(Level.INFO, null, ex); } } } }
public static void safeClose(Connection con) { if (con != null) { try { con.close(); } catch (Throwable ex) { log.log(Level.INFO, null, ex); } } }
public static void stop(String[] args) { if (t != null && t.isAlive() && instance != null) { instance.running = false; try { t.join(); } catch (InterruptedException ex) { log.log(Level.ERROR, null, ex); } } } static Logger log = Logger.getLogger("fgsms.PersistentStorageAgent");
@Override public void LoadConfig(Properties p) { try { DNSenabled = Boolean.parseBoolean(p.getProperty("discovery.dns.enabled").trim()); } catch (Exception ex) { DNSenabled = false; log.log(Level.WARN, null, ex); } }
private void printPeriods(List<Long> periods) { String s = ""; for (int i = 0; i < periods.size(); i++) { s += periods.get(i) + " "; } log.log(Level.DEBUG, "calculating status using the following time periods " + s.trim()); }
private void printPeriods(List<Long> periods) { String s = ""; for (int i = 0; i < periods.size(); i++) { s += periods.get(i) + " "; } log.log(Level.DEBUG, "calculating status using the following time periods " + s.trim()); }
/** * Strips off the xml declaration * * @param xmlalert * @return */ public static String StripXmlHeader(String xmlalert) { if (xmlalert.startsWith("<?xml")) { int trimat = xmlalert.indexOf("?>", 0); xmlalert = xmlalert.substring(trimat + 2); log.log(Level.DEBUG, "XML header trimmed " + xmlalert); } return xmlalert; }
private static void WriteAllText(String filename, String text) { try { File f = new File(filename); log.log(Level.INFO, "WriteAllText Current Dir = " + f.getName() + f.getAbsolutePath()); BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(filename), Constants.CHARSET)); out.write(text); out.close(); } catch (Exception e) { log.log(Level.INFO, filename + " WriteAllText, ", e); } } List<IEndpointDiscovery> endpointproviders = null;
public String generateLink(Object dataset, int series, Object category) { try { LogHelper.getLog().log(Level.ERROR, "fgsmsWeb generateLinkSet"); String s = (String) category; return "TransactionLogViewer.jsp?url=" + java.net.URLEncoder.encode(s, "UTF-8"); } /* public String generateLink(Object dataset, int series, Object category) { throw new UnsupportedOperationException("Not supported yet."); }*/ catch (UnsupportedEncodingException ex) { Logger.getLogger(PerformanceViewerAvgResTime.class.getName()).log(Level.ERROR, null, ex); } return ""; }
public String generateLink(Object dataset, int series, Object category) { try { LogHelper.getLog().log(Level.ERROR, "fgsmsWeb generateLinkSet"); String s = (String) category; return "TransactionLogViewer.jsp?url=" + java.net.URLEncoder.encode(s, "UTF-8"); } /* public String generateLink(Object dataset, int series, Object category) { throw new UnsupportedOperationException("Not supported yet."); }*/ catch (UnsupportedEncodingException ex) { LogHelper.getLog().log(Level.ERROR, null, ex); } return ""; } }
private void RecordDependency(String url, String action, String url0, String action0, Connection con) { PreparedStatement cmd=null; try { cmd = con.prepareStatement("INSERT INTO dependencies(sourceurl, sourcesoapaction, destintationurl, destinationsoapaction) VALUES (?, ?, ?, ?);"); cmd.setString(1, url); cmd.setString(2, action); cmd.setString(3, url0); cmd.setString(4, action0); cmd.executeUpdate(); } catch (Exception ex) { log.log(Level.ERROR, null, ex); } finally { DBUtils.safeClose(cmd); } }
public static String ExportServicePolicy(ServicePolicy pol) { try { JAXBContext jc = Utility.getSerializationContext(); Marshaller m = jc.createMarshaller(); StringWriter sw = new StringWriter(); // org.miloss.fgsms.services.interfaces.policyconfiguration.ObjectFactory pcsfac = new org.miloss.fgsms.services.interfaces.policyconfiguration.ObjectFactory (); m.marshal((pol), sw); String s = sw.toString(); return s; } catch (Exception ex) { Logger.getLogger(Helper.class).log(Level.ERROR, null, ex); } return null; }
static synchronized void EnqueueAlert(AlertContainer alertContainer) { queue.add(alertContainer); log.log(Level.DEBUG, "Enqueue alert " + alertContainer.getSLAID()); run(); }
public String generateToolTip(CategoryDataset data, int series, int item) { LogHelper.getLog().log(Level.ERROR, "fgsmsWeb generateToolTip " + series + " " + item); return "TransactionLogViewer.jsp?url=" + data.getValue(series, item); } /*
private SecurityWrapper getCurrentOperatingClassificationLevel() { try { SecurityWrapper t = getGlobalPolicyFromDB().getClassification(); log.log(Level.INFO, "PCS, current security classification is " + Utility.ICMClassificationToString(t.getClassification()) + " " + t.getCaveats()); return t; } catch (Exception ex) { log.log(Level.ERROR, "Unable to determine current classification level. Is the database available?", ex); } throw new IllegalAccessError(); }
public DefaultMessageProcessor() { //TODO consider putting a maximum cap on the thread pool, may be 4 at the most try { cfg = new ConfigLoader(); } catch (ConfigurationException ex) { log.fatal("Error loading config file!", ex); lasterror = ex.getMessage(); System.err.println("Error loading config file!"); ex.printStackTrace(); log.log(Level.FATAL, "Unable to load configuration, messages will not be transmitted", ex); deadMessageInterval = 10000; isDependencyInjectionEnabled = false; } }
public static String GetStatus(OpStatusService svc, String callbackUrl, SecurityWrapper c) { GetOperatingStatusRequestMessage req = new GetOperatingStatusRequestMessage(); req.setClassification(c); BindingProvider bp = (BindingProvider) svc; bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, callbackUrl); GetOperatingStatusResponseMessage operatingStatus; try { operatingStatus = svc.getOperatingStatus(req); return OpStatHelper.toHtmlFormatedString(operatingStatus, callbackUrl); } catch (Exception ex) { LogHelper.getLog().log(Level.WARN, null, ex); return ex.getMessage(); } }