Package com.sos.JSHelper.Exceptions

Examples of com.sos.JSHelper.Exceptions.JobSchedulerException


      return params;
    }
    catch (Exception e) {
      String strM = String.format(Messages.getMsg("JSJ-E-100"), e.getMessage());
      logger.error(strM, e);
      throw new JobSchedulerException(strM);
    }
  }
View Full Code Here


      strTargetString = substituteAllFilename(strTargetString, pstrSourceString);

      // // should any opening and closing brackets be found in the file name, then this is an error
      Matcher m = Pattern.compile("\\[[^\\]]*\\]").matcher(strTargetString);
      if (m.find())
        throw new JobSchedulerException("unsupported variable found:" + m.group());

      return strTargetString;

    }
    catch (Exception e) {
      throw new JobSchedulerException(conMethodName + ": " + e.getMessage());
    }
  }
View Full Code Here

  public String replaceGroups(String pstrSourceString, String replacement) throws Exception {

    String result = "";

    if (replacement == null /* || replacements.length == 0 */)
      throw new JobSchedulerException("replacements missing: 0 replacements defined");

    Pattern p = Pattern.compile(this.strValue); // the regular expression
    Matcher m = p.matcher(pstrSourceString); // check matching
    if (m.find() == false) // then nothing matched
      return pstrSourceString;

    String[] replacements = replacement.split(";");

    int intGroupCount = m.groupCount();
    if (replacements.length < intGroupCount)
      throw new JobSchedulerException("replacements missing: " + replacements.length + " replacement(s) defined but " + intGroupCount + " groups found");

    // no groups, exchange the whole string
    if (intGroupCount == 0) {
      result = pstrSourceString.substring(0, m.start()) + replacements[0] + pstrSourceString.substring(m.end());
    }
View Full Code Here

      return targetFilename;

    }
    catch (Exception e) {
      throw new JobSchedulerException("error substituting [date:]: " + e.getMessage());
    }
  }
View Full Code Here

      case publicKey:
        super.Value("publickey");
        this.enuMethod = penuAuthMethod;
        break;
      default:
        throw new JobSchedulerException("Invalid AuthenticationMethod");
    }

  }
View Full Code Here

    try {
      objInetAdress = InetAddress.getByName(this.Value());
    }
    catch (UnknownHostException e) {
      e.printStackTrace(System.err);
      throw new JobSchedulerException("Unknown host ", e);
    }
    catch (RuntimeException e) {
      e.printStackTrace(System.err);
      throw new JobSchedulerException("RunTime Exception ", e);
    }
    return objInetAdress;
  } // private InetAdress getInetAddress
View Full Code Here

  public void SignalAbort(final String strS) throws Exception {
    String strT = " ###ProgramAbort### ";
    strT = strT + strS + strT;
    message(strT);
    final JobSchedulerException expE = new JobSchedulerException(strT);

    throw expE;
  }
View Full Code Here

        objVFS4Source.Authenticate(objOptions.getConnectionOptions().Source());
        objVFS4Source.setSource();
        objVFS4Source.Options(objOptions);
      }
      catch (Exception e) {
        throw new JobSchedulerException("Problems creating/connecting DataSourceClient", e);
      }
    }

    return objDataSourceClient;
  } // private ISOSVfsFileTransfer DataSourceClient
View Full Code Here

          }
          else {
            logger.error(strM, e);
          }
          objSourceFileList.Rollback();
          throw new JobSchedulerException(strM, e);
        }
        finally {
          objSourceFileList.EndTransaction();
        }
        objSourceFileList.sendMails();
        // TODO in die Klasse SOSFileList oder SOSFtpCommand
        rc = printState(rc);
        // }
        // TODO das mu� beim JobScheduler-Job in die Parameter zur�ck, aber nur da
        // siehe hierzu das Interface ...
        // arguments.put("successful_transfers", String.valueOf(count));
        // return the number of transferred files
        // arguments.put("status", "success");
        return rc;
      }
      catch (Exception e) {
        // arguments.put("status", "error");
        // failed_transfer++;
        // arguments.put("failed_transfers", String.valueOf(failed_transfer));
        rc = false;
        e.printStackTrace(System.err);
        throw (new JobSchedulerException("could not process file transfer: " + e.getMessage()));
      }
      finally {
        if (jump) { // jump host ist angegeben, hier m�ssen z.B. tempor�r generierte Verzeichnisse auf Remote host gel�scht werden
          rc = doPostCommands(rc, objSourceFileList);
        }
      }
    }
    catch (Exception e) {
      e.printStackTrace(System.err);
      logger.error("data transfer failed: ", e);
      // if (sosString.parseToString(logger.getWarning()).length() > 0 || sosString.parseToString(logger.getError()).length() > 0) {
      // //TODO in die Order/Job-Parameter
      // getArguments().put("last_error", logger.getWarning() + " " + logger.getError());
      // }
      // TODO das mu� in die SOSFileList geschoben werden bzw in die SOSFTPCommand
      // writeHistory(localFile != null ? localFile.getAbsolutePath() : "", "");
      throw new JobSchedulerException("processing aborted.", e);
    }
  }
View Full Code Here

        cd = objDataTargetClient.changeWorkingDirectory(alternativeRemoteDir);
        objOptions.TargetDir.Value(alternativeRemoteDir);
      }
    }
    catch (Exception e) {
      throw new JobSchedulerException("..error in makeDirs, cause: " + e);
    }
  } // private void makeDirs()
View Full Code Here

TOP

Related Classes of com.sos.JSHelper.Exceptions.JobSchedulerException

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.