/** * Removes all exclusive temporary locks of a user.<p> * * Only edition lock can be temporary, so no system locks are removed.<p> * * @param userId the id of the user whose locks has to be removed */ public void removeTempLocks(CmsUUID userId) { Iterator<CmsLock> itLocks = OpenCms.getMemoryMonitor().getAllCachedLocks().iterator(); while (itLocks.hasNext()) { CmsLock currentLock = itLocks.next(); if (currentLock.isTemporary() && currentLock.getUserId().equals(userId)) { unlockResource(currentLock.getResourceName(), false); } } }
/** * Removes all exclusive temporary locks of a user.<p> * * Only edition lock can be temporary, so no system locks are removed.<p> * * @param userId the id of the user whose locks has to be removed */ public void removeTempLocks(CmsUUID userId) { Iterator itLocks = OpenCms.getMemoryMonitor().getAllCachedLocks().iterator(); while (itLocks.hasNext()) { CmsLock currentLock = (CmsLock)itLocks.next(); if (currentLock.isTemporary() && currentLock.getUserId().equals(userId)) { unlockResource(currentLock.getResourceName(), false); } } }
/** * Removes all resources locked in a project.<p> * * @param projectId the ID of the project where the resources have been locked * @param removeSystemLocks if <code>true</code>, also system locks are removed */ public void removeResourcesInProject(CmsUUID projectId, boolean removeSystemLocks) { Iterator<CmsLock> itLocks = OpenCms.getMemoryMonitor().getAllCachedLocks().iterator(); while (itLocks.hasNext()) { CmsLock currentLock = itLocks.next(); if (removeSystemLocks && currentLock.getSystemLock().getProjectId().equals(projectId)) { unlockResource(currentLock.getResourceName(), true); } if (currentLock.getEditionLock().getProjectId().equals(projectId)) { unlockResource(currentLock.getResourceName(), false); } } }
/** * Removes all resources locked in a project.<p> * * @param projectId the ID of the project where the resources have been locked * @param removeSystemLocks if <code>true</code>, also system locks are removed */ public void removeResourcesInProject(CmsUUID projectId, boolean removeSystemLocks) { Iterator itLocks = OpenCms.getMemoryMonitor().getAllCachedLocks().iterator(); while (itLocks.hasNext()) { CmsLock currentLock = (CmsLock)itLocks.next(); if (removeSystemLocks && currentLock.getSystemLock().getProjectId().equals(projectId)) { unlockResource(currentLock.getResourceName(), true); } if (currentLock.getEditionLock().getProjectId().equals(projectId)) { unlockResource(currentLock.getResourceName(), false); } } }
/** * Removes all locks of a user.<p> * * Edition and system locks are removed.<p> * * @param userId the id of the user whose locks should be removed */ public void removeLocks(CmsUUID userId) { Iterator<CmsLock> itLocks = OpenCms.getMemoryMonitor().getAllCachedLocks().iterator(); while (itLocks.hasNext()) { CmsLock currentLock = itLocks.next(); boolean editLock = currentLock.getEditionLock().getUserId().equals(userId); boolean sysLock = currentLock.getSystemLock().getUserId().equals(userId); if (editLock) { unlockResource(currentLock.getResourceName(), false); } if (sysLock) { unlockResource(currentLock.getResourceName(), true); } } }
/** * Removes all locks of a user.<p> * * Edition and system locks are removed.<p> * * @param userId the id of the user whose locks should be removed */ public void removeLocks(CmsUUID userId) { Iterator itLocks = OpenCms.getMemoryMonitor().getAllCachedLocks().iterator(); while (itLocks.hasNext()) { CmsLock currentLock = (CmsLock)itLocks.next(); boolean editLock = currentLock.getEditionLock().getUserId().equals(userId); boolean sysLock = currentLock.getSystemLock().getUserId().equals(userId); if (editLock) { unlockResource(currentLock.getResourceName(), false); } if (sysLock) { unlockResource(currentLock.getResourceName(), true); } } }
/** * Removes a resource after it has been deleted by the driver manager.<p> * * @param dbc the current database context * @param resourceName the root path of the deleted resource * @throws CmsException if something goes wrong */ public void removeDeletedResource(CmsDbContext dbc, String resourceName) throws CmsException { try { m_driverManager.getVfsDriver().readResource(dbc, dbc.currentProject().getUuid(), resourceName, false); throw new CmsLockException(Messages.get().container( Messages.ERR_REMOVING_UNDELETED_RESOURCE_1, dbc.getRequestContext().removeSiteRoot(resourceName))); } catch (CmsVfsResourceNotFoundException e) { // ok, ignore } unlockResource(resourceName, true); unlockResource(resourceName, false); }
/** * Removes a resource after it has been deleted by the driver manager.<p> * * @param dbc the current database context * @param resourceName the root path of the deleted resource * @throws CmsException if something goes wrong */ public void removeDeletedResource(CmsDbContext dbc, String resourceName) throws CmsException { try { m_driverManager.getVfsDriver(dbc).readResource(dbc, dbc.currentProject().getUuid(), resourceName, false); throw new CmsLockException( Messages.get().container( Messages.ERR_REMOVING_UNDELETED_RESOURCE_1, dbc.getRequestContext().removeSiteRoot(resourceName))); } catch (CmsVfsResourceNotFoundException e) { // ok, ignore } unlockResource(resourceName, true); unlockResource(resourceName, false); }
if (lockedPath.startsWith(resourcename) && !lockedPath.equals(resourcename)) { unlockResource(lockedPath, false); unlockResource(resourcename, true); unlockResource(resourcename, false); return lock; unlockResource(sibling.getRootPath(), true); unlockResource(sibling.getRootPath(), false); break; // it can only be one! return unlockResource(resourcename, true);
if (lockedPath.startsWith(resourcename) && !lockedPath.equals(resourcename)) { unlockResource(lockedPath, false); unlockResource(resourcename, true); unlockResource(resourcename, false); return lock; unlockResource(sibling.getRootPath(), true); unlockResource(sibling.getRootPath(), false); break; // it can only be one! return unlockResource(resourcename, true);
String lockedPath = lock.getResourceName(); if (lockedPath.startsWith(resourceName) && !lockedPath.equals(resourceName)) { unlockResource(lockedPath, false);
String lockedPath = lock.getResourceName(); if (lockedPath.startsWith(resourceName) && !lockedPath.equals(resourceName)) { unlockResource(lockedPath, false);