BUG-5280: add basic concept of ClientSnapshot
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / databroker / actors / dds / ProxyReconnectCohort.java
1 /*
2  * Copyright (c) 2016 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 package org.opendaylight.controller.cluster.databroker.actors.dds;
9
10 import java.util.function.BiConsumer;
11 import java.util.function.Consumer;
12 import org.opendaylight.controller.cluster.access.client.ConnectionEntry;
13 import org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifier;
14 import org.opendaylight.controller.cluster.access.concepts.Request;
15 import org.opendaylight.controller.cluster.access.concepts.RequestException;
16 import org.opendaylight.controller.cluster.access.concepts.Response;
17 import org.opendaylight.yangtools.concepts.Identifiable;
18
19 abstract class ProxyReconnectCohort implements Identifiable<LocalHistoryIdentifier> {
20
21     abstract void replaySuccessfulRequests(Iterable<ConnectionEntry> previousEntries);
22
23     abstract ProxyHistory finishReconnect();
24
25     abstract void replayRequest(Request<?, ?> request, Consumer<Response<?, ?>> callback,
26             BiConsumer<Request<?, ?>, Consumer<Response<?, ?>>> replayTo) throws RequestException;
27 }