Class PessimisticLock

All Implemented Interfaces:
Serializable, GloballyUnique, Versioned, ModelObjectBasic, BusinessObject

@Entity public class PessimisticLock extends PersistableBusinessObjectBaseAdapter implements BusinessObject
This is a business object used to lock a document pessimistically. Pessimistic locking is more strick than optimistic locking and assumes if a lock exists that a user should only have read-only access to a document. For more information see documentation pages.
Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
  • Field Details

    • DEFAULT_LOCK_DESCRIPTOR

      public static final String DEFAULT_LOCK_DESCRIPTOR
  • Constructor Details

    • PessimisticLock

      @Deprecated public PessimisticLock()
      Deprecated.
      This constructs an empty lock using the logged in user and default lock descriptor type but will NOT assign a document number or session id. Use another constructor.
    • PessimisticLock

      public PessimisticLock(String documentNumber, String lockDescriptor, Person user, UserSession userSession)
      This constructs a lock object using the logged in user and given lock type
  • Method Details

    • isOwnedByUser

      public boolean isOwnedByUser(Person user)
    • getId

      public Long getId()
      Returns:
      the id
    • setId

      public void setId(Long id)
      Parameters:
      id - the id to set
    • getOwnedByPrincipalIdentifier

      public String getOwnedByPrincipalIdentifier()
      Returns:
      the ownedByPrincipalIdentifier
    • setOwnedByPrincipalIdentifier

      public void setOwnedByPrincipalIdentifier(String ownedByPrincipalIdentifier)
      Parameters:
      ownedByPrincipalIdentifier - the ownedByPrincipalIdentifier to set
    • getLockDescriptor

      public String getLockDescriptor()
      Returns:
      the lockDescriptor
    • setLockDescriptor

      public void setLockDescriptor(String lockDescriptor)
      Parameters:
      lockDescriptor - the lockDescriptor to set
    • getGeneratedTimestamp

      public Timestamp getGeneratedTimestamp()
      Returns:
      the generatedTimestamp
    • setGeneratedTimestamp

      public void setGeneratedTimestamp(Timestamp generatedTimestamp)
      Parameters:
      generatedTimestamp - the generatedTimestamp to set
    • getDocumentNumber

      public String getDocumentNumber()
      Returns:
      the documentNumber
    • setDocumentNumber

      public void setDocumentNumber(String documentNumber)
      Parameters:
      documentNumber - the documentNumber to set
    • getSessionId

      public String getSessionId()
      Returns:
      the sessionId
    • setSessionId

      public void setSessionId(String sessionId)
      Parameters:
      sessionId - the sessionId to set
    • getOwnedByUser

      public Person getOwnedByUser()
      Returns:
      the ownedByUser
    • setOwnedByUser

      public void setOwnedByUser(Person ownedByUser)
      Parameters:
      ownedByUser - the ownedByUser to set