Class CmsLockInfo

java.lang.Object
org.opencms.gwt.shared.CmsLockInfo
All Implemented Interfaces:
com.google.gwt.user.client.rpc.IsSerializable

public class CmsLockInfo extends 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
  • Constructor Details

    • CmsLockInfo

      public CmsLockInfo(CmsLockInfo.State state, String user, String exceptionMessage)
      Creates a new lock info bean.

      Parameters:
      state - the state of the locking operation
      user - a user name
      exceptionMessage - an additional error message
    • CmsLockInfo

      protected CmsLockInfo()
      Empty constructor for serialization.

  • Method Details

    • forChangedResource

      public static CmsLockInfo forChangedResource(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(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(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

      Returns the additional error message.

      Returns:
      the additional error message
    • getState

      Returns the state of the locking operation.

      Returns:
      the state of the locking operation
    • getUser

      public String getUser()
      Returns the user name.

      Returns:
      a user name