Package sos.xml

Examples of sos.xml.SOSXMLXPath


   * @throws Exception
   */
  public Calendar getStartOfOrder(Order order) throws Exception{
    String xml = order.xml();
    StringBuffer xmlBuf = new StringBuffer(xml);
    SOSXMLXPath xp = new SOSXMLXPath(xmlBuf);
    String startTime = xp.selectSingleNodeValue("/order/@start_time");
    if (startTime==null || startTime.length()==0) {
      throw new Exception("No start_time attribute was found for the current order");
    }
    Date dat = schedulerDateFormat.parse(startTime);
    Calendar cal = Calendar.getInstance();
View Full Code Here


    public static String getEventXMLAsString(String eventXml) throws DOMException, Exception {
      
      

       try {
        SOSXMLXPath sosxml = new SOSXMLXPath(new StringBuffer(eventXml));
         NodeList params = sosxml.selectNodeList("/spooler/answer/params/param[@name='scheduler_event_service.events']");
          if (params.item(0) == null) {
               throw new Exception("no event parameters found in Job Scheduler answer");
           }
          
           NamedNodeMap attrParam = params.item(0).getAttributes();
View Full Code Here

                eventXml = eventContent;
            }
           
            eventXml = JobSchedulerEventXPath.getEventXMLAsString(eventXml);
           
            SOSXMLXPath xPath = new SOSXMLXPath(new StringBuffer(eventXml));
            NodeList nl = xPath.selectNodeList(eventXPath);
            if (nl != null) {
                System.out.println(nl.getLength());
            } else {
                System.out.println(0);
            }
View Full Code Here

                  continue;
                String commandRequest = this.xmlNodeToString(commandElements.item(k));
                this.getLogger()
                    .info(".. sending command to remote Job Scheduler [" + commandHost + ":" + commandPort + "]: " + commandRequest);
                schedulerCommand.sendRequest(commandRequest);
                SOSXMLXPath answer = new SOSXMLXPath(new StringBuffer(schedulerCommand.getResponse()));
                String errorText = answer.selectSingleNodeValue("//ERROR/@text");
                if (errorText != null && errorText.length() > 0) {
                  throw new Exception("could not send command to remote Job Scheduler [" + commandHost + ":" + commandPort + "]: "
                      + errorText);
                }
              }
View Full Code Here

TOP

Related Classes of sos.xml.SOSXMLXPath

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.