gpt4 book ai didi

org.opencastproject.workflow.api.WorkflowOperationException.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-24 16:51:05 24 4
gpt4 key购买 nike

本文整理了Java中org.opencastproject.workflow.api.WorkflowOperationException.<init>()方法的一些代码示例,展示了WorkflowOperationException.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WorkflowOperationException.<init>()方法的具体详情如下:
包路径:org.opencastproject.workflow.api.WorkflowOperationException
类名称:WorkflowOperationException
方法名:<init>

WorkflowOperationException.<init>介绍

[英]Constructs a new WorkflowOperationException with a message, but no root cause.
[中]用一条消息构造一个新的WorkflowOperationException,但没有根本原因。

代码示例

代码示例来源:origin: opencast/opencast

/**
 * Create an error function.
 * <p>
 * Example usage: <code>getCfg(wi, "key").getOrElse(this.&lt;String&gt;cfgKeyMissing("key"))</code>
 *
 * @see #getCfg(WorkflowInstance, String)
 * @deprecated see {@link #getCfg(WorkflowInstance, String)} for details
 */
protected <A> Function0<A> cfgKeyMissing(final String key) {
 return new Function0<A>() {
  @Override public A apply() {
   return chuck(new WorkflowOperationException(key + " is missing or malformed"));
  }
 };
}

代码示例来源:origin: opencast/opencast

/**
 * Get a mandatory configuration key. Values are returned trimmed.
 *
 * @throws WorkflowOperationException
 *         if the configuration key is either missing or empty
 */
protected String getConfig(WorkflowOperationInstance woi, String key) throws WorkflowOperationException {
 for (final String cfg : getOptConfig(woi, key)) {
  return cfg;
 }
 throw new WorkflowOperationException(format("Configuration key '%s' is either missing or empty", key));
}

代码示例来源:origin: opencast/opencast

@Override public A apply() {
  return chuck(new WorkflowOperationException(key + " is missing or malformed"));
 }
};

代码示例来源:origin: opencast/opencast

/**
 * Log data to directory if set, otherwise use the system logger.
 *
 * @param data
 *          Data to log
 * @param directory
 *          Directory to log to. If set to null, the default logger is used.
 * @param filename
 *          Filename to write the data to. Used by internal logger as well.
 * @throws WorkflowOperationException
 *          In case the data could not be written
 */
private void saveOrLog(final String data, final File directory, final String filename)
    throws WorkflowOperationException {
 // Write to directory if set
 if (directory != null) {
  File file = new File(directory, filename);
  try {
   logger.info("Logging current workflow state to to {}", file.getAbsolutePath());
   FileUtils.writeStringToFile(file, data, Charset.defaultCharset());
  } catch (IOException e) {
   throw new WorkflowOperationException(e);
  }
 } else {
  // …otherwise, just use the logger
  logger.info("({}):\n{}", filename, data);
 }
}

代码示例来源:origin: opencast/opencast

request = new HttpPut(urlPath);
} else {
 throw new WorkflowOperationException("The configuration key '" + OPT_METHOD + "' only supports 'post' and 'put'");
 throw new WorkflowOperationException("Error encoding the event parameter as form parameter", e);
 throw new WorkflowOperationException(format("Notification could not be delivered to %s", urlPath));

代码示例来源:origin: opencast/opencast

@Override
public WorkflowOperationResult start(WorkflowInstance wi, JobContext ctx) throws WorkflowOperationException {
 final WorkflowOperationInstance woi = wi.getCurrentOperation();
 final int code = option(woi.getConfiguration(OPT_CODE)).bind(Strings.toInt).getOrElse(1);
 final Severity severity = option(woi.getConfiguration(OPT_SEVERITY)).bind(parseEnum(Severity.FAILURE)).getOrElse(Severity.INFO);
 final List<Tuple<String, String>> details = Arrays.stream(ArrayUtils.nullToEmpty(
     StringUtils.split(woi.getConfiguration(OPT_DETAILS), ";")))
     .map((opt) -> opt.split("="))
     .filter((t) -> t.length == 2)
     .map((x) -> Tuple.tuple(x[0], x[1]))
     .collect(Collectors.toList());
 final Map<String, String> params = Arrays.stream(ArrayUtils.nullToEmpty(
     StringUtils.split(woi.getConfiguration(OPT_PARAMS), ";")))
     .map((opt) -> opt.split("="))
     .filter((t) -> t.length == 2)
     .collect(Collectors.toMap(x -> x[0], x -> x[1]));
 log.info("Create nop job");
 final Job job = nopService.nop();
 log.info("Log a dummy incident with code %d", code);
 serviceRegistry.incident().record(job, severity, code, params, details);
 if (!waitForStatus(job).isSuccess()) {
  throw new WorkflowOperationException("Job did not complete successfully");
 } else {
  return createResult(WorkflowOperationResult.Action.CONTINUE);
 }
}

代码示例来源:origin: opencast/opencast

throw new WorkflowOperationException("No source tag or flavor have been specified!");
 elementSelector.addFlavor(MediaPackageElementFlavor.parseFlavor(flavor));
} catch (IllegalArgumentException e) {
 throw new WorkflowOperationException("Source flavor '" + flavor + "' is malformed");
 throw new WorkflowOperationException(e);
throw new WorkflowOperationException("Transcription job did not complete successfully");

代码示例来源:origin: opencast/opencast

throw new WorkflowOperationException(TRANSCRIPTION_JOB_ID + " missing");
 throw new WorkflowOperationException(TARGET_FLAVOR + " missing");
  Job job = captionService.convert(transcription, "ibm-watson", captionFormatOption, service.getLanguage());
  if (!waitForStatus(job).isSuccess()) {
   throw new WorkflowOperationException("Transcription format conversion job did not complete successfully");
     transcription.getIdentifier(), "captions." + ext));
} catch (Exception e) {
 throw new WorkflowOperationException(e);

代码示例来源:origin: opencast/opencast

workflowInstance.getCurrentOperation().getConfiguration(SOURCE_TAGS_PROPERTY));
if (StringUtils.isEmpty(sourceFlavorProperty) && StringUtils.isEmpty(sourceTagsProperty)) {
 throw new WorkflowOperationException(String.format("Required property %s or %s not set",
     SOURCE_FLAVOR_PROPERTY, SOURCE_TAGS_PROPERTY));
    workflowInstance.getCurrentOperation().getConfiguration(TARGET_FLAVOR_PROPERTY));
if (targetFlavorProperty == null) {
 throw new WorkflowOperationException(String.format("Required property %s not set", TARGET_FLAVOR_PROPERTY));
if (!waitForStatus(timelinepreviewsJobs.toArray(new Job[timelinepreviewsJobs.size()])).isSuccess()) {
 cleanupWorkspace(timelinepreviewsJobs);
 throw new WorkflowOperationException(
     String.format("Timeline previews jobs for media package '%s' have not completed successfully",
         mediaPackage.getIdentifier().compact()));
    throw new WorkflowOperationException("Can't parse timeline previews attachment from job " + job.getId());
   } catch (NotFoundException ex) {
    throw new WorkflowOperationException("Timeline preview images file '" + timelinePreviewsMpe.getURI()
        + "' not found", ex);
   } catch (IOException ex) {
    throw new WorkflowOperationException("Can't get workflow image file '" + timelinePreviewsMpe.getURI()
        + "' from workspace");
    timelinePreviewsMpe.setURI(timelinePreviewsWfrUri);
   } catch (FileNotFoundException ex) {
    throw new WorkflowOperationException("Timeline preview images file " + timelinePreviewsFile.getPath()
        + " not found", ex);
   } catch (IOException ex) {
    throw new WorkflowOperationException("Can't read just created timeline preview images file "

代码示例来源:origin: opencast/opencast

String sourceTagsProperty = StringUtils.trimToNull(workflowInstance.getCurrentOperation().getConfiguration(SOURCE_TAGS_PROPERTY));
if (StringUtils.isEmpty(sourceFlavorProperty) && StringUtils.isEmpty(sourceTagsProperty)) {
 throw new WorkflowOperationException(
     String.format("Required property %s or %s not set", SOURCE_FLAVOR_PROPERTY, SOURCE_TAGS_PROPERTY));
 throw new WorkflowOperationException(String.format("Required property %s not set", TARGET_FLAVOR_PROPERTY));
  throw new WorkflowOperationException(String.format("Waveform extraction jobs for media package '%s' have not completed successfully",
      mediaPackage.getIdentifier()));
  } catch (MediaPackageException ex) {
   throw new WorkflowOperationException("Can't parse waveform attachment from job " + job.getId());
  } catch (NotFoundException ex) {
   throw new WorkflowOperationException("Waveform image file '" + waveformMpe.getURI() + "' not found", ex);
  } catch (IOException ex) {
   throw new WorkflowOperationException("Can't get workflow image file '" + waveformMpe.getURI() + "' from workspace");
  workspace.cleanup(mediaPackage.getIdentifier(), true);
 } catch (IOException e) {
  throw new WorkflowOperationException(e);

代码示例来源:origin: opencast/opencast

FileUtils.forceMkdir(directory);
} catch (IOException e) {
 throw new WorkflowOperationException(String.format("Failed to create output directory '%s'", directoryPath), e);
 saveOrLog(WorkflowParser.toXml(workflowInstance), directory, filename);
} catch (WorkflowParsingException e) {
 throw new WorkflowOperationException(e);

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com