/** * Converts a ManagementEventType to a dom Element * * @param alert * @return may return null if the document cannot be marshalled */ public static org.w3c.dom.Element WSDMAlertToDomElement(ManagementEventType alert) { try { InputStream is = new ByteArrayInputStream(WSDMtoXmlString(alert).getBytes(Constants.CHARSET)); DocumentBuilderFactory fac = DocumentBuilderFactory.newInstance(); fac.setNamespaceAware(true); DocumentBuilder newDocumentBuilder = fac.newDocumentBuilder(); Document xmlDocument = newDocumentBuilder.parse(is); xmlDocument.getDocumentElement().normalize(); return xmlDocument.getDocumentElement(); } catch (Exception ex) { log.log(Level.FATAL, BundleLoader.getBundleString("ErrorWSDMCreateDomElement"), ex); } return null; }
return sw.toString(); } catch (JAXBException ex) { log.log(Level.WARN, BundleLoader.getBundleString("ErrorWSDMMarshalling"), ex);
gcal.setTimeInMillis(System.currentTimeMillis()); m.setEventId(BundleLoader.getBundleString("WSDMEventIdPrefix") + alert.getSLAID()); ComponentType c = new ComponentType(); c.setResourceId(alert.getModifiedurl()); SituationType sit = new SituationType(); LangString l = new LangString(); l.setLang(BundleLoader.getBundleString("WSDMLangauge")); l.setValue(alert.getFaultMsg()); sit.setMessage(l); sit.setSituationTime((gcal)); } catch (Exception ex) { log.log(Level.WARN, BundleLoader.getBundleString("ErrorDataTypeFactorLoad"), ex);