boolean busyStart = ((System.currentTimeMillis() - publishJob.getEnqueueTime()) > 2000); boolean bigJob = ((publishJob.getPublishList().size() > 25) || (OpenCms.getStaticExportManager().getHandler() instanceof CmsAfterPublishStaticExportHandler)); if (busyStart || bigJob) { String msgText = Messages.get().getBundle(publishJob.getLocale()).key( Messages.GUI_PUBLISH_JOB_STARTED_1, new Long(publishJob.getEnqueueTime())); m_publishEngine.sendMessage(publishJob.getUserId(), msgText, false);
/** * Returns an unmodifiable list representation of this queue.<p> * * @return a list of {@link CmsPublishJobEnqueued} objects */ protected List<CmsPublishJobEnqueued> asList() { List<CmsPublishJobInfoBean> cachedPublishJobs = OpenCms.getMemoryMonitor().getAllCachedPublishJobs(); List<CmsPublishJobEnqueued> result = new ArrayList<CmsPublishJobEnqueued>(cachedPublishJobs.size()); Iterator<CmsPublishJobInfoBean> it = cachedPublishJobs.iterator(); while (it.hasNext()) { CmsPublishJobInfoBean publishJob = it.next(); result.add(new CmsPublishJobEnqueued(publishJob)); } return Collections.unmodifiableList(result); }
if ((userId != null) && userId.equals(publishJob.getUserId())) { String msgText = Messages.get().getBundle(publishJob.getLocale()).key( Messages.GUI_PUBLISH_JOB_ABORTED_2, new Long(publishJob.getEnqueueTime()), m_publishEngine.getUser(userId).getName()); m_publishEngine.sendMessage(publishJob.getUserId(), msgText, true);
while (iter.hasNext()) { CmsPublishJobEnqueued publishJob = (CmsPublishJobEnqueued)iter.next(); CmsListItem item = getList().newItem(publishJob.getPublishList().getPublishHistoryId().toString()); if (!publishJob.getUserId().equals(getCms().getRequestContext().getCurrentUser().getId())) { state = STATE_OTHER; item.set(LIST_COLUMN_PROJECT, publishJob.getProjectName()); item.set(LIST_COLUMN_STARTTIME, new Date(publishJob.getEnqueueTime())); item.set(LIST_COLUMN_USER, publishJob.getUserName(getCms())); item.set(LIST_COLUMN_RESCOUNT, new Integer(publishJob.getSize())); ret.add(item); number++;
while (itEnqueuedJobs.hasNext()) { CmsPublishJobEnqueued enqueuedJob = (CmsPublishJobEnqueued)itEnqueuedJobs.next(); if (enqueuedJob.getPublishList().getPublishHistoryId().equals(publishHistoryId)) { return enqueuedJob;
while (itJobs.hasNext()) { CmsPublishJobEnqueued publishJob = (CmsPublishJobEnqueued)itJobs.next(); if (userName.equals(publishJob.getUserName(getCms())) && (enqueueTime == publishJob.getEnqueueTime())) { try { OpenCms.getPublishManager().abortPublishJob(getCms(), publishJob, true);
/** * Aborts the given publish job.<p> * * @param cms the cms context * @param publishJob the publish job to abort * @param removeJob indicates if the job will be removed or added to history * * @throws CmsException if there is some problem during unlocking the resources * @throws CmsSecurityException if the current user has not enough permissions * @throws CmsPublishException if the publish job can not been aborted */ public void abortPublishJob(CmsObject cms, CmsPublishJobEnqueued publishJob, boolean removeJob) throws CmsException, CmsSecurityException, CmsPublishException { if (!OpenCms.getRoleManager().hasRole(cms, CmsRole.PROJECT_MANAGER) && !cms.getRequestContext().currentUser().getId().equals(publishJob.getUserId())) { // Can only be executed by somebody with the role CmsRole#PROJECT_MANAGER or the owner of the job throw new CmsSecurityException(Messages.get().container( Messages.ERR_PUBLISH_ENGINE_ABORT_DENIED_1, cms.getRequestContext().currentUser().getName())); } m_publishEngine.abortPublishJob(cms.getRequestContext().currentUser().getId(), publishJob, removeJob); }
if ((userId != null) && userId.equals(publishJob.getUserId())) { String msgText = Messages.get().getBundle(publishJob.getLocale()).key( Messages.GUI_PUBLISH_JOB_ABORTED_2, new Long(publishJob.getEnqueueTime()), m_publishEngine.getUser(userId).getName()); m_publishEngine.sendMessage(publishJob.getUserId(), msgText, true);
while (itEnqueuedJobs.hasNext()) { CmsPublishJobEnqueued enqueuedJob = itEnqueuedJobs.next(); if (enqueuedJob.getPublishList().getPublishHistoryId().equals(publishHistoryId)) { return enqueuedJob;
/** * Aborts the given publish job.<p> * * @param cms the cms context * @param publishJob the publish job to abort * @param removeJob indicates if the job will be removed or added to history * * @throws CmsException if there is some problem during unlocking the resources * @throws CmsSecurityException if the current user has not enough permissions * @throws CmsPublishException if the publish job can not been aborted */ public void abortPublishJob(CmsObject cms, CmsPublishJobEnqueued publishJob, boolean removeJob) throws CmsException, CmsSecurityException, CmsPublishException { if (!OpenCms.getRoleManager().hasRole(cms, CmsRole.PROJECT_MANAGER) && !cms.getRequestContext().getCurrentUser().getId().equals(publishJob.getUserId())) { // Can only be executed by somebody with the role CmsRole#PROJECT_MANAGER or the owner of the job throw new CmsSecurityException( Messages.get().container( Messages.ERR_PUBLISH_ENGINE_ABORT_DENIED_1, cms.getRequestContext().getCurrentUser().getName())); } m_publishEngine.abortPublishJob(cms.getRequestContext().getCurrentUser().getId(), publishJob, removeJob); }
boolean busyStart = ((System.currentTimeMillis() - publishJob.getEnqueueTime()) > 2000); boolean bigJob = ((publishJob.getPublishList().size() > 25) || (OpenCms.getStaticExportManager().getHandler() instanceof CmsAfterPublishStaticExportHandler)); if (busyStart || bigJob) { String msgText = Messages.get().getBundle(publishJob.getLocale()).key( Messages.GUI_PUBLISH_JOB_STARTED_1, new Long(publishJob.getEnqueueTime())); m_publishEngine.sendMessage(publishJob.getUserId(), msgText, false);
publishList = ((CmsPublishJobEnqueued)publishJob).getPublishList(); } else if (publishJob instanceof CmsPublishJobRunning) { publishList = ((CmsPublishJobRunning)publishJob).getPublishList();
/** * Returns an unmodifiable list representation of this queue.<p> * * @return a list of {@link CmsPublishJobEnqueued} objects */ protected List asList() { List cachedPublishJobs = OpenCms.getMemoryMonitor().getAllCachedPublishJobs(); List result = new ArrayList(cachedPublishJobs.size()); Iterator it = cachedPublishJobs.iterator(); while (it.hasNext()) { CmsPublishJobInfoBean publishJob = (CmsPublishJobInfoBean)it.next(); result.add(new CmsPublishJobEnqueued(publishJob)); } return Collections.unmodifiableList(result); }
if (publishJob.getPublishList() != null) { unlockPublishList(publishJob.m_publishJob);
/** * Signalizes that the publish thread starts.<p> * * @param publishJob the started publish job */ protected void publishJobStarted(CmsPublishJobInfoBean publishJob) { // update the job m_publishQueue.update(publishJob); // fire the publish start event m_listeners.fireStart(new CmsPublishJobEnqueued(publishJob)); }
if (publishJob.getPublishList() != null) { unlockPublishList(publishJob.m_publishJob);
/** * Signalizes that the publish thread starts.<p> * * @param publishJob the started publish job */ protected void publishJobStarted(CmsPublishJobInfoBean publishJob) { // update the job m_publishQueue.update(publishJob); // fire the publish start event m_listeners.fireStart(new CmsPublishJobEnqueued(publishJob)); }
CmsPublishJobInfoBean publishJob = m_currentPublishThread.getPublishJob(); try { abortPublishJob(m_adminUserId, new CmsPublishJobEnqueued(publishJob), false); } catch (CmsException e) { if (LOG.isErrorEnabled()) {
CmsPublishJobInfoBean publishJob = m_currentPublishThread.getPublishJob(); try { abortPublishJob(m_adminUserId, new CmsPublishJobEnqueued(publishJob), false); } catch (CmsException e) { if (LOG.isErrorEnabled()) {
new CmsPublishJobEnqueued(job).m_publishJob.finish(); m_publishEngine.getPublishHistory().add(job); } catch (CmsException exc) {