Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 3669f9abe3c72d863feb1285fa736d937888471a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/**
 * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *    Caspar De Groot - initial API and implementation
 */
package org.eclipse.emf.cdo.common.lock;

import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;

import org.eclipse.net4j.util.concurrent.IRWLockManager.LockType;

/**
 * Represents a change in the lock state of a set of objects. Instances are meant to be sent from the server to the
 * client for the purpose of notifying the latter.
 * 
 * @author Caspar De Groot
 * @since 4.1
 * @noextend This interface is not intended to be extended by clients.
 * @noimplement This interface is not intended to be implemented by clients.
 * @apiviz.has {@link CDOLockOwner}
 * @apiviz.has {@link CDOLockChangeInfo.Operation}
 * @apiviz.has {@link org.eclipse.net4j.util.concurrent.IRWLockManager.LockType}
 * @apiviz.composedOf {@link CDOLockState}
 */
public interface CDOLockChangeInfo extends CDOBranchPoint
{
  /**
   * @return The branch at which the lock changes took place, same as <code>getView().getBranch()</code>.
   */
  public CDOBranch getBranch();

  /**
   * @return The repository time at which the lock changes took place. This is only an informal indication; no formal
   *         relation (e.g. an ordering) with commit timestamps is guaranteed.
   */
  public long getTimeStamp();

  /**
   * @return The view, represented as a {@link CDOLockOwner}, that authored the lock changes.
   */
  public CDOLockOwner getLockOwner();

  /**
   * @return The new lock states of the objects that were affected by the change
   */
  public CDOLockState[] getLockStates();

  /**
   * @return the type of lock operation that caused the lock changes
   */
  public Operation getOperation();

  /**
   * @return the type of locks that were affected by the lock operation
   */
  public LockType getLockType();

  /**
   * Enumerates the possible locking operations.
   * 
   * @author Caspar De Groot
   */
  public enum Operation
  {
    LOCK, UNLOCK
  }
}

Back to the top