atomic-storage: remove type dependency at segment level I/O
[controller.git] / opendaylight / md-sal / sal-remoterpc-connector / src / main / java / org / opendaylight / controller / remote / rpc / registry / gossip / GossipEnvelope.java
1 /*
2  * Copyright (c) 2017 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.remote.rpc.registry.gossip;
9
10 import static java.util.Objects.requireNonNull;
11
12 import akka.actor.Address;
13 import com.google.common.collect.ImmutableMap;
14 import java.io.Serializable;
15 import java.util.Map;
16
17 final class GossipEnvelope implements Serializable {
18     private static final long serialVersionUID = 1L;
19
20     private final Map<Address, Bucket<?>> buckets;
21     private final Address from;
22     private final Address to;
23
24     GossipEnvelope(final Address from, final Address to, final Map<Address, ? extends Bucket<?>> buckets) {
25         this.to = requireNonNull(to);
26         this.buckets = ImmutableMap.copyOf(buckets);
27         this.from = from;
28     }
29
30     Map<Address, Bucket<?>> buckets() {
31         return buckets;
32     }
33
34     Address from() {
35         return from;
36     }
37
38     Address to() {
39         return to;
40     }
41 }