/** * Initializes the internal FIFO queue with publish jobs from the database.<p> */ protected void initialize() { CmsDriverManager driverManager = m_publishEngine.getDriverManager(); CmsDbContext dbc = m_publishEngine.getDbContext(null); try { OpenCms.getMemoryMonitor().flushCache(CmsMemoryMonitor.CacheType.PUBLISH_HISTORY); // read all finished published jobs from the database List<CmsPublishJobInfoBean> publishJobs = driverManager.readPublishJobs(dbc, 1L, Long.MAX_VALUE); for (Iterator<CmsPublishJobInfoBean> i = publishJobs.iterator(); i.hasNext();) { CmsPublishJobInfoBean job = i.next(); OpenCms.getMemoryMonitor().cachePublishJobInHistory(job); } } catch (CmsException exc) { dbc.rollback(); if (LOG.isErrorEnabled()) { LOG.error(exc.getLocalizedMessage(), exc); } } finally { dbc.clear(); } }
/** * Initializes the internal FIFO queue with publish jobs from the database.<p> */ protected void initialize() { CmsDriverManager driverManager = m_publishEngine.getDriverManager(); CmsDbContext dbc = m_publishEngine.getDbContextFactory().getDbContext(); try { OpenCms.getMemoryMonitor().flushCache(CmsMemoryMonitor.CacheType.PUBLISH_HISTORY); // read all finished published jobs from the database List publishJobs = driverManager.readPublishJobs(dbc, 1L, Long.MAX_VALUE); for (Iterator i = publishJobs.iterator(); i.hasNext();) { CmsPublishJobInfoBean job = (CmsPublishJobInfoBean)i.next(); OpenCms.getMemoryMonitor().cachePublishJobInHistory(job); } } catch (CmsException exc) { if (LOG.isErrorEnabled()) { LOG.error(exc.getLocalizedMessage(), exc); } } finally { dbc.clear(); } }
/** * Updates the given job in the list.<p> * * @param publishJob the publish job to */ protected void update(CmsPublishJobInfoBean publishJob) { if (OpenCms.getMemoryMonitor().requiresPersistency()) { CmsDbContext dbc = m_publishEngine.getDbContextFactory().getDbContext(); try { m_publishEngine.getDriverManager().writePublishJob(dbc, publishJob); } catch (CmsException e) { if (LOG.isErrorEnabled()) { LOG.error(e.getLocalizedMessage(), e); } } finally { dbc.clear(); } } } }
/** * Updates the given job in the list.<p> * * @param publishJob the publish job to */ protected void update(CmsPublishJobInfoBean publishJob) { if (OpenCms.getMemoryMonitor().requiresPersistency()) { CmsDbContext dbc = m_publishEngine.getDbContext(null); try { m_publishEngine.getDriverManager().writePublishJob(dbc, publishJob); } catch (CmsException e) { dbc.rollback(); if (LOG.isErrorEnabled()) { LOG.error(e.getLocalizedMessage(), e); } } finally { dbc.clear(); } } } }
/** * Adds the given publish job to the list.<p> * * @param publishJob the publish job object to add * * @throws CmsException if something goes wrong */ protected void add(CmsPublishJobInfoBean publishJob) throws CmsException { OpenCms.getMemoryMonitor().cachePublishJobInHistory(publishJob); // write job to db if necessary if (OpenCms.getMemoryMonitor().requiresPersistency()) { CmsDbContext dbc = m_publishEngine.getDbContextFactory().getDbContext(); try { m_publishEngine.getDriverManager().writePublishJob(dbc, publishJob); // additionally, write the publish report m_publishEngine.getDriverManager().writePublishReport(dbc, publishJob); // delete publish list of started job m_publishEngine.getDriverManager().deletePublishList(dbc, publishJob.getPublishHistoryId()); } finally { dbc.clear(); } } }
/** * Adds the given publish job to the list.<p> * * @param publishJob the publish job object to add * * @throws CmsException if something goes wrong */ protected void add(CmsPublishJobInfoBean publishJob) throws CmsException { OpenCms.getMemoryMonitor().cachePublishJobInHistory(publishJob); // write job to db if necessary if (OpenCms.getMemoryMonitor().requiresPersistency()) { CmsDbContext dbc = m_publishEngine.getDbContext(null); try { m_publishEngine.getDriverManager().writePublishJob(dbc, publishJob); // additionally, write the publish report m_publishEngine.getDriverManager().writePublishReport(dbc, publishJob); // delete publish list of started job m_publishEngine.getDriverManager().deletePublishList(dbc, publishJob.getPublishHistoryId()); } catch (CmsException e) { dbc.rollback(); LOG.error(e.getLocalizedMessage(), e); throw e; } finally { dbc.clear(); } } }
/** * Pushes a new publish job with the given information in publish queue.<p> * * If possible, the publish job starts immediately.<p> * * @param publishJob the publish job to enqueue * * @throws CmsException if something goes wrong */ protected void add(CmsPublishJobInfoBean publishJob) throws CmsException { // set the queue status in the publish job publishJob.enqueue(); // add job to database if necessary if (OpenCms.getMemoryMonitor().requiresPersistency()) { CmsDbContext dbc = m_publishEngine.getDbContext(null); try { // this operation may in rare circumstances fail with a DB exception // if this is the case the publish job must NOT be in the queue m_publishEngine.getDriverManager().createPublishJob(dbc, publishJob); } catch (CmsException e) { dbc.rollback(); LOG.error(e.getLocalizedMessage(), e); throw e; } finally { dbc.clear(); } } // add publish job to cache OpenCms.getMemoryMonitor().cachePublishJob(publishJob); }
CmsDriverManager driverManager = m_publishEngine.getDriverManager(); job.getPublishHistoryId()), exc); m_publishEngine.getDriverManager().deletePublishJob(dbc, job.getPublishHistoryId()); } finally { dbc.clear();
/** * Removes the given job from the list.<p> * * @param publishJob the publish job to remove * * @throws CmsException if something goes wrong */ protected void remove(CmsPublishJobInfoBean publishJob) throws CmsException { try { // signalizes that job will be removed m_publishEngine.publishJobRemoved(publishJob); } finally { // remove publish job from cache OpenCms.getMemoryMonitor().uncachePublishJob(publishJob); } // remove job from database if necessary if (OpenCms.getMemoryMonitor().requiresPersistency()) { CmsDbContext dbc = m_publishEngine.getDbContext(null); try { m_publishEngine.getDriverManager().deletePublishJob(dbc, publishJob.getPublishHistoryId()); } catch (CmsException e) { dbc.rollback(); LOG.error(e.getLocalizedMessage(), e); throw e; } finally { dbc.clear(); } } }
CmsDriverManager driverManager = m_publishEngine.getDriverManager(); exc); m_publishEngine.getDriverManager().deletePublishJob(dbc, job.getPublishHistoryId()); } finally { dbc.clear();
/** * Removes the given job from the list.<p> * * @param publishJob the publish job to remove * * @throws CmsException if something goes wrong */ protected void remove(CmsPublishJobInfoBean publishJob) throws CmsException { OpenCms.getMemoryMonitor().uncachePublishJobInHistory(publishJob); // delete job from db if necessary if (OpenCms.getMemoryMonitor().requiresPersistency()) { CmsDbContext dbc = m_publishEngine.getDbContext(null); try { OpenCms.getPublishManager().getEngine().getDriverManager().deletePublishJob( dbc, publishJob.getPublishHistoryId()); } catch (CmsException e) { dbc.rollback(); LOG.error(e.getLocalizedMessage(), e); throw e; } finally { dbc.clear(); } } m_publishEngine.publishJobRemoved(publishJob); } }
/** * Pushes a new publish job with the given information in publish queue.<p> * * If possible, the publish job starts immediately.<p> * * @param publishJob the publish job to enqueue * * @throws CmsException if something goes wrong */ protected void add(CmsPublishJobInfoBean publishJob) throws CmsException { // set the queue status in the publish job publishJob.enqueue(); // add job to database if necessary if (OpenCms.getMemoryMonitor().requiresPersistency()) { CmsDbContext dbc = m_publishEngine.getDbContextFactory().getDbContext(); try { // this operation may in rare circumstances fail with a DB exception // if this is the case the publish job must NOT be in the queue m_publishEngine.getDriverManager().createPublishJob(dbc, publishJob); } finally { dbc.clear(); } } // add publish job to cache OpenCms.getMemoryMonitor().cachePublishJob(publishJob); }
/** * Removes the given job from the list.<p> * * @param publishJob the publish job to remove * * @throws CmsException if something goes wrong */ protected void remove(CmsPublishJobInfoBean publishJob) throws CmsException { try { // signalizes that job will be removed m_publishEngine.publishJobRemoved(publishJob); } finally { // remove publish job from cache OpenCms.getMemoryMonitor().uncachePublishJob(publishJob); } // remove job from database if necessary if (OpenCms.getMemoryMonitor().requiresPersistency()) { CmsDbContext dbc = m_publishEngine.getDbContextFactory().getDbContext(); try { m_publishEngine.getDriverManager().deletePublishJob(dbc, publishJob.getPublishHistoryId()); } finally { dbc.clear(); } } }
/** * Removes the given job from the list.<p> * * @param publishJob the publish job to remove * * @throws CmsException if something goes wrong */ protected void remove(CmsPublishJobInfoBean publishJob) throws CmsException { OpenCms.getMemoryMonitor().uncachePublishJobInHistory(publishJob); // delete job from db if necessary if (OpenCms.getMemoryMonitor().requiresPersistency()) { CmsDbContext dbc = m_publishEngine.getDbContextFactory().getDbContext(); try { OpenCms.getPublishManager().getEngine().getDriverManager().deletePublishJob( dbc, publishJob.getPublishHistoryId()); } finally { dbc.clear(); } } m_publishEngine.publishJobRemoved(publishJob); } }
try { m_publishEngine.getDriverManager().publishJob(getCms(), dbc, m_publishJob.getPublishList(), m_report); } catch (Throwable e) {
try { m_publishEngine.getDriverManager().publishJob(getCms(), dbc, m_publishJob.getPublishList(), m_report);