Search in sources :

Example 1 with BundleJobGetCoordinatorsJPAExecutor

use of org.apache.oozie.executor.jpa.BundleJobGetCoordinatorsJPAExecutor in project oozie by apache.

the class BundleJobXCommand method execute.

/* (non-Javadoc)
     * @see org.apache.oozie.command.XCommand#execute()
     */
@Override
protected BundleJobBean execute() throws CommandException {
    try {
        JPAService jpaService = Services.get().get(JPAService.class);
        BundleJobBean bundleJob = null;
        if (jpaService != null) {
            bundleJob = jpaService.execute(new BundleJobGetJPAExecutor(id));
            List<CoordinatorJobBean> coordinators = jpaService.execute(new BundleJobGetCoordinatorsJPAExecutor(id));
            bundleJob.setCoordJobs(coordinators);
        } else {
            LOG.error(ErrorCode.E0610);
        }
        return bundleJob;
    } catch (XException ex) {
        throw new CommandException(ex);
    }
}
Also used : BundleJobGetJPAExecutor(org.apache.oozie.executor.jpa.BundleJobGetJPAExecutor) CoordinatorJobBean(org.apache.oozie.CoordinatorJobBean) BundleJobBean(org.apache.oozie.BundleJobBean) XException(org.apache.oozie.XException) CommandException(org.apache.oozie.command.CommandException) JPAService(org.apache.oozie.service.JPAService) BundleJobGetCoordinatorsJPAExecutor(org.apache.oozie.executor.jpa.BundleJobGetCoordinatorsJPAExecutor)

Aggregations

BundleJobBean (org.apache.oozie.BundleJobBean)1 CoordinatorJobBean (org.apache.oozie.CoordinatorJobBean)1 XException (org.apache.oozie.XException)1 CommandException (org.apache.oozie.command.CommandException)1 BundleJobGetCoordinatorsJPAExecutor (org.apache.oozie.executor.jpa.BundleJobGetCoordinatorsJPAExecutor)1 BundleJobGetJPAExecutor (org.apache.oozie.executor.jpa.BundleJobGetJPAExecutor)1 JPAService (org.apache.oozie.service.JPAService)1