Package org.opencms.gwt.shared
Class CmsLockInfo
- java.lang.Object
-
- org.opencms.gwt.shared.CmsLockInfo
-
- All Implemented Interfaces:
com.google.gwt.user.client.rpc.IsSerializable
public class CmsLockInfo extends java.lang.Object implements com.google.gwt.user.client.rpc.IsSerializable
A bean for storing information about whether a resource could be locked or not, and if not, why.- Since:
- 8.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CmsLockInfo.State
An enum indicating the success or type of failure of a locking operation.
-
Constructor Summary
Constructors Modifier Constructor Description protected
CmsLockInfo()
Empty constructor for serialization.CmsLockInfo(CmsLockInfo.State state, java.lang.String user, java.lang.String exceptionMessage)
Creates a new lock info bean.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
couldLock()
Returns true if the locking succeeded.static CmsLockInfo
forChangedResource(java.lang.String user)
Creates a new info bean for a resource which has changed since it was opened.static CmsLockInfo
forError(java.lang.String errorMessage)
Creates a new info bean for other types of errors.static CmsLockInfo
forLockedResource(java.lang.String lockUser)
Returns a lock info bean for a resource locked by another user.static CmsLockInfo
forSuccess()
Returns a lock info bean for a successful lock operation.java.lang.String
getErrorMessage()
Returns the additional error message.CmsLockInfo.State
getState()
Returns the state of the locking operation.java.lang.String
getUser()
Returns the user name.
-
-
-
Constructor Detail
-
CmsLockInfo
public CmsLockInfo(CmsLockInfo.State state, java.lang.String user, java.lang.String exceptionMessage)
Creates a new lock info bean.- Parameters:
state
- the state of the locking operationuser
- a user nameexceptionMessage
- an additional error message
-
CmsLockInfo
protected CmsLockInfo()
Empty constructor for serialization.
-
-
Method Detail
-
forChangedResource
public static CmsLockInfo forChangedResource(java.lang.String user)
Creates a new info bean for a resource which has changed since it was opened.- Parameters:
user
- the user by which it was changed- Returns:
- the new lock info bean
-
forError
public static CmsLockInfo forError(java.lang.String errorMessage)
Creates a new info bean for other types of errors.- Parameters:
errorMessage
- the additional error message- Returns:
- the new lock info bean
-
forLockedResource
public static CmsLockInfo forLockedResource(java.lang.String lockUser)
Returns a lock info bean for a resource locked by another user.- Parameters:
lockUser
- the other user- Returns:
- the new lock info bean
-
forSuccess
public static CmsLockInfo forSuccess()
Returns a lock info bean for a successful lock operation.- Returns:
- the new lock info bean
-
couldLock
public boolean couldLock()
Returns true if the locking succeeded.- Returns:
- true if the locking succeeded
-
getErrorMessage
public java.lang.String getErrorMessage()
Returns the additional error message.- Returns:
- the additional error message
-
getState
public CmsLockInfo.State getState()
Returns the state of the locking operation.- Returns:
- the state of the locking operation
-
getUser
public java.lang.String getUser()
Returns the user name.- Returns:
- a user name
-
-