Search in sources :

Example 6 with TaskMaintenanceOutDto

use of org.jaffa.modules.scheduler.components.taskmaintenance.dto.TaskMaintenanceOutDto in project jaffa-framework by jaffa-projects.

the class TaskMaintenanceTx method retrieve.

/**
 * Returns the details for Task.
 * @param input The criteria based on which an object will be retrieved.
 * @throws ApplicationExceptions This will be thrown if the criteria contains invalid data.
 * @throws FrameworkException Indicates some system error.
 * @return The object details. A null indicates, the object was not found.
 */
public TaskMaintenanceOutDto retrieve(TaskMaintenanceDto input) throws FrameworkException, ApplicationExceptions {
    if (log.isDebugEnabled())
        log.debug("Input to retrieve(): " + input);
    // Retrieve the task
    ScheduledTask task = SchedulerHelperFactory.instance().getTask(input.getScheduledTaskId());
    if (task == null)
        throw new ApplicationExceptions(new JaffaSchedulerApplicationException(JaffaSchedulerApplicationException.TASK_NOT_FOUND, new Object[] { input.getScheduledTaskId() }));
    // Mold the task into the TaskMaintenanceDto
    TaskMaintenanceOutDto output = buildRetrieveOutDto(task);
    if (log.isDebugEnabled())
        log.debug("Output from retrieve(): " + output);
    return output;
}
Also used : ApplicationExceptions(org.jaffa.exceptions.ApplicationExceptions) JaffaSchedulerApplicationException(org.jaffa.modules.scheduler.services.JaffaSchedulerApplicationException) ScheduledTask(org.jaffa.modules.scheduler.services.ScheduledTask) TaskMaintenanceOutDto(org.jaffa.modules.scheduler.components.taskmaintenance.dto.TaskMaintenanceOutDto)

Aggregations

TaskMaintenanceOutDto (org.jaffa.modules.scheduler.components.taskmaintenance.dto.TaskMaintenanceOutDto)6 ApplicationExceptions (org.jaffa.exceptions.ApplicationExceptions)1 TaskMaintenanceDto (org.jaffa.modules.scheduler.components.taskmaintenance.dto.TaskMaintenanceDto)1 JaffaSchedulerApplicationException (org.jaffa.modules.scheduler.services.JaffaSchedulerApplicationException)1 ScheduledTask (org.jaffa.modules.scheduler.services.ScheduledTask)1