2 * Copyright (C) 2014 Cisco Systems, Inc.
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
8 * Authors : Thomas Bachman
10 package org.opendaylight.groupbasedpolicy.renderer.opflex.jsonrpc;
13 * The {@link RpcBroker} provides a content-based pub/sub per RpcMessage
14 * type. This allows clients to register for the messages they are interested
19 public interface RpcBroker {
22 * The {@link RpcCallback} provides a callback interface for the
23 * {@link RpcBroker}. When the broker needs to publish a new
24 * {@link RpcMessage}, it invokes the callbacks that were
25 * registered for that message.
29 public interface RpcCallback {
32 * Callback that's invoked when the {@link RpcMessage}
33 * request message is received
35 * @param endpoint The endpoint that received the messgae
36 * @param message The concrete {@link RpcMessage} received
38 public void callback(JsonRpcEndpoint endpoint, RpcMessage message);
44 * Subscribe to a concrete {@link RpcMessage}
46 * @param message The concrete {@link RpcMessage} message to subscribe to
47 * @param callback The callback to invoke when the message is published
50 public void subscribe(RpcMessage message, RpcCallback callback);
53 * Notification to call when a new {@link RpcMessage} request
56 * @param endpoint The endpoint that received this message
57 * @param message the concrete {@link RpcMessage}
59 public void publish(JsonRpcEndpoint endpoint, RpcMessage message);