Package com.sos.JSHelper.Exceptions

Examples of com.sos.JSHelper.Exceptions.JobSchedulerException


                break;
              }
            }
            catch (InterruptedException e) {
              e.printStackTrace();
              throw new JobSchedulerException("thread processing interrupted", e);
            }
            catch (Exception e) {
              e.printStackTrace();
              throw new JobSchedulerException("thread processing interrupted", e);
            }
          }
        }
      }
    }
View Full Code Here


      // }
      // }
      return rc;
    }
    catch (Exception e) {
      throw new JobSchedulerException(String.format(getMsg(EXCEPTION_RAISED), conMethodName, e));
    }
  }
View Full Code Here

      }
    }
    catch (Exception e) {
      String strM = String.format("error in  %1$s", conMethodName);
      logger.error(strM + e);
      throw new JobSchedulerException(strM, e);
    }
    String[] strA = { "" };
    if (filelist.size() > 0) {
      strA = (String[]) filelist.toArray(new String[filelist.size()]);
    }
View Full Code Here

          if (zeroByteCount > 0 && zeroByteFilesRelaxed) {
            state = "no matching files found, " + zeroByteCount + " zero byte files skipped";
          }
          else
            if (zeroByteCount > 0 && zeroByteFilesStrict) {
              throw new JobSchedulerException("zero byte file(s) found");
            }
            else
              if (objOptions.force_files.value() == true) {
                if (objSourceFileList.List().size() <= 0) {
                  throw new JobSchedulerException("no (matching) files found");
                }
              }
              else {
                state = "no matching files found";
              }
          rc = (objOptions.force_files.value() == false ? true : !zeroByteFilesRelaxed);
          break;
        case 1:
          String strM = "";
          if (zeroByteCount > 0) {
            strM = String.format("%1$d files skipped due to zero byte constraint", zeroByteCount);
          }
          state = "1 file transferred. " + strM;
          rc = true;
          break;
        default:
          state = count + " files transferred" + ((zeroByteCount > 0) ? ", " + zeroByteCount + " files skipped due to zero byte constraint" : "");
          rc = true;
          break;
      }
      logger.info(state);
      return rc;
    }
    catch (Exception e) {
      throw new JobSchedulerException(String.format(EXCEPTION_RAISED, conMethodName, e));
    }
  }
View Full Code Here

      }

    }
    catch (final IOException e) {
      logger.error("getContent() - " + e, e); //$NON-NLS-1$
      throw new JobSchedulerException("Error in JSFile", e);
    }
    finally {
      try {
        if (fin != null) {
          fin.close();
View Full Code Here

              udpSocket = null;
            }
          }
        }
        else {
          throw new JobSchedulerException(String.format("TransferMethod '%1$s' not supported (yet)", objOptions.TransferMethod.Value()));
        }
    }
    catch (Exception e) {
      throw new JobSchedulerException(String.format("%1$s: %2$s", conMethodName, e.getMessage()), e);
    }
    if (objAnswer != null) {
      // TODO in Answer den original-response des js als string ablegen.
      // TODO eigenst�ndige BasisKlasse JSAnswerBase bauen. ableiten von JSCmdBase.
      if (objAnswer.getERROR() != null) {
        throw new JobSchedulerException("Job Scheduler responds an error due to an invalid or wrong command\n" + strT);
      }
    }
    return objAnswer;
  } // private Object run
View Full Code Here

   *
   * @param strS
   * @throws Exception
   */
  public void SignalError(final String strS) {
    this.SignalError(new JobSchedulerException(strS), strS);
  }
View Full Code Here

        u4Answers = jc4Answers.createUnmarshaller();
      }
      objSpooler = (com.sos.scheduler.model.answers.Spooler) u4Answers.unmarshal(new StringReader(pXMLStr));
    }
    catch (Exception e) {
      throw new JobSchedulerException(String.format("can't get answer object from %n%1$s", pXMLStr), e);
    }
    if (objSpooler != null) {
      objAnswer = objSpooler.getAnswer();
    }
    return objAnswer;
View Full Code Here

    if (pobjVirtualFile != null) {
      InputStream objInputStream = pobjVirtualFile.getFileInputStream();
      try {
        if (objInputStream == null) {
          logger.error(String.format("can't get inputstream for file '%1$s'.", pobjVirtualFile.getName()));
          throw new JobSchedulerException(String.format("can't get inputstream for file '%1$s'.", pobjVirtualFile.getName()));
        }
        objC = u.unmarshal(objInputStream);
      }
      catch (JAXBException e) {
        e.printStackTrace();
        throw new JobSchedulerException("", e);
      }
      finally {
        pobjVirtualFile.closeInput();
      }
    }
    else {
      logger.error("pobjVirtualFile is null");
      throw new JobSchedulerException("pobjVirtualFile is null");
    }
    return objC;
  } // private Object unMarshall
View Full Code Here

    try {
      objC = u.unmarshal(pobjInputStream);
    }
    catch (JAXBException e) {
      e.printStackTrace();
      throw new JobSchedulerException("", e);
    }
    return objC;
  } // private Object unMarshall
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.