Class MediaConversionJob
- java.lang.Object
-
- de.hybris.platform.mediaconversion.job.MediaConversionJob
-
- All Implemented Interfaces:
JobPerformable<MediaConversionCronJobModel>
,TaskRunner<TaskModel>
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanNameAware
public class MediaConversionJob extends java.lang.Object implements org.springframework.beans.factory.BeanNameAware, TaskRunner<TaskModel>
-
-
Constructor Summary
Constructors Constructor Description MediaConversionJob()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
convert(MediaContainerModel container, ConversionMediaFormatModel format)
protected void
convertAsynchronous(MediaConversionCronJobModel cronJob, PK containerPk, java.util.Set<PK> formatPks)
protected void
convertSynchronous(MediaConversionCronJobModel cronJob, PK containerPK, java.util.Set<PK> formatPks)
java.lang.String
getBeanName()
MediaConversionJobDao
getDao()
MediaConversionService
getMediaConversionService()
ModelService
getModelService()
TaskService
getTaskService()
void
handleError(TaskService tServ, TaskModel task, java.lang.Throwable error)
Does nothing except logging the error.boolean
isAbortable()
Checks whether the execution is implemented abortable.boolean
isPerformable()
Checks whether the execution can be performed at the moment.PerformResult
perform(T cronJob)
The execution body for aServicelayerJob
.void
run(TaskService taskService, TaskModel task)
void
setBeanName(java.lang.String beanName)
void
setDao(MediaConversionJobDao dao)
void
setMediaConversionService(MediaConversionService service)
void
setModelService(ModelService modelService)
void
setTaskService(TaskService taskService)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.hybris.platform.task.TaskRunner
initLoggingCtx, isLoggingSupported, stopLoggingCtx
-
-
-
-
Method Detail
-
handleError
public void handleError(TaskService tServ, TaskModel task, java.lang.Throwable error)
Does nothing except logging the error.- Specified by:
handleError
in interfaceTaskRunner<TaskModel>
- See Also:
TaskRunner.handleError(TaskService, TaskModel, Throwable)
-
run
public void run(TaskService taskService, TaskModel task) throws RetryLaterException
- Specified by:
run
in interfaceTaskRunner<TaskModel>
- Throws:
RetryLaterException
-
isPerformable
public boolean isPerformable()
Description copied from interface:JobPerformable
Checks whether the execution can be performed at the moment.- Specified by:
isPerformable
in interfaceJobPerformable<MediaConversionCronJobModel>
- Returns:
- true if the execution is ready
-
convertSynchronous
protected void convertSynchronous(MediaConversionCronJobModel cronJob, PK containerPK, java.util.Set<PK> formatPks)
-
convertAsynchronous
protected void convertAsynchronous(MediaConversionCronJobModel cronJob, PK containerPk, java.util.Set<PK> formatPks)
-
convert
protected void convert(MediaContainerModel container, ConversionMediaFormatModel format)
-
getTaskService
public TaskService getTaskService()
-
setTaskService
public void setTaskService(TaskService taskService)
-
getBeanName
public java.lang.String getBeanName()
-
setBeanName
public void setBeanName(java.lang.String beanName)
- Specified by:
setBeanName
in interfaceorg.springframework.beans.factory.BeanNameAware
-
getMediaConversionService
public MediaConversionService getMediaConversionService()
-
setMediaConversionService
public void setMediaConversionService(MediaConversionService service)
-
getDao
public MediaConversionJobDao getDao()
- Returns:
- the dao
-
setDao
public void setDao(MediaConversionJobDao dao)
- Parameters:
dao
- the dao to set
-
perform
public PerformResult perform(T cronJob)
Description copied from interface:JobPerformable
The execution body for aServicelayerJob
. Implement here your execution logic. It can be called synchronous or asynchronous. So be aware of thread-safety. Method will return a result object saying if the execution has reached end and if it was successful.- Specified by:
perform
in interfaceJobPerformable<T extends AbstractMediaCronJobModel>
- Parameters:
cronJob
- the related CronJob in whose context the execution will be performed.- Returns:
- a
PerformResult
that indicates whether theexecution
was successfully executed or not and has finished or not.
-
isAbortable
public boolean isAbortable()
Description copied from interface:JobPerformable
Checks whether the execution is implemented abortable.- Specified by:
isAbortable
in interfaceJobPerformable<T extends AbstractMediaCronJobModel>
- Returns:
- true if the execution can be aborted
-
getModelService
public ModelService getModelService()
-
setModelService
public void setModelService(ModelService modelService)
-
-