com.ibm.as400.access
Class ObjectLockListEntry
- java.lang.Object
-
- com.ibm.as400.access.ObjectLockListEntry
-
public class ObjectLockListEntry extends java.lang.Object
Represents a single IBM i lock placed on an ObjectDescription.Each entry corresponds to an entry from the List Object Locks (QWCLOBJL) API.
Instances of this class are created by theObjectDescription.getObjectLockList()
method.
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.String
JOB_NAME_LOCK_SPACE
Job name lock space.static java.lang.String
JOB_NAME_MACHINE
Job name machine process.static int
LOCK_SCOPE_JOB
Lock scope - indicates lock has job scope.static int
LOCK_SCOPE_LOCK_SPACE
Lock scope - indicates lock has lock space scope.static int
LOCK_SCOPE_THREAD
Lock scope - indicates lock has thread scope.static int
LOCK_SHARE_FILE_NOT_SHARED
Lock share - the file is not shared, the file is a physical file, or the field is not applicable to object type.static int
LOCK_SHARE_FILE_SHARED
Lock share - the file is shared.static java.lang.String
LOCK_STATE_EXCLUSIVE_ALLOW_READ
Lock state for the lock request.static java.lang.String
LOCK_STATE_EXCLUSIVE_NO_READ
Lock state for the lock request.static java.lang.String
LOCK_STATE_NONE
Lock state for the lock request.static java.lang.String
LOCK_STATE_SHARED_NO_UPDATE
Lock state for the lock request.static java.lang.String
LOCK_STATE_SHARED_READ
Lock state for the lock request.static java.lang.String
LOCK_STATE_SHARED_UPDATE
Lock state for the lock request.static int
LOCK_STATUS_JOB_THREAD_WAITING_SYNC
Lock status - the job or thread is waiting for the lock (synchronous).static int
LOCK_STATUS_LOCK_HELD
Lock status - the lock is currently held by the job or thread.static int
LOCK_STATUS_LOCK_REQUEST_OUTSTANDING_ASYNC
Lock status - the job or thread has a lock request outstanding for the object (asynchronous).static int
LOCK_TYPE_ACCESS_PATH
Lock type - lock on the access path used to access a member's datastatic int
LOCK_TYPE_DATA_WITHIN_MEMBER
Lock type - lock on the actual data within the member.static int
LOCK_TYPE_MEMBER_CONTROL_BLOCK
Lock type - lock on the member control block.static int
LOCK_TYPE_OBJECT
Lock type - lock on the objectstatic java.lang.String
VALUE_CANNOT_BE_DETERMINED
Special value indicating that the system was unable to determine a value.
-
Method Summary
Methods Modifier and Type Method and Description java.lang.String
getJobName()
Returns the simple job name of the job that issued the lock request.java.lang.String
getJobNumber()
The system-assigned job number of the job that issued the lock request.java.lang.String
getJobUserName()
The user name under which the job that issued the lock request is run.int
getLockScope()
Returns the value indicating the lock scope.java.lang.String
getLockState()
Returns the value indicating the lock state.int
getLockStatus()
Returns the value indicating the lock status.int
getLockType()
Returns the value indicating the lock type.int
getShare()
Share.long
getThreadID()
The identifier of the thread that is holding a thread-scoped lock or waiting for a lock.java.lang.String
toString()
Returns a string representation of this object lock
-
-
-
Field Detail
-
LOCK_SCOPE_JOB
public static final int LOCK_SCOPE_JOB
Lock scope - indicates lock has job scope.- See Also:
- Constant Field Values
-
LOCK_SCOPE_THREAD
public static final int LOCK_SCOPE_THREAD
Lock scope - indicates lock has thread scope.- See Also:
- Constant Field Values
-
LOCK_SCOPE_LOCK_SPACE
public static final int LOCK_SCOPE_LOCK_SPACE
Lock scope - indicates lock has lock space scope.- See Also:
- Constant Field Values
-
LOCK_STATE_NONE
public static final java.lang.String LOCK_STATE_NONE
Lock state for the lock request. Indicates no locks exist.- See Also:
- Constant Field Values
-
LOCK_STATE_SHARED_READ
public static final java.lang.String LOCK_STATE_SHARED_READ
Lock state for the lock request. Indicates lock is shared for read.- See Also:
- Constant Field Values
-
LOCK_STATE_SHARED_UPDATE
public static final java.lang.String LOCK_STATE_SHARED_UPDATE
Lock state for the lock request. Indicates lock is shared for update.- See Also:
- Constant Field Values
-
LOCK_STATE_SHARED_NO_UPDATE
public static final java.lang.String LOCK_STATE_SHARED_NO_UPDATE
Lock state for the lock request. Indicates lock is shared for no update.- See Also:
- Constant Field Values
-
LOCK_STATE_EXCLUSIVE_ALLOW_READ
public static final java.lang.String LOCK_STATE_EXCLUSIVE_ALLOW_READ
Lock state for the lock request. Indicates exclusive lock which allows read.- See Also:
- Constant Field Values
-
LOCK_STATE_EXCLUSIVE_NO_READ
public static final java.lang.String LOCK_STATE_EXCLUSIVE_NO_READ
Lock state for the lock request. Indicates exclusive lock with no read.- See Also:
- Constant Field Values
-
LOCK_STATUS_LOCK_HELD
public static final int LOCK_STATUS_LOCK_HELD
Lock status - the lock is currently held by the job or thread.- See Also:
- Constant Field Values
-
LOCK_STATUS_JOB_THREAD_WAITING_SYNC
public static final int LOCK_STATUS_JOB_THREAD_WAITING_SYNC
Lock status - the job or thread is waiting for the lock (synchronous).- See Also:
- Constant Field Values
-
LOCK_STATUS_LOCK_REQUEST_OUTSTANDING_ASYNC
public static final int LOCK_STATUS_LOCK_REQUEST_OUTSTANDING_ASYNC
Lock status - the job or thread has a lock request outstanding for the object (asynchronous).- See Also:
- Constant Field Values
-
LOCK_TYPE_OBJECT
public static final int LOCK_TYPE_OBJECT
Lock type - lock on the object- See Also:
- Constant Field Values
-
LOCK_TYPE_MEMBER_CONTROL_BLOCK
public static final int LOCK_TYPE_MEMBER_CONTROL_BLOCK
Lock type - lock on the member control block.- See Also:
- Constant Field Values
-
LOCK_TYPE_ACCESS_PATH
public static final int LOCK_TYPE_ACCESS_PATH
Lock type - lock on the access path used to access a member's data- See Also:
- Constant Field Values
-
LOCK_TYPE_DATA_WITHIN_MEMBER
public static final int LOCK_TYPE_DATA_WITHIN_MEMBER
Lock type - lock on the actual data within the member.- See Also:
- Constant Field Values
-
LOCK_SHARE_FILE_NOT_SHARED
public static final int LOCK_SHARE_FILE_NOT_SHARED
Lock share - the file is not shared, the file is a physical file, or the field is not applicable to object type.- See Also:
- Constant Field Values
-
LOCK_SHARE_FILE_SHARED
public static final int LOCK_SHARE_FILE_SHARED
Lock share - the file is shared.- See Also:
- Constant Field Values
-
JOB_NAME_MACHINE
public static final java.lang.String JOB_NAME_MACHINE
Job name machine process. The job holding the lock is an internal machine process.- See Also:
- Constant Field Values
-
JOB_NAME_LOCK_SPACE
public static final java.lang.String JOB_NAME_LOCK_SPACE
Job name lock space. The lock is attached to a lock space.- See Also:
- Constant Field Values
-
VALUE_CANNOT_BE_DETERMINED
public static final java.lang.String VALUE_CANNOT_BE_DETERMINED
Special value indicating that the system was unable to determine a value.- See Also:
- Constant Field Values
-
-
Method Detail
-
getJobName
public java.lang.String getJobName()
Returns the simple job name of the job that issued the lock request.- Returns:
- the job name. The following special values may be returned:
JOB_NAME_MACHINE
- The lock is held by an internal machine process. If this value is returned, the job number and job user name will be blank.JOB_NAME_LOCK_SPACE
- The lock is attached to a lock space. If this value is returned, the job number and job user name will be blank.VALUE_CANNOT_BE_DETERMINED
- The job name cannot be determined.
-
getJobUserName
public java.lang.String getJobUserName()
The user name under which the job that issued the lock request is run. The user name is the same as the user profile name and can come from several different sources depending on the type of job.- Returns:
- the job user name. The following special value may be returned:
VALUE_CANNOT_BE_DETERMINED
- The job user name cannot be determined.
-
getJobNumber
public java.lang.String getJobNumber()
The system-assigned job number of the job that issued the lock request.- Returns:
- the job number. The following special value may be returned:
VALUE_CANNOT_BE_DETERMINED
- The job number cannot be determined.
-
getLockState
public java.lang.String getLockState()
Returns the value indicating the lock state.- Returns:
- lock state. Possible values:
LOCK_STATE_NONE
- Indicates no locks exist.LOCK_STATE_SHARED_READ
- Indicates lock is shared for read.LOCK_STATE_SHARED_UPDATE
- Indicates lock is shared for update.LOCK_STATE_SHARED_NO_UPDATE
- Indicates lock is shared for no update.LOCK_STATE_EXCLUSIVE_ALLOW_READ
- Indicates exclusive lock which allows read.LOCK_STATE_EXCLUSIVE_NO_READ
- Indicates exclusive lock with no read.
-
getLockStatus
public int getLockStatus()
Returns the value indicating the lock status.- Returns:
- lock status. Possible values:
LOCK_STATUS_LOCK_HELD
- The lock is currently held by the job or thread.LOCK_STATUS_JOB_THREAD_WAITING_SYNC
- The job or thread is waiting for the lock (synchronous).LOCK_STATUS_LOCK_REQUEST_OUTSTANDING_ASYNC
- The job or thread has a lock request outstanding for the object (asynchronous).
-
getLockType
public int getLockType()
Returns the value indicating the lock type.- Returns:
- lock type. Possible values:
LOCK_TYPE_OBJECT
- Lock on the objectLOCK_TYPE_MEMBER_CONTROL_BLOCK
- Lock on the member control block.LOCK_TYPE_ACCESS_PATH
- Lock on the access path used to access a member's dataLOCK_TYPE_DATA_WITHIN_MEMBER
- Lock on the actual data within the member.
-
getShare
public int getShare()
Share. Whether shared file member locks are associated with the file member.- Returns:
- lock share. Possible values:
LOCK_SHARE_FILE_NOT_SHARED
- The file is not shared, the file is a physical file, or the field is not applicable to object type.LOCK_SHARE_FILE_SHARED
- The file is shared.
-
getLockScope
public int getLockScope()
Returns the value indicating the lock scope.- Returns:
- lock scope. Possible values:
LOCK_SCOPE_JOB
- Lock has job scope.LOCK_SCOPE_THREAD
- Lock has thread scope.LOCK_SCOPE_LOCK_SPACE
- Lock has lock space scope
-
getThreadID
public long getThreadID()
The identifier of the thread that is holding a thread-scoped lock or waiting for a lock.- Returns:
- a long representing the thread identifier. For locks that do not have a lock scope of
LOCK_SCOPE_THREAD
, this value is not meaningful and will likely be zero.
-
toString
public java.lang.String toString()
Returns a string representation of this object lock- Overrides:
toString
in classjava.lang.Object
- Returns:
- a string representing the lock by [job name/job user name/job number/thread ID]
-
-