blob: 271dc106d796d4beea8837f279909353b37c492e [file] [log] [blame]
Jordan Haltermanb8cace72018-07-02 17:39:21 -07001/*
2 * Copyright 2018-present Open Networking Foundation
3 *
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.cluster;
17
18/**
19 * Constructs proxy instances for nodes in the cluster.
20 * <p>
21 * The proxy factory constructs proxy instances for the master node of a given {@link NodeId}.
22 * When a proxy method is invoked, the method will be called on the provided node.
23 */
24public interface ProxyFactory<T> {
25
26 /**
27 * Returns the proxy for the given peer.
28 * <p>
29 * The proxy instance is a multiton that is cached internally in the factory, so calling this method
30 *
31 * @param nodeId the peer node identifier
32 * @return the proxy for the given peer
33 */
34 T getProxyFor(NodeId nodeId);
35
36}