Further Guava Optional cleanups
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / PeerAddressResolver.java
1 /*
2  * Copyright (c) 2015 Brocade Communications 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.raft;
9
10 import org.eclipse.jdt.annotation.Nullable;
11
12 /**
13  * Interface to resolve raft actor peer addresses.
14  *
15  * @author Thomas Pantelis
16  */
17 @FunctionalInterface
18 public interface PeerAddressResolver {
19     /**
20      * Resolves a raft actor peer id to its remote actor address.
21      *
22      * @param peerId the id of the peer to resolve
23      * @return the peer's actor path string or null if not found
24      */
25     @Nullable String resolve(String peerId);
26
27     /**
28      * Sets the actor address for a raft peer.
29      *
30      * @param peerId the id of the peer
31      * @param address the peer's actor's address
32      */
33     default void setResolved(String peerId, String address) {
34
35     }
36 }