blob: 37453eac435e487bb15c338c02772d51d47d05e1 [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
SureshBR25058b72015-08-13 13:05:06 +053018import java.util.Collection;
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053019
20import org.onosproject.pcepio.protocol.PcepMessage;
21
22/**
Phanendra Manda51fb9c22015-09-01 16:17:41 +053023 * Abstraction of an Pcep client controller. Serves as a one stop
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053024 * 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 */
SureshBR25058b72015-08-13 13:05:06 +053034 Collection<PcepClient> getClients();
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053035
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 */
SureshBR25058b72015-08-13 13:05:06 +053042 PcepClient getClient(PccId pccId);
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053043
44 /**
45 * Register a listener for meta events that occur to pcep
46 * devices.
47 *
48 * @param listener the listener to notify
49 */
SureshBR25058b72015-08-13 13:05:06 +053050 void addListener(PcepClientListener listener);
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053051
52 /**
53 * Unregister a listener.
54 *
55 * @param listener the listener to unregister
56 */
SureshBR25058b72015-08-13 13:05:06 +053057 void removeListener(PcepClientListener listener);
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053058
59 /**
60 * Register a listener for OF msg events.
61 *
62 * @param listener the listener to notify
63 */
SureshBR25058b72015-08-13 13:05:06 +053064 void addEventListener(PcepEventListener listener);
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053065
66 /**
67 * Unregister a listener.
68 *
69 * @param listener the listener to unregister
70 */
SureshBR25058b72015-08-13 13:05:06 +053071 void removeEventListener(PcepEventListener listener);
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053072
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 */
SureshBR25058b72015-08-13 13:05:06 +053079 void writeMessage(PccId pccId, PcepMessage msg);
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053080
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 */
SureshBR25058b72015-08-13 13:05:06 +053087 void processClientMessage(PccId pccId, PcepMessage msg);
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053088
89 /**
90 * Close all connected PCC clients.
91 */
SureshBR25058b72015-08-13 13:05:06 +053092 void closeConnectedClients();
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053093}