本文整理了Java中org.opencastproject.job.api.Job.getArguments()
方法的一些代码示例,展示了Job.getArguments()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Job.getArguments()
方法的具体详情如下:
包路径:org.opencastproject.job.api.Job
类名称:Job
方法名:getArguments
[英]The arguments passed to the service and operation. Each argument must be serializable to a string.
[中]传递给服务和操作的参数。每个参数必须可序列化为字符串。
代码示例来源:origin: opencast/opencast
List<String> arguments = job.getArguments();
URI animation = new URI(arguments.get(0));
Gson gson = new Gson();
代码示例来源:origin: opencast/opencast
/**
* {@inheritDoc}
*
* @see org.opencastproject.job.api.AbstractJobProducer#process(org.opencastproject.job.api.Job)
*/
@Override
protected String process(Job job) throws Exception {
Operation op = null;
String operation = job.getOperation();
List<String> arguments = job.getArguments();
try {
op = Operation.valueOf(operation);
switch (op) {
case Waveform:
Track track = (Track) MediaPackageElementParser.getFromXml(arguments.get(0));
int pixelsPerMinute = Integer.parseInt(arguments.get(1));
int minWidth = Integer.parseInt(arguments.get(2));
int maxWidth = Integer.parseInt(arguments.get(3));
int height = Integer.parseInt(arguments.get(4));
Attachment waveformMpe = extractWaveform(track, pixelsPerMinute, minWidth, maxWidth, height);
return MediaPackageElementParser.getAsXml(waveformMpe);
default:
throw new ServiceRegistryException("This service can't handle operations of type '" + op + "'");
}
} catch (IndexOutOfBoundsException e) {
throw new ServiceRegistryException("This argument list for operation '" + op + "' does not meet expectations", e);
} catch (MediaPackageException | WaveformServiceException e) {
throw new ServiceRegistryException("Error handling operation '" + op + "'", e);
}
}
代码示例来源:origin: opencast/opencast
Operation op = null;
String operation = job.getOperation();
List<String> arguments = job.getArguments();
try {
op = Operation.valueOf(operation);
代码示例来源:origin: opencast/opencast
/**
* {@inheritDoc}
*
* @see org.opencastproject.job.api.AbstractJobProducer#process(org.opencastproject.job.api.Job)
*/
@Override
protected String process(Job job) throws Exception {
Operation op = null;
String operation = job.getOperation();
List<String> arguments = job.getArguments();
try {
op = Operation.valueOf(operation);
switch (op) {
case TimelinePreview:
Track track = (Track) MediaPackageElementParser
.getFromXml(arguments.get(0));
int imageCount = Integer.parseInt(arguments.get(1));
Attachment timelinePreviewsMpe = generatePreviewImages(job, track, imageCount);
return MediaPackageElementParser.getAsXml(timelinePreviewsMpe);
default:
throw new IllegalStateException("Don't know how to handle operation '" + operation + "'");
}
} catch (IllegalArgumentException e) {
throw new ServiceRegistryException("This service can't handle operations of type '" + op + "'", e);
} catch (IndexOutOfBoundsException e) {
throw new ServiceRegistryException("This argument list for operation '" + op + "' does not meet expectations", e);
} catch (Exception e) {
throw new ServiceRegistryException("Error handling operation '" + op + "'", e);
}
}
代码示例来源:origin: opencast/opencast
Operation op = null;
String operation = job.getOperation();
List<String> arguments = job.getArguments();
try {
op = Operation.valueOf(operation);
代码示例来源:origin: opencast/opencast
public JaxbJob(Job job) {
this();
this.id = job.getId();
this.dateCompleted = job.getDateCompleted();
this.dateCreated = job.getDateCreated();
this.dateStarted = job.getDateStarted();
this.queueTime = job.getQueueTime();
this.runTime = job.getRunTime();
this.version = job.getVersion();
this.payload = job.getPayload();
this.processingHost = job.getProcessingHost();
this.createdHost = job.getCreatedHost();
this.id = job.getId();
this.jobType = job.getJobType();
this.operation = job.getOperation();
if (job.getArguments() != null)
this.arguments = unmodifiableList(job.getArguments());
this.status = job.getStatus();
this.parentJobId = job.getParentJobId();
this.rootJobId = job.getRootJobId();
this.dispatchable = job.isDispatchable();
this.uri = job.getUri();
this.creator = job.getCreator();
this.organization = job.getOrganization();
this.jobLoad = job.getJobLoad();
if (job.getBlockedJobIds() != null)
this.blockedJobIds = unmodifiableList(job.getBlockedJobIds());
this.blockingJobId = job.getBlockingJobId();
}
代码示例来源:origin: opencast/opencast
fromDb.setVersion(job.getVersion());
fromDb.setOperation(job.getOperation());
fromDb.setArguments(job.getArguments());
fromDb.setBlockedJobIds(job.getBlockedJobIds());
fromDb.setBlockingJobId(job.getBlockingJobId());
代码示例来源:origin: opencast/opencast
public static JpaJob from(Job job) {
JpaJob newJob = new JpaJob();
newJob.id = job.getId();
newJob.dateCompleted = job.getDateCompleted();
newJob.dateCreated = job.getDateCreated();
newJob.dateStarted = job.getDateStarted();
newJob.queueTime = job.getQueueTime();
newJob.runTime = job.getRunTime();
newJob.version = job.getVersion();
newJob.payload = job.getPayload();
newJob.jobType = job.getJobType();
newJob.operation = job.getOperation();
newJob.arguments = job.getArguments();
newJob.status = job.getStatus().ordinal();
newJob.parentJobId = job.getParentJobId();
newJob.rootJobId = job.getRootJobId();
newJob.dispatchable = job.isDispatchable();
newJob.uri = job.getUri();
newJob.creator = job.getCreator();
newJob.organization = job.getOrganization();
newJob.jobLoad = job.getJobLoad();
newJob.blockedJobIds = job.getBlockedJobIds();
newJob.blockingJobId = job.getBlockingJobId();
return newJob;
}
内容来源于网络,如有侵权,请联系作者删除!