Merge "BUG-2288: deprecate old binding Notification API elements"
[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
28     class Reference extends AtomicReference<OperationCallback> {
29         private static final long serialVersionUID = 1L;
30
31         public Reference(OperationCallback initialValue) {
32             super(initialValue);
33         }
34     }
35
36     void run();
37     void success();
38     void failure();
39 }