Package org.eclipse.emf.cdo.common.lock

# Class CDOLockUtil

java.lang.Object
org.eclipse.emf.cdo.common.lock.CDOLockUtil

public final class CDOLockUtil extends Object
Various static methods that may help with classes related to CDO locks.

Since:
  4.1
Author:
  Caspar De Groot

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`DURABLE_SESSION_ID`
`static final int`
`DURABLE_VIEW_ID`
`static final CDOLockDelta[]`
`NO_LOCK_DELTAS`
`static final CDOLockState[]`
`NO_LOCK_STATES`

## Method Summary

Modifier and Type
Method
Description
`static List<CDOLockDelta>`
`appendLockDelta(List<CDOLockDelta> deltas, Object target, org.eclipse.net4j.util.concurrent.IRWLockManager.LockType type, CDOLockOwner oldOwner, CDOLockOwner newOwner)`
`static List<CDOLockDelta>`
`appendLockDelta(List<CDOLockDelta> deltas, CDOLockDelta delta)`
`static CDOLockState`
`convertLockState(org.eclipse.net4j.util.concurrent.RWOLockManager.LockState<Object,? extends CDOCommonView> lockState)`
`static CDOLockState`
`copyLockState(CDOLockState lockState)`
Deprecated.
As of 4.15 no longer supported.
`static CDOLockState`
`copyLockState(CDOLockState lockState, Object lockedObject)`
Deprecated.
As of 4.15 no longer supported.
`static String`
`createDurableLockingID()`
`static String`
`createDurableLockingID(int bytes)`
`static IDurableLockingManager.LockArea`
`createLockArea(String durableLockingID)`
`static IDurableLockingManager.LockArea`
`createLockArea(String durableLockingID, String userID, CDOBranchPoint branchPoint, boolean readOnly, Map<CDOID,IDurableLockingManager.LockGrade> locks)`
`static CDOLockChangeInfo`
`createLockChangeInfo()`
`static CDOLockChangeInfo`
`createLockChangeInfo(long timestamp, CDOCommonView view, CDOBranch viewedBranch, CDOLockChangeInfo.Operation op, org.eclipse.net4j.util.concurrent.IRWLockManager.LockType lockType, CDOLockState[] newLockStates)`
Deprecated.
As of 4.15 use `createLockChangeInfo(CDOBranchPoint, CDOLockOwner, Collection, Collection)`.
`static CDOLockChangeInfo`
`createLockChangeInfo(long timestamp, CDOLockOwner lockOwner, CDOBranch branch, CDOLockChangeInfo.Operation op, org.eclipse.net4j.util.concurrent.IRWLockManager.LockType lockType, CDOLockState[] newLockStates)`
Deprecated.
As of 4.15 use `createLockChangeInfo(CDOBranchPoint, CDOLockOwner, Collection, Collection)`.
`static CDOLockChangeInfo`
`createLockChangeInfo(CDOBranchPoint branchPoint, CDOLockOwner lockOwner, Collection<CDOLockDelta> lockDeltas, Collection<CDOLockState> lockStates)`
`static CDOLockChangeInfo`
`createLockChangeInfo(CDOBranchPoint branchPoint, CDOLockOwner lockOwner, Collection<CDOLockDelta> lockDeltas, Collection<CDOLockState> lockStates, boolean isAdministrative)`
`static CDOLockDelta`
`createLockDelta(Object target)`
`static CDOLockDelta`
`createLockDelta(Object target, org.eclipse.net4j.util.concurrent.IRWLockManager.LockType type, CDOLockOwner oldOwner, CDOLockOwner newOwner)`
`static CDOLockOwner`
`createLockOwner(int sessionID, int viewID, String durableLockingID)`
`static CDOLockOwner`
`createLockOwner(CDOCommonView view)`
`static CDOLockState`
`createLockState(Object target)`
`static CDOLockState`
`createLockState(org.eclipse.net4j.util.concurrent.RWOLockManager.LockState<Object,? extends CDOCommonView> lockState)`
Deprecated.
As of 4.15 use `convertLockState(LockState)`.
`static CDOBranch`
`getLockedObjectBranch(Object lockedObject)`
`static CDOID`
`getLockedObjectID(Object lockedObject)`
`static int`
`indexOf(CDOLockOwner[] lockOwners, CDOLockOwner lockOwner)`
`static CDOLockDelta[]`
`toArray(List<CDOLockDelta> deltas)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### DURABLE_SESSION_ID

public static final int DURABLE_SESSION_ID

Since:
  4.14
See Also:
  - Constant Field Values

### DURABLE_VIEW_ID

public static final int DURABLE_VIEW_ID

Since:
  4.14
See Also:
  - Constant Field Values

### NO_LOCK_STATES

public static final CDOLockState[] NO_LOCK_STATES

Since:
  4.15

### NO_LOCK_DELTAS

public static final CDOLockDelta[] NO_LOCK_DELTAS

Since:
  4.15

## Method Details

### getLockedObjectID

public static CDOID getLockedObjectID(Object lockedObject)

Since:
  4.12

### getLockedObjectBranch

public static CDOBranch getLockedObjectBranch(Object lockedObject)

Since:
  4.12

### indexOf

public static int indexOf(CDOLockOwner[] lockOwners, CDOLockOwner lockOwner)

Since:
  4.15

### convertLockState

public static CDOLockState convertLockState(org.eclipse.net4j.util.concurrent.RWOLockManager.LockState<Object,? extends CDOCommonView> lockState)

Since:
  4.15

### createLockState

public static CDOLockState createLockState(Object target)

### createLockOwner

public static CDOLockOwner createLockOwner(CDOCommonView view)

### createLockOwner

public static CDOLockOwner createLockOwner(int sessionID, int viewID, String durableLockingID)

Since:
  4.14

### createLockDelta

public static CDOLockDelta createLockDelta(Object target, org.eclipse.net4j.util.concurrent.IRWLockManager.LockType type, CDOLockOwner oldOwner, CDOLockOwner newOwner)

Since:
  4.15

### createLockDelta

public static CDOLockDelta createLockDelta(Object target)

Since:
  4.15

### createLockChangeInfo

public static CDOLockChangeInfo createLockChangeInfo(CDOBranchPoint branchPoint, CDOLockOwner lockOwner, Collection<CDOLockDelta> lockDeltas, Collection<CDOLockState> lockStates)

Since:
  4.15

### createLockChangeInfo

public static CDOLockChangeInfo createLockChangeInfo(CDOBranchPoint branchPoint, CDOLockOwner lockOwner, Collection<CDOLockDelta> lockDeltas, Collection<CDOLockState> lockStates, boolean isAdministrative)

Since:
  4.27

### createLockChangeInfo

public static CDOLockChangeInfo createLockChangeInfo()

### createLockArea

public static IDurableLockingManager.LockArea createLockArea(String durableLockingID, String userID, CDOBranchPoint branchPoint, boolean readOnly, Map<CDOID,IDurableLockingManager.LockGrade> locks)

### createLockArea

public static IDurableLockingManager.LockArea createLockArea(String durableLockingID)

### createDurableLockingID

public static String createDurableLockingID()

### createDurableLockingID

public static String createDurableLockingID(int bytes)

### appendLockDelta

public static List<CDOLockDelta> appendLockDelta(List<CDOLockDelta> deltas, Object target, org.eclipse.net4j.util.concurrent.IRWLockManager.LockType type, CDOLockOwner oldOwner, CDOLockOwner newOwner)

Since:
  4.15

### appendLockDelta

public static List<CDOLockDelta> appendLockDelta(List<CDOLockDelta> deltas, CDOLockDelta delta)

Since:
  4.15

### toArray

public static CDOLockDelta[] toArray(List<CDOLockDelta> deltas)

Since:
  4.15

### copyLockState

@Deprecated public static CDOLockState copyLockState(CDOLockState lockState)
Deprecated.
As of 4.15 no longer supported.

### copyLockState

@Deprecated public static CDOLockState copyLockState(CDOLockState lockState, Object lockedObject)
Deprecated.
As of 4.15 no longer supported.

Since:
  4.12

### createLockState

@Deprecated public static CDOLockState createLockState(org.eclipse.net4j.util.concurrent.RWOLockManager.LockState<Object,? extends CDOCommonView> lockState)
Deprecated.
As of 4.15 use `convertLockState(LockState)`.

### createLockChangeInfo

@Deprecated public static CDOLockChangeInfo createLockChangeInfo(long timestamp, CDOLockOwner lockOwner, CDOBranch branch, CDOLockChangeInfo.Operation op, org.eclipse.net4j.util.concurrent.IRWLockManager.LockType lockType, CDOLockState[] newLockStates)
Deprecated.
As of 4.15 use `createLockChangeInfo(CDOBranchPoint, CDOLockOwner, Collection, Collection)`.

### createLockChangeInfo

@Deprecated public static CDOLockChangeInfo createLockChangeInfo(long timestamp, CDOCommonView view, CDOBranch viewedBranch, CDOLockChangeInfo.Operation op, org.eclipse.net4j.util.concurrent.IRWLockManager.LockType lockType, CDOLockState[] newLockStates)
Deprecated.
As of 4.15 use `createLockChangeInfo(CDOBranchPoint, CDOLockOwner, Collection, Collection)`.