/** * @see java.lang.Object#toString() */ @Override public String toString() { switch (getMode()) { case 1: return "shared inherited"; case 2: return "shared exclusive"; case 3: return "inherited"; case 4: return "exclusive"; case 6: return "temporary exclusive"; case 7: return "publish"; case 8: return "system unlocked"; default: return "unlocked"; } } }
/** * Returns <code>true</code> if this is an inherited lock, which may either be directly or shared inherited.<p> * * @return <code>true</code> if this is an inherited lock, which may either be directly or shared inherited */ public boolean isInherited() { return (isDirectlyInherited() || isSharedInherited()); }
/** * Returns <code>true</code> if this is an exclusive (or temporary exclusive) lock.<p> * * @return <code>true</code> if this is an exclusive (or temporary exclusive) lock */ public boolean isExclusive() { return m_type.isExclusive(); }
/** * Returns <code>true</code> if this is a shared lock.<p> * * @return <code>true</code> if this is a shared lock */ public boolean isShared() { return (isSharedExclusive() || isSharedInherited()); }
if (!type.isSystem() && !type.isExclusive()) { throw new CmsLockException(Messages.get().container(Messages.ERR_INVALID_LOCK_TYPE_1, type.toString())); if ((type.isExclusive()) && !(type.isTemporary() && currentLock.isInherited())) { if (!currentLock.getEditionLock().isUnlocked()) { needNewLock = false;
/** * Returns <code>true</code> if this is a system (2nd level) lock.<p> * * @return <code>true</code> if this is a system (2nd level) lock */ public boolean isSystem() { return (isPublish() || (this == CmsLockType.SYSTEM_UNLOCKED)); }
/** * @see java.lang.Object#hashCode() */ @Override public int hashCode() { return m_project.hashCode() + m_resourceName.hashCode() + m_userId.hashCode() + m_type.hashCode(); }
/** * Returns <code>true</code> if this is a shared lock.<p> * * @return <code>true</code> if this is a shared lock */ public boolean isShared() { return m_type.isShared(); }
/** * Returns <code>true</code> if this is an inherited lock, which may either be directly or shared inherited.<p> * * @return <code>true</code> if this is an inherited lock, which may either be directly or shared inherited */ public boolean isInherited() { return m_type.isInherited(); }
/** * Returns <code>true</code> if this is a persistent lock that should be saved when the systems shuts down.<p> * * @return <code>true</code> if this is a persistent lock that should be saved when the systems shuts down */ public boolean isPersistent() { return m_type.isPersistent(); }
/** * Returns <code>true</code> if this is an directly inherited lock.<p> * * @return <code>true</code> if this is an directly inherited lock */ public boolean isDirectlyInherited() { return m_type.isDirectlyInherited(); }
/** * Compares this lock to the specified object.<p> * * @param obj the object to compare to * @return true if and only if member values of this CmsLock are the same with the compared CmsLock */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof CmsLock) { CmsLock other = (CmsLock)obj; return other.m_resourceName.equals(m_resourceName) && other.m_userId.equals(m_userId) && other.m_project.equals(m_project) && other.m_type.equals(m_type); } return false; }
if (lock.getType().isSharedExclusive()) { List<String> locks = OpenCms.getMemoryMonitor().getAllCachedLockPaths();
if (!type.isSystem() && !type.isExclusive()) { throw new CmsLockException(Messages.get().container(Messages.ERR_INVALID_LOCK_TYPE_1, type.toString())); if ((type.isExclusive()) && !(type.isTemporary() && currentLock.isInherited())) { if (!currentLock.getEditionLock().isUnlocked()) { needNewLock = false;
/** * Returns <code>true</code> if this is a publish lock.<p> * * @return <code>true</code> if this is a publish lock */ public boolean isPublish() { return m_type.isPublish(); }
/** * Returns <code>true</code> if this is a shared lock.<p> * * @return <code>true</code> if this is a shared lock */ public boolean isShared() { return (isSharedExclusive() || isSharedInherited()); }
/** * @see java.lang.Object#hashCode() */ @Override public int hashCode() { return m_project.hashCode() + m_resourceName.hashCode() + m_userId.hashCode() + m_type.hashCode(); }
/** * Returns <code>true</code> if this is a shared lock.<p> * * @return <code>true</code> if this is a shared lock */ public boolean isShared() { return m_type.isShared(); }
/** * Returns <code>true</code> if this is an inherited lock, which may either be directly or shared inherited.<p> * * @return <code>true</code> if this is an inherited lock, which may either be directly or shared inherited */ public boolean isInherited() { return m_type.isInherited(); }
/** * Returns <code>true</code> if this is a persistent lock that should be saved when the systems shuts down.<p> * * @return <code>true</code> if this is a persistent lock that should be saved when the systems shuts down */ public boolean isPersistent() { return m_type.isPersistent(); }