org.kuali.rice.krad.document.authorization
Class PessimisticLock

java.lang.Object
  extended by org.kuali.rice.krad.bo.BusinessObjectBase
      extended by org.kuali.rice.krad.bo.PersistableBusinessObjectBase
          extended by org.kuali.rice.krad.document.authorization.PessimisticLock
All Implemented Interfaces:
Serializable, org.apache.ojb.broker.PersistenceBrokerAware, GloballyUnique, Versioned, ModelObjectBasic, BusinessObject, PersistableBusinessObject

@Entity
public class PessimisticLock
extends PersistableBusinessObjectBase

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:
Serialized Form

Field Summary
static String DEFAULT_LOCK_DESCRIPTOR
           
 
Fields inherited from class org.kuali.rice.krad.bo.PersistableBusinessObjectBase
extension, versionNumber
 
Constructor Summary
PessimisticLock()
          Deprecated.  
PessimisticLock(String documentNumber, String lockDescriptor, Person user)
          This constructs a lock object using the logged in user and given lock type
 
Method Summary
 String getDocumentNumber()
           
 Timestamp getGeneratedTimestamp()
           
 Long getId()
           
 String getLockDescriptor()
           
 String getOwnedByPrincipalIdentifier()
           
 Person getOwnedByUser()
           
 boolean isOwnedByUser(Person user)
           
 void setDocumentNumber(String documentNumber)
           
 void setGeneratedTimestamp(Timestamp generatedTimestamp)
           
 void setId(Long id)
           
 void setLockDescriptor(String lockDescriptor)
           
 void setOwnedByPrincipalIdentifier(String ownedByPrincipalIdentifier)
           
 void setOwnedByUser(Person ownedByUser)
           
 
Methods inherited from class org.kuali.rice.krad.bo.PersistableBusinessObjectBase
afterDelete, afterInsert, afterLookup, afterUpdate, beforeDelete, beforeInsert, beforeUpdate, buildListOfDeletionAwareLists, getExtension, getObjectId, getPersistenceService, getPersistenceStructureService, getVersionNumber, isNewCollectionRecord, linkEditableUserFields, postLoad, postPersist, postRemove, postUpdate, prePersist, preRemove, preUpdate, refresh, refreshNonUpdateableReferences, refreshReferenceObject, setExtension, setNewCollectionRecord, setObjectId, setVersionNumber
 
Methods inherited from class org.kuali.rice.krad.bo.BusinessObjectBase
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.kuali.rice.core.api.mo.ModelObjectBasic
toString
 

Field Detail

DEFAULT_LOCK_DESCRIPTOR

public static final String DEFAULT_LOCK_DESCRIPTOR
Constructor Detail

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. Use another constructor.


PessimisticLock

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

Method Detail

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

getOwnedByUser

public Person getOwnedByUser()
Returns:
the ownedByUser

setOwnedByUser

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


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.