Package sos.xml

Examples of sos.xml.SOSXMLXPath


        }
      }
      else
        if (port.equalsIgnoreCase("0") && host.equalsIgnoreCase("all")) {
          String answer = spooler.execute_xml("<show_state what=\"remote_schedulers\"/>");
          SOSXMLXPath xpath = new SOSXMLXPath(new StringBuffer(answer));
          NodeList remoteSchedulerList = xpath.selectNodeList("/spooler/answer/state/remote_schedulers/remote_scheduler[@connected='yes']");
          for (int i = 0; i < remoteSchedulerList.getLength(); i++) {
            Element rem = (Element) remoteSchedulerList.item(i);
            // TODO: besser ip verwenden?
            String currHost = rem.getAttribute("hostname");
            String currPort = rem.getAttribute("tcp_port");
View Full Code Here


    return type;
  }

  private boolean isOrderJob(File configFile) throws Exception {

    SOSXMLXPath xp = new SOSXMLXPath(configFile.getAbsolutePath());
    String orderAtt = xp.selectSingleNodeValue("/job/@order");
    if (orderAtt != null && orderAtt.equalsIgnoreCase("yes")) {
      getLogger().debug8("File " + configFile + " is orderjob.");
      return true;
    }
    getLogger().debug8("File " + configFile + " is independent job.");
View Full Code Here

    return false;
  }

  private boolean isSubstituteSchedule(File configFile) throws Exception {

    SOSXMLXPath xp = new SOSXMLXPath(configFile.getAbsolutePath());
    String orderAtt = xp.selectSingleNodeValue("/schedule/@substitute");
    if (orderAtt != null && orderAtt.length() > 0) {
      getLogger().debug8("File " + configFile + " is substitute schedule.");
      return true;
    }
    getLogger().debug8("File " + configFile + " is ordinary schedule.");
View Full Code Here

    }

    String xml = getLiveXml();
    spooler_log.debug3("liveExport: " + xml);

    SOSXMLXPath xpath = new SOSXMLXPath(new StringBuffer(xml));
    String jobChainName = xpath.selectSingleNodeValue("//order/@job_chain");
    File currentRoot = liveFolder.getParentFile();
    getLogger().debug7("current root folder: " + currentRoot.getAbsolutePath());

    if (jobChainName != null && jobChainName.length() > 0) {
      xml = xml.replaceFirst(" job_chain=\"" + jobChainName + "\"", "");
View Full Code Here

              answer = schedulerCommand.getResponse();
      }else{
        spooler_log.info("No supervisor configured, submitting event to this Job Scheduler.");
        answer = spooler.execute_xml(xml);
      }
      SOSXMLXPath xAnswer = new SOSXMLXPath(new StringBuffer(answer));
        String errorText = xAnswer.selectSingleNodeValue("//ERROR/@text");
        if (errorText != null && errorText.length() > 0) {
          throw new Exception("supervisor returned error: " + errorText );
       
    } catch(Exception e){
      throw new Exception("Failed to submit event: "+e,e);
View Full Code Here

        
      if(once){
        //Wenn ein Repeat-Intervall angegeben ist, nicht starten.
        //Repeat f�r bestimmte Tage werden nicht ausgewertet.
       
        SOSXMLXPath xpath = new SOSXMLXPath(new StringBuffer(xml));
        SOSXMLXPath xpath_answer = new SOSXMLXPath(new StringBuffer(answer));
   
         
          boolean start = true;
          String nodeQuery = "//add_order[@at]";
          Node runtime;
          if (what.equals("order")){
           
            Node atNode = xpath.selectSingleNode(nodeQuery);
            nodeQuery = "//run_time";
            runtime = xpath.selectSingleNode(nodeQuery);
           
            if(atNode == null && runtime == null){
              start = false;
              getLog().debug1("handleOnce:" + name + " Once=yes. Order will not be modified because 'no at and no runtime' is given in <add_order>");
            }
           
          }
         
          nodeQuery = "//run_time[@repeat]";
          runtime = xpath.selectSingleNode(nodeQuery);
          if(runtime != null){
              start = false;
              getLog().debug1("handleOnce:" + name + " Once=yes. "+what+" will not be modified because 'repeat' is given in <runtime>");
          }
         
         
          nodeQuery = "//run_time/period[@repeat]";
          runtime = xpath.selectSingleNode(nodeQuery);
          if(runtime != null && start){
              start = false;
              getLog().debug1("handleOnce:" + name + " Once=yes. "+what+" will not be startet because 'repeat' is given in <runtime>");
          }
          if(start){
              String command = "";
              if (what.equals("order")){
                String job_chain = xpath.selectSingleNodeValue("//add_order/@job_chain");
                String id = xpath_answer.selectSingleNodeValue("//spooler/answer/ok/order/@id");
                 
                command = "<modify_order at=\"now\" job_chain=\"" + job_chain + "\"  order=\"" + id + "\"/>";
               
              }
              if (what.equals("job")){
View Full Code Here

        String scheduler_order_id = "";
        String scheduler_order_title = "";
        String scheduler_order_job_chain = "";
        String scheduler_order_state = "";
       
        SOSXMLXPath xpath = new SOSXMLXPath(new StringBuffer(xml));
        NamedNodeMap nodeMapSettings = null;
        String nodeQuery = "//add_order";
        Node add_order = xpath.selectSingleNode(nodeQuery);
      
        if (add_order != null){

           nodeMapSettings = add_order.getAttributes();
          
View Full Code Here

    String factoryIni = spooler.ini_path();
    // String factoryIni = "c:\\scheduler.al\\config\\factory.ini";
   
    String section = "job " + name;
   
    SOSXMLXPath xpath = new SOSXMLXPath(new StringBuffer(xml));
    NamedNodeMap nodeMapSettings = null;
    String nodeQuery = "//email_settings";
    Node emailSettings = xpath.selectSingleNode(nodeQuery);
    if(emailSettings != null){
        nodeMapSettings = emailSettings.getAttributes();
        if(nodeMapSettings != null && nodeMapSettings.getNamedItem("to") != null)
          to = nodeMapSettings.getNamedItem("to").getNodeValue();
        if(nodeMapSettings != null && nodeMapSettings.getNamedItem("cc") != null)
View Full Code Here

      }
      String response = spooler.execute_xml(xml);
      getLog().debug3("...executed");
      getLogger().debug9("Response from Job Scheduler: "+response);
     
      SOSXMLXPath xpath = new SOSXMLXPath(new StringBuffer(response));

   
      String errorMsg = "";
      if (xpath.selectSingleNodeValue("//spooler/answer/ERROR") != null) {
         String errorCode = xpath.selectSingleNodeValue("//spooler/answer/ERROR/@code");
         String errorText = xpath.selectSingleNodeValue("//spooler/answer/ERROR/@text");
         errorMsg = errorCode + ":"  + errorText;
      }
     
      if (!errorMsg.equals("")){
        throw new Exception ("Scheduler answer ERROR:" + errorMsg);
View Full Code Here

    }
   
    private void writeConfigFile(String xml, String what, String name, String path, String modified) throws Exception{
      try{
        String fileName="";
        SOSXMLXPath xpath = new SOSXMLXPath(new StringBuffer(xml));
        if (what.equalsIgnoreCase("order")){
          String job_chain = xpath.selectSingleNodeValue("//add_order/@job_chain");
          fileName=job_chain+",";
        }
        fileName+=name+".";
        String fileIdentifier = what;
        if(fileIdentifier.equalsIgnoreCase("orderjob")) fileIdentifier="job";
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.