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 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 boolean isDependencyInjectionEnabled() { try { return Boolean.parseBoolean(prop.getProperty("agent.dependencyinjection.enabled")); } catch (Exception ex) { log.warn("error parsing agent.dependencyinjection.enabled"); } return false; }
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; } }
private static void SendLogger(String msg, SLAAction logAction, String url, String incident) { if (logAction != null) { NameValuePair GetNameValuePairByName = Utility.getNameValuePairByName(logAction.getParameterNameValue(), "Logger"); if (GetNameValuePairByName != null) { Logger l = null; if (GetNameValuePairByName.isEncrypted()) { l = Logger.getLogger(Utility.DE(GetNameValuePairByName.getValue())); } else { l = Logger.getLogger((GetNameValuePairByName.getValue())); } l.log(Level.WARN, SLACommon.getBundleString("SLALoggerPrefix") + url + " message: " + msg.toString() + " SLAFaultID: " + incident); } } else { log.warn("log action is null, defaulting"); log.log(Level.WARN, SLACommon.getBundleString("SLALoggerPrefix") + url + " message: " + msg.toString() + " SLAFaultID: " + incident); } }
uddiauth = AuthMode.valueOf(t); } catch (Exception ex) { log.log(Level.WARN, "Unable to parse the value of UddiPublisher.AuthMode!", ex); throw ex; log.log(Level.FATAL, "inquiry url is not set, see the how to guide for configuration Uddi Publication."); return; log.log(Level.FATAL, "publishurl url is not set, see the how to guide for configuration Uddi Publication."); return; log.log(Level.FATAL, "auth mode is UDDI and the security url is not set, see the how to guide for configuration Uddi Publication."); return; log.log(Level.INFO, "Inquiry Endpoint: Loading truststore from " + truststore); contextPCS.put("javax.net.ssl.trustStorePassword", Utility.DE(truststorepass)); contextPCS.put("javax.net.ssl.trustStore", truststore); contextPCS.put("javax.net.ssl.keyStorePassword", Utility.DE(keystorepass)); contextPCS.put("javax.net.ssl.keyStore", keystore); log.log(Level.INFO, "Inquiry Endpoint: Loading keystore from " + keystore); contextPCS.put("javax.net.ssl.trustStorePassword", Utility.DE(truststorepass)); contextPCS.put("javax.net.ssl.trustStore", truststore); log.log(Level.INFO, "Publish Endpoint: Loading truststore from " + truststore); contextPCS.put("javax.net.ssl.keyStorePassword", Utility.DE(keystorepass)); contextPCS.put("javax.net.ssl.keyStore", keystore); log.log(Level.INFO, "Publish Endpoint: Loading keystore from " + truststore);
log.log(Level.DEBUG, "loading actions for " + uri); List<String> actions = new ArrayList<String>(); PreparedStatement comm = null; log.log(Level.DEBUG, uri + " " + temp); if (!Utility.stringIsNullOrEmpty(temp)) { temp = temp.trim(); log.error("error fetching actions for service", ex); } finally { DBUtils.safeClose(results); DBUtils.safeClose(comm); log.log(Level.INFO, "calculating statistics for " + uri); actions.add(allitems); log.error("error fetching transactions", ex); } finally { DBUtils.safeClose(records); up.executeUpdate(); } catch (Exception ex) { log.error("error updating statistcs row", ex); } finally { DBUtils.safeClose(up); log.log(Level.INFO, "Statistics calculations took " + uri + " " + now + "ms"); } catch (Exception ex) { log.log(Level.ERROR, "Error caught during statistics calculation, please report", ex);
protected String getHeader() { String x = null; InputStream s = null; try { s = this.getClass().getClassLoader().getResourceAsStream("org/miloss/fgsms/services/rs/impl/header.txt"); x = readAllText(s); } catch (Exception ex) { log.error(null, ex); } finally { if (s != null) { try { s.close(); } catch (IOException ex) { } } } return x; }
log.debug("Processing alert for " + alert.getModifiedurl() + " msg " + alert.getFaultMsg() + " class " + alert.getSlaActionBaseType().getImplementingClassName()); Class c = null; try { log.error("Error to Load class for SLA Alert!!!" + alert.getSlaActionBaseType().getImplementingClassName()); } else { try { item.ProcessAction(alert, alert.getSlaActionBaseType().getParameterNameValue()); } catch (Exception ex) { log.error("Error unable to process SLA Alert!!!", ex);
uddiauth = AuthMode.valueOf(t); } catch (Exception ex) { log.log(Level.WARN, "Unable to parse the value of UddiPublisher.AuthMode!", ex); throw ex; log.log(Level.INFO, "Inquiry Endpoint: Loading truststore from " + truststore); contextPCS.put("javax.net.ssl.trustStorePassword", Utility.DE(truststorepass)); contextPCS.put("javax.net.ssl.trustStore", truststore); contextPCS.put("javax.net.ssl.keyStorePassword", Utility.DE(keystorepass)); contextPCS.put("javax.net.ssl.keyStore", keystore); log.log(Level.INFO, "Inquiry Endpoint: Loading keystore from " + keystore); contextPCS.put("javax.net.ssl.trustStorePassword", Utility.DE(truststorepass)); contextPCS.put("javax.net.ssl.trustStore", truststore); log.log(Level.INFO, "Publish Endpoint: Loading truststore from " + truststore); contextPCS.put("javax.net.ssl.keyStorePassword", Utility.DE(keystorepass)); contextPCS.put("javax.net.ssl.keyStore", keystore); log.log(Level.INFO, "Publish Endpoint: Loading keystore from " + truststore); contextPCS.put("javax.net.ssl.trustStorePassword", Utility.DE(truststorepass)); contextPCS.put("javax.net.ssl.trustStore", truststore); log.log(Level.INFO, "Security Endpoint: Loading truststore from " + truststore); contextPCS.put("javax.net.ssl.keyStorePassword", Utility.DE(keystorepass)); contextPCS.put("javax.net.ssl.keyStore", keystore); log.log(Level.INFO, "Security Endpoint: Loading truststore from " + keystore);
protected String getFooter() { String x = null; InputStream s = null; try { s = this.getClass().getClassLoader().getResourceAsStream("org/miloss/fgsms/services/rs/impl/footer.txt"); x = readAllText(s); } catch (Exception ex) { log.error(null, ex); } finally { if (s != null) { try { s.close(); } catch (IOException ex) { } } } return x; }
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 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; }
log.error("SLA Processing failed for " + req.getURI(), ex); } finally { if (is!=null)
/** * base 64 encoder */ public static String encode(String text) { try { return org.apache.commons.codec.binary.Base64.encodeBase64String(text.getBytes(Constants.CHARSET)); } catch (UnsupportedEncodingException ex) { LogHelper.getLog().warn("unexpected base64 encoding error", ex); } return ""; }
public static void safeClose(ResultSet con) { if (con != null) { try { con.close(); } catch (Throwable ex) { log.log(Level.INFO, null, ex); } } }
protected void inquiry(String servicekey) { try { GetServiceDetail r = new GetServiceDetail(); r.getServiceKey().add(servicekey); ServiceDetail serviceDetail = inquiry.getServiceDetail(r); if (serviceDetail != null && serviceDetail.getBusinessService() != null && !serviceDetail.getBusinessService().isEmpty()) { JAXBContext jc = JAXBContext.newInstance(ServiceDetail.class); //JAXB.marshal(jc, null); // Unmarshaller u = jc.createUnmarshaller(); // Object element = u.unmarshal(new File("foo.xml")); //note, this doesn't work Marshaller m = jc.createMarshaller(); StringWriter sw = new StringWriter(); m.marshal(serviceDetail, sw); //Marshalling to a File: log.log(Level.INFO, "Results" + sw.toString()); } else { log.log(Level.WARN, "no results return "); //return ""; } } catch (Exception ex) { Logger.getLogger(UddiPublisher.class.getName()).log(Level.ERROR, null, ex); } // return ""; }
LogHelper.getLog().error(ex);
public long getDeadMessageQueueDuration() { String s = prop.getProperty("message.processor.dead.message.queue.duration"); long ret = 10000; if (!Utility.stringIsNullOrEmpty(s)) { try { ret = Long.parseLong(s); } catch (Exception ex) { log.warn("error parsing message.processor.dead.message.queue.duration"); } } if (ret < 10000) { ret = 10000; } return ret; }
public static void safeClose(PreparedStatement con) { if (con != null) { try { con.close(); } catch (Throwable ex) { log.log(Level.INFO, null, ex); } } } }