Package sos.spooler

Examples of sos.spooler.Variable_set


    boolean oldRunTime = false;
    String systemUser = System.getProperty("user.name");
    String sChangeUser="";
    String timeout ="";
    try{     
      Variable_set params = spooler_task.params();
      //schedulerCronConfigurationDir = params.value("scheduler_cron_configuration_dir");
      //logger.info("parameter scheduler_cron_configuration_dir: "+schedulerCronConfigurationDir);
      crontab = params.value("crontab");
      if(monitoredLiveDir!=null && crontab.length()==0){
        crontab="crontab";
      }
      if(crontab.length()==0) throw new Exception("missing parameter crontab");
      logger.info("parameter crontab: "+crontab);
      String dc = spooler.variables().var("cron_adapter_use_dynamic_configuration");
      if (dc!=null && dc.equals("1")){
        useDynamicConfiguration = true;
        if (monitoredLiveDir==null)
          logger.info("Using dynamic configuration files in directory "+schedulerCronConfigurationDir.getAbsolutePath());
      }
      if (crontab.equalsIgnoreCase("/etc/crontab")) systemCrontab=true;
      String sOldRunTime = params.value("old_run_time");     
      if (sOldRunTime.equalsIgnoreCase("1") || sOldRunTime.equalsIgnoreCase("true")|| sOldRunTime.equalsIgnoreCase("yes")){
        oldRunTime = true;
        logger.info("parameter old_run_time: true");
      }
      String sSystemCrontab = params.value("systab");
      if (sSystemCrontab!=null && sSystemCrontab.length()>0){
        if (sSystemCrontab.equalsIgnoreCase("1") || sSystemCrontab.equalsIgnoreCase("true")|| sSystemCrontab.equalsIgnoreCase("yes")){
          systemCrontab = true;
        }else{
          systemCrontab = false;
        }
        logger.info("parameter systab: "+sSystemCrontab);
      }
      sChangeUser = params.value("changeuser");
      if(sChangeUser!=null && sChangeUser.length()>0){
        logger.info("parameter changeuser: "+sChangeUser);
      } else sChangeUser="";
     
      if (systemCrontab && sChangeUser.equalsIgnoreCase("su") && !systemUser.equalsIgnoreCase("root")){
        logger.warn("You are running the Job Scheduler as "+systemUser+" and you are trying to use a system crontab with 'su'. This will not work. Either run the Job Scheduler as root, or use 'sudo' as change_user_command parameter");
      }
      timeout = params.value("timeout");
      if (timeout!=null && timeout.length()>0){
        logger.info("parameter timeout: "+timeout);
      }
    } catch (Exception e){
      logger.error("Error reading job parameters: "+e);
View Full Code Here


  private void doProcessing() throws Exception {
    @SuppressWarnings("unused")//$NON-NLS-1$
    final String conMethodName = conClassName + "::doProcessing"; //$NON-NLS-1$
    JSBatchInstaller objR = new JSBatchInstaller();
    JSBatchInstallerOptions objO = objR.Options();
     Variable_set varT = getParameters();
    HashMap<String, String> hshT = null;
    hshT = getSchedulerParameterAsProperties(varT);
    objO.setAllOptions(hshT);
    objO.CheckMandatory();
    objR.setJSJobUtilites(this);
View Full Code Here

     */
    public void cleanup() throws Exception {

        try {
            if (this.orderParameterKeys != null) {
                Variable_set resultParameters = spooler.create_variable_set();
                String[] parameterNames = spooler_task.order().params().names().split(";");
                for(int i=0; i<parameterNames.length; i++) {
                    if (!this.orderParameterKeys.contains(parameterNames[i])) {
                        resultParameters.set_var(parameterNames[i], spooler_task.order().params().value(parameterNames[i]));
                    }
                }
                spooler_task.order().set_params(resultParameters);
            }
        } catch (Exception e) {
View Full Code Here

             || (OS.indexOf("windows 9")> -1)) {
            win=true;
        }

     
        Variable_set env = spooler_task.create_subprocess().env();
        this.getLogger().debug9(env.names());
        StringTokenizer t = new StringTokenizer(env.names(), ";");
        while (t.hasMoreTokens()) {
            String envname = t.nextToken();
            if (envname != null) {
                String envvalue = env.value(envname);
                if (win) {
                    this.getLogger().debug9(envname.toUpperCase() + "=" + envvalue);
                    this.envvars.put(envname.toUpperCase(), envvalue);
                } else {
                    this.envvars.put(envname, envvalue);
View Full Code Here

   * spooler_init ist in der super Klasse implementiert
   */
  public boolean spooler_process() {
    boolean rc = true;
    long recordCount = 0;
    Variable_set parameters = null;
    try {
      init();
      parameters = spooler.create_variable_set();
      if (spooler_task.params() != null)
        parameters.merge(spooler_task.params());
      if (spooler_job.order_queue() != null)
        parameters.merge(spooler_task.order().params());
      setConnection(SOSFTPHistory.getConnection(spooler, getConnection(), parameters, getLogger()));
      recordCount = this.doImport(parameters);
      getLogger().info(
          "records: imported = " + recordCount + " ( found = " + _recordFoundCount + " skipped = " + _recordSkippedCount + " skipped [error] = "
              + _recordSkippedErrorCount + " )");
View Full Code Here

   
    if (!arg0) return arg0;
   
    SOSConnection       conn        = null;
    SOSSchedulerLogger  log         = null;
    Variable_set        parameters  = null;
    String              host        = null;
    String              remoteDir   = null;
   
    try{
      parameters = spooler.create_variable_set();
      if(spooler_task.params() != null) parameters.merge(spooler_task.params());
      if (spooler_job.order_queue() != null)parameters.merge(spooler_task.order().params());
           
      SOSFTPHistory.debugParams(parameters, spooler_log);
           
      if(parameters != null && parameters.count() > 0){
        if (parameters.value("ftp_result_files") == "0"){
          spooler_log.debug9("no files were received");    
        }
        else{
          host      = parameters.value("ftp_host");
          remoteDir = parameters.value("ftp_remote_dir");
           
          if(host != null && host.length() > 0 && remoteDir != null && remoteDir.length() > 0){
            try{
              String[] files  = parameters.value("ftp_result_filepaths").split( ";" );
       
              log             = new SOSSchedulerLogger(spooler_log);
              conn            = SOSFTPHistory.getConnection(spooler, conn, parameters, log);
             
              for (int i=0; i<files.length; i++){
View Full Code Here

      return false;
    }
  }
 
  private void getParameters() throws Exception {
    Variable_set orderData = null;

    try { // to fetch parameters from the job and from orders that have precedence to job parameters

           // start processing job parameters
           if (spooler_task.params().var("job") != null && spooler_task.params().var("job").length() > 0) {
               this.setMonitorJob(spooler_task.params().var("job"));
               spooler_log.debug1(".. job parameter [job]: " + this.getMonitorJob());
           } else if (this.getMonitorJob() == null || this.getMonitorJob().length() == 0){
               this.setMonitorJob(spooler_job.name());
           }
          
           if (spooler_task.params().var("type") != null && spooler_task.params().var("type").length() > 0) {
               this.setMessageType(spooler_task.params().var("type"));
               spooler_log.debug1(".. job parameter [type]: " + this.getMessageType());
           }
       
          
           if (sosString.parseToString(spooler_task.params().var("monitor_job_name")).length() > 0) {
               this.setMonitorJobname(spooler_task.params().var("monitor_job_name"));
               spooler_log.debug1(".. job parameter [monitor_job_name]: " + this.getMonitorJobname());
           } else {
               this.setMonitorJobname("");
           }
          
           if (sosString.parseToString(spooler_task.params().var("monitor_job_chain_name")).length() > 0) {
               this.setMonitorJobChainname(spooler_task.params().var("monitor_job_chain_name"));
               spooler_log.debug1(".. job parameter [monitor_job_chain_name]: " + this.getMonitorJobChainname());
           } else {
               this.setMonitorJobChainname("");
           }
          
          
           if (sosString.parseToString(spooler_task.params().var("log_messages")).length() > 0) {
               this.setLogMessages(sosString.parseToBoolean(spooler_task.params().var("log_messages")));
               spooler_log.debug1(".. job parameter [log_messages]: " + this.isLogMessages());
           }
          
      
           if (sosString.parseToString(spooler_task.params().var("maximum_lifetime")).length() > 0) {
              this.setMaxLifeTime(sosString.parseToString(spooler_task.params().var("maximum_lifetime")));
              spooler_log.debug1(".. job parameter [maximum_lifetime]: " + this.getMaxLifeTime());
          } else {
              this.setMaxLifeTime("");
          }
          
    
          
           if (sosString.parseToString(spooler_task.params().var("log_file")).length() > 0) {
               this.setLogFilename(sosString.parseToString(spooler_task.params().var("log_file")));
               spooler_log.debug1(".. job parameter [log_file]: " + this.getLogFilename());
           } else {
               this.setLogFilename("");
           }
          

           // now fetch the order parameters
           if (spooler_task.job().order_queue() != null) {
       
         if (order != null) {
          orderData = order.params();
         
          if ( orderData.var("type") != null && orderData.var("type").toString().length() > 0) {
            this.setMessageType(orderData.var("type").toString());
            spooler_log.debug1(".. order parameter [type]: " + this.getMessageType());
          }
         
                  
          if(orderData != null && sosString.parseToString(orderData.var("monitor_job_name")).length() > 0) {
            this.setMonitorJobname(sosString.parseToString(orderData.var("monitor_job_name")));
            spooler_log.debug1(".. order parameter [monitor_job_name]: " + this.getMonitorJobname() );
          } else {
            this.setMonitorJobname("");
          }
         
          if(orderData != null && sosString.parseToString(orderData.var("monitor_job_chain_name")).length() > 0) {
            this.setMonitorJobChainname(sosString.parseToString(orderData.var("monitor_job_chain_name")));
            spooler_log.debug1(".. order parameter [monitor_job_chain_name]: " + this.getMonitorJobChainname() );
          } else {
            this.setMonitorJobChainname("");
          }
         
          if(orderData != null && sosString.parseToString(orderData.var("log_messages")).length() > 0) {
            this.setLogMessages(sosString.parseToBoolean(orderData.var("log_messages")));
            spooler_log.debug1(".. order parameter [log_messages]: " + this.isLogMessages() );
          }
         
    
         
          if(orderData != null && sosString.parseToString(orderData.var("log_file")).length() > 0) {
            setLogFilename(sosString.parseToString(orderData.var("log_file")));
            spooler_log.debug1(".. order parameter [log_file]: " + this.getLogFilename() );
          } else {
            setLogFilename("");
          }
         
View Full Code Here

       *
       * @return boolean
       */
      public boolean spooler_process() {
               
          Variable_set parameters = null;
          HashMap allParams       = null;
          JobSchedulerLoadTestLauncher launcher = null;
          try {
            sosLogger = new SOSSchedulerLogger(spooler_log);
            sosLogger.debug3(".. calling " + SOSClassUtil.getMethodName());
              parameters = spooler_task.params();
             
              if (spooler_job.order_queue() != null) {
                  parameters.merge(spooler_task.order().params());                          
              }
             
              allParams = this.getParameters();       
             
              launcher = new JobSchedulerLoadTestLauncher(sosLogger);             
View Full Code Here

       *
       * @return
       * @throws Exception
       */
      public HashMap getParameters() throws Exception {
        Variable_set parameters = null;
        String[] names = null;
        HashMap allParam = new HashMap();
          try {            
            sosLogger.debug3(".. calling " + SOSClassUtil.getMethodName());
            parameters = spooler_task.params();
            if (parameters.count() > 0) {
              names = parameters.names().split(";");
              for(int i = 0; i < parameters.count(); i++) {
                if (sosString.parseToString(parameters.var(names[i])).length() > 0) {
                  allParam.put(names[i], parameters.var(names[i]));
                }
              } 
            }
             return allParam;                                                   
             
View Full Code Here

     */
    public void cleanupConfiguration() throws Exception {

        try {
            if (this.orderParameterKeys != null) {
                Variable_set resultParameters = spooler.create_variable_set();
                String[] parameterNames = spooler_task.order().params().names().split(";");
                for(int i=0; i<parameterNames.length; i++) {
                    if (!this.orderParameterKeys.contains(parameterNames[i])) {
                        resultParameters.set_var(parameterNames[i], spooler_task.order().params().value(parameterNames[i]));
                    }
                }
                spooler_task.order().set_params(resultParameters);
            }
        } catch (Exception e) {
View Full Code Here

TOP

Related Classes of sos.spooler.Variable_set

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.