c20b10229a54bcd5c09ad077dca77855058175e8
[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         public Reference(OperationCallback initialValue) {
40             super(initialValue);
41         }
42     }
43
44     void run();
45     void pause();
46     void resume();
47     void success();
48     void failure();
49 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.