BUG-5280: synchronize access to local histories
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / OperationCallback.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.controller.cluster.datastore;
10
11 import java.util.concurrent.atomic.AtomicReference;
12
13 interface OperationCallback {
14     OperationCallback NO_OP_CALLBACK = new OperationCallback() {
15         @Override
16         public void run() {
17         }
18
19         @Override
20         public void success() {
21         }
22
23         @Override
24         public void failure() {
25         }
26
27         @Override
28         public void pause() {
29         }
30
31         @Override
32         public void resume() {
33         }
34     };
35
36     class Reference extends AtomicReference<OperationCallback> {
37         private static final long serialVersionUID = 1L;
38
39         Reference(OperationCallback initialValue) {
40             super(initialValue);
41         }
42     }
43
44     void run();
45
46     void pause();
47
48     void resume();
49
50     void success();
51
52     void failure();
53 }