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

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

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
           
private  String documentNumber
           
private  Timestamp generatedTimestamp
           
private  Long id
           
private  String lockDescriptor
           
private  String ownedByPrincipalIdentifier
           
private  Person ownedByUser
           
private static long serialVersionUID
           
 
Fields inherited from class org.kuali.rice.kns.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)
           
protected  LinkedHashMap toStringMapper()
          This helper method used to define fields and field values to use in toString() method
 
Methods inherited from class org.kuali.rice.kns.bo.PersistableBusinessObjectBase
addNote, afterDelete, afterInsert, afterLookup, afterUpdate, beforeDelete, beforeInsert, beforeInsert, beforeUpdate, beforeUpdate, buildListOfDeletionAwareLists, deleteNote, getAttachmentService, getBoNote, getBoNotes, getExtension, getNoteService, getObjectId, getPersistenceService, getPersistenceStructureService, getVersionNumber, isAutoIncrementSet, isBoNotesSupport, isNewCollectionRecord, linkEditableUserFields, refresh, refreshNonUpdateableReferences, refreshReferenceObject, setAutoIncrementSet, setBoNotes, setExtension, setNewCollectionRecord, setObjectId, setVersionNumber, supportsBoNotes
 
Methods inherited from class org.kuali.rice.kns.bo.BusinessObjectBase
prepareForWorkflow, toString, toStringBuilder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.kuali.rice.kns.bo.BusinessObject
prepareForWorkflow
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

DEFAULT_LOCK_DESCRIPTOR

public static final String DEFAULT_LOCK_DESCRIPTOR

id

private Long id

ownedByPrincipalIdentifier

private String ownedByPrincipalIdentifier

lockDescriptor

private String lockDescriptor

generatedTimestamp

private Timestamp generatedTimestamp

documentNumber

private String documentNumber

ownedByUser

private Person ownedByUser
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

toStringMapper

protected LinkedHashMap toStringMapper()
This helper method used to define fields and field values to use in toString() method

Specified by:
toStringMapper in class BusinessObjectBase
Returns:
Map containing the fieldValues of the key fields for this class, indexed by fieldName
See Also:
BusinessObjectBase.toStringMapper()


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.