blob: 75e0a5f66c1033ac28061529bd86bf9b6602d4c4 [file] [log] [blame]
Ray Milkeyb3c5ce22015-08-10 09:07:36 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
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
18import java.util.Set;
19import java.util.concurrent.CompletableFuture;
20import java.util.concurrent.Executor;
21import java.util.concurrent.ExecutorService;
22import java.util.function.Consumer;
23import java.util.function.Function;
24
25import org.onosproject.cluster.NodeId;
26
27/**
28 * Testing adapter for the cluster communication service.
29 */
30public class ClusterCommunicationServiceAdapter
31 implements ClusterCommunicationService {
32
33 @Override
34 public void addSubscriber(MessageSubject subject,
35 ClusterMessageHandler subscriber,
36 ExecutorService executor) {
37 }
38
39 @Override
40 public void removeSubscriber(MessageSubject subject) {}
41
42 @Override
43 public <M> void broadcast(M message, MessageSubject subject,
44 Function<M, byte[]> encoder) {
45 }
46
47 @Override
48 public <M> void broadcastIncludeSelf(M message,
49 MessageSubject subject, Function<M, byte[]> encoder) {
50 }
51
52 @Override
53 public <M> CompletableFuture<Void> unicast(M message, MessageSubject subject,
54 Function<M, byte[]> encoder, NodeId toNodeId) {
55 return null;
56 }
57
58 @Override
59 public <M> void multicast(M message, MessageSubject subject,
60 Function<M, byte[]> encoder, Set<NodeId> nodes) {
61 }
62
63 @Override
64 public <M, R> CompletableFuture<R> sendAndReceive(M message,
65 MessageSubject subject, Function<M, byte[]> encoder,
66 Function<byte[], R> decoder, NodeId toNodeId) {
67 return null;
68 }
69
70 @Override
71 public <M, R> void addSubscriber(MessageSubject subject,
72 Function<byte[], M> decoder, Function<M, R> handler,
73 Function<R, byte[]> encoder, Executor executor) {
74 }
75
76 @Override
77 public <M, R> void addSubscriber(MessageSubject subject,
78 Function<byte[], M> decoder, Function<M, CompletableFuture<R>> handler,
79 Function<R, byte[]> encoder) {
80 }
81
82 @Override
83 public <M> void addSubscriber(MessageSubject subject,
84 Function<byte[], M> decoder, Consumer<M> handler,
85 Executor executor) {
86
87 }
88}