org.archiviststoolkit.util
Class RecordLockUtils

java.lang.Object
  extended by org.archiviststoolkit.util.RecordLockUtils

public class RecordLockUtils
extends java.lang.Object

Archivists' Toolkit(TM) Copyright © 2005-2008 Regents of the University of California, New York University, & Five Colleges, Inc. All rights reserved. This software is free. You can redistribute it and / or modify it under the terms of the Educational Community License (ECL) version 1.0 (http://www.opensource.org/licenses/ecl1.php) This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ECL license for more details about permissions and limitations. Archivists' Toolkit(TM) http://www.archiviststoolkit.org info@archiviststoolkit.org Created by IntelliJ IDEA.


Constructor Summary
RecordLockUtils()
           
 
Method Summary
static RecordLocks addRecordLock(DomainObject record)
          Method to add a record lock of the following domain object
static void clearAllMyRecordLocks()
          Method to clear all the record locks belonging to this user
static void clearAllRecordLocks(java.sql.Statement stmt)
          Method to clear all record locks in the database should only be used superuser during upgrade
static void clearRecordLock(RecordLocks recordLock)
          Method to clear a particular record lock
static java.lang.String getHostIP()
          Method to return the IP address of the host computer
static java.util.ArrayList<RecordLocks> getMyRecordLocks()
          Method to get the list of records that are locked
static RecordLocks getRecordLock(DomainObject record)
          Method to check to see if a record is locked and if it is return the lock
static void updateRecordLocksTime()
          Method to update the currentUpdateTime of all My records
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RecordLockUtils

public RecordLockUtils()
Method Detail

getRecordLock

public static RecordLocks getRecordLock(DomainObject record)
Method to check to see if a record is locked and if it is return the lock

Parameters:
record - The record being checked
Returns:
null or the record lock for the particular record

addRecordLock

public static RecordLocks addRecordLock(DomainObject record)
Method to add a record lock of the following domain object

Parameters:
record - The record to create a lock for

clearRecordLock

public static void clearRecordLock(RecordLocks recordLock)
Method to clear a particular record lock

Parameters:
recordLock - the record lock to clear

getMyRecordLocks

public static java.util.ArrayList<RecordLocks> getMyRecordLocks()
Method to get the list of records that are locked

Returns:
An array list containing the record locks

updateRecordLocksTime

public static void updateRecordLocksTime()
Method to update the currentUpdateTime of all My records


clearAllMyRecordLocks

public static void clearAllMyRecordLocks()
Method to clear all the record locks belonging to this user


clearAllRecordLocks

public static void clearAllRecordLocks(java.sql.Statement stmt)
                                throws java.sql.SQLException
Method to clear all record locks in the database should only be used superuser during upgrade

Parameters:
stmt - The connection to the database
Throws:
java.sql.SQLException

getHostIP

public static java.lang.String getHostIP()
Method to return the IP address of the host computer

Returns:
The IP address of the host computer