Class 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.
    • 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 operation
        user - a user name
        exceptionMessage - 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