blob: 0cf805b25d273adb50edba9c2d226a93bd5b400f [file] [log] [blame]
Ray Milkeyb3c5ce22015-08-10 09:07:36 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
Ray Milkeyb3c5ce22015-08-10 09:07:36 -07003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.store.cluster.messaging;
17
Jordan Halterman43300782019-05-21 11:27:50 -070018import java.time.Duration;
Ray Milkeyb3c5ce22015-08-10 09:07:36 -070019import java.util.Set;
20import java.util.concurrent.CompletableFuture;
21import java.util.concurrent.Executor;
22import java.util.concurrent.ExecutorService;
23import java.util.function.Consumer;
24import java.util.function.Function;
25
26import org.onosproject.cluster.NodeId;
27
28/**
29 * Testing adapter for the cluster communication service.
30 */
31public class ClusterCommunicationServiceAdapter
32 implements ClusterCommunicationService {
33
34 @Override
35 public void addSubscriber(MessageSubject subject,
36 ClusterMessageHandler subscriber,
37 ExecutorService executor) {
38 }
39
40 @Override
41 public void removeSubscriber(MessageSubject subject) {}
42
43 @Override
44 public <M> void broadcast(M message, MessageSubject subject,
45 Function<M, byte[]> encoder) {
46 }
47
48 @Override
49 public <M> void broadcastIncludeSelf(M message,
50 MessageSubject subject, Function<M, byte[]> encoder) {
51 }
52
53 @Override
54 public <M> CompletableFuture<Void> unicast(M message, MessageSubject subject,
55 Function<M, byte[]> encoder, NodeId toNodeId) {
56 return null;
57 }
58
59 @Override
60 public <M> void multicast(M message, MessageSubject subject,
61 Function<M, byte[]> encoder, Set<NodeId> nodes) {
62 }
63
64 @Override
65 public <M, R> CompletableFuture<R> sendAndReceive(M message,
66 MessageSubject subject, Function<M, byte[]> encoder,
Jordan Halterman43300782019-05-21 11:27:50 -070067 Function<byte[], R> decoder, NodeId toNodeId, Duration timeout) {
Ray Milkeyb3c5ce22015-08-10 09:07:36 -070068 return null;
69 }
70
71 @Override
72 public <M, R> void addSubscriber(MessageSubject subject,
73 Function<byte[], M> decoder, Function<M, R> handler,
74 Function<R, byte[]> encoder, Executor executor) {
75 }
76
77 @Override
78 public <M, R> void addSubscriber(MessageSubject subject,
79 Function<byte[], M> decoder, Function<M, CompletableFuture<R>> handler,
80 Function<R, byte[]> encoder) {
81 }
82
83 @Override
84 public <M> void addSubscriber(MessageSubject subject,
85 Function<byte[], M> decoder, Consumer<M> handler,
86 Executor executor) {
87
88 }
89}