blob: 1a7cd392217ec1f1f00beefe6d98366b4ee9dae3 [file] [log] [blame]
Phaneendra Manda1c0061d2015-08-06 12:29:38 +05301/*
2 * Copyright 2015 Open Networking Laboratory
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.pcep.controller;
17
18import java.util.List;
19
20import org.onosproject.pcepio.protocol.PcepMessage;
21
22/**
23 * Abstraction of an Pcep controller. Serves as a one stop
24 * shop for obtaining Pcep devices and (un)register listeners
25 * on pcep events
26 */
27public interface PcepClientController {
28
29 /**
30 * Returns list of pcc clients connected to this Pcep controller.
31 *
32 * @return list of PcepClient elements
33 */
34 public List<PcepClient> getClients();
35
36 /**
37 * Returns the actual pcc client for the given ip address.
38 *
39 * @param pccId the id of the pcc client to fetch
40 * @return the interface to this pcc client
41 */
42 public PcepClient getClient(PccId pccId);
43
44 /**
45 * Register a listener for meta events that occur to pcep
46 * devices.
47 *
48 * @param listener the listener to notify
49 */
50 public void addListener(PcepClientListener listener);
51
52 /**
53 * Unregister a listener.
54 *
55 * @param listener the listener to unregister
56 */
57 public void removeListener(PcepClientListener listener);
58
59 /**
60 * Register a listener for OF msg events.
61 *
62 * @param listener the listener to notify
63 */
64 public void addEventListener(PcepEventListener listener);
65
66 /**
67 * Unregister a listener.
68 *
69 * @param listener the listener to unregister
70 */
71 public void removeEventListener(PcepEventListener listener);
72
73 /**
74 * Send a message to a particular pcc client.
75 *
76 * @param pccId the id of the client to send message.
77 * @param msg the message to send
78 */
79 public void writeMessage(PccId pccId, PcepMessage msg);
80
81 /**
82 * Process a message and notify the appropriate listeners.
83 *
84 * @param pccId id of the client the message arrived on
85 * @param msg the message to process.
86 */
87 public void processClientMessage(PccId pccId, PcepMessage msg);
88
89 /**
90 * Close all connected PCC clients.
91 */
92 public void closeConnectedClients();
93}