com.ibm.tws.objects.types
Class LockData

java.lang.Object
  extended bycom.ibm.tws.objects.types.LockData
All Implemented Interfaces:
java.io.Serializable

public class LockData
extends java.lang.Object
implements java.io.Serializable

This utility class wraps the TWS object lock information, including the name of the user who is currently holding the lock, the time the object was locked, and the user session. When used within database object definitions, this object is filled only by the TWS Distributed engine, while it is completely ignored on TWS for z/OS.

See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT
          Copyright.
 
Constructor Summary
LockData()
          Creates an empty LockData object.
LockData(java.lang.String user, java.util.Date time, java.lang.String session)
          Creates a LockData object with the specified user name, lock time and user session.
 
Method Summary
 boolean equals(java.lang.Object object)
          Returns true if all fields of this LockData object are equal to those of the given one.
 java.lang.String getLockedBy()
          Returns the name of the user who is currently holding the lock.
 java.lang.String getLockedSession()
          Returns the session of the user who is currently holding the lock.
 java.util.Date getLockedTime()
          Returns the time the object was locked.
 int hashCode()
          Returns a hash code for this LockData object.
 void set(java.lang.String user, java.util.Date time, java.lang.String session)
          Sets the name and session of the user who is currently holding the lock, and the time the object was locked.
 void setLockedBy(java.lang.String user)
          Sets the name of the user who is currently holding the lock.
 void setLockedSession(java.lang.String session)
          Sets the session of the user who is currently holding the lock.
 void setLockedTime(java.util.Date time)
          Sets the time the object was locked.
 java.lang.String toString()
          Returns a string representation of this LockData object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
Copyright.

Constructor Detail

LockData

public LockData()
Creates an empty LockData object.


LockData

public LockData(java.lang.String user,
                java.util.Date time,
                java.lang.String session)
Creates a LockData object with the specified user name, lock time and user session.

Parameters:
user - The name of the user who holds the lock.
time - The time the object was locked.
session - The session of the user who holds the lock.
Method Detail

getLockedBy

public java.lang.String getLockedBy()
Returns the name of the user who is currently holding the lock.

Returns:
The name of the user who holds the lock.

getLockedTime

public java.util.Date getLockedTime()
Returns the time the object was locked.

Returns:
The time the object was locked.

getLockedSession

public java.lang.String getLockedSession()
Returns the session of the user who is currently holding the lock.

Returns:
The session of the user who holds the lock.

setLockedBy

public void setLockedBy(java.lang.String user)
Sets the name of the user who is currently holding the lock.

Parameters:
user - The name of the user who holds the lock.

setLockedTime

public void setLockedTime(java.util.Date time)
Sets the time the object was locked.

Parameters:
time - The time the object was locked.

setLockedSession

public void setLockedSession(java.lang.String session)
Sets the session of the user who is currently holding the lock.

Parameters:
session - The session of the user who holds the lock.

set

public void set(java.lang.String user,
                java.util.Date time,
                java.lang.String session)
Sets the name and session of the user who is currently holding the lock, and the time the object was locked.

Parameters:
user - The name of the user who holds the lock.
time - The time the object was locked.
session - The session of the user who holds the lock.

equals

public boolean equals(java.lang.Object object)
Returns true if all fields of this LockData object are equal to those of the given one.

Parameters:
object - The object to be compared with this one.
Returns:
True if this object equals to the given one.

hashCode

public int hashCode()
Returns a hash code for this LockData object.

Returns:
The object's hash code.

toString

public java.lang.String toString()
Returns a string representation of this LockData object.

Returns:
A text string including all LockData fields.


Copyright © 2005 IBM All Rights Reserved.