blob: 42f25cc50485ba561c3e3d104becb41785ac3e20 [file] [log] [blame]
Phaneendra Manda1c0061d2015-08-06 12:29:38 +05301/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
Phaneendra Manda1c0061d2015-08-06 12:29:38 +05303 *
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 */
harikrushna-Huawei6ecfc772017-04-10 18:22:00 +053016package org.onosproject.pcep.server.driver;
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053017
harikrushna-Huawei6ecfc772017-04-10 18:22:00 +053018import org.onosproject.pcep.server.PccId;
19import org.onosproject.pcep.server.PcepClient;
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053020import org.onosproject.pcepio.protocol.PcepMessage;
21
22/**
23 * Responsible for keeping track of the current set Pcep clients
24 * connected to the system.
25 *
26 */
27public interface PcepAgent {
28
29 /**
30 * Add a pcc client that has just connected to the system.
31 *
32 * @param pccId the id of pcc client to add
33 * @param pc the actual pce client object.
34 * @return true if added, false otherwise.
35 */
Sho SHIMIZU5fe04e02015-09-04 15:06:33 -070036 boolean addConnectedClient(PccId pccId, PcepClient pc);
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053037
38 /**
39 * Checks if the activation for this pcc client is valid.
40 *
41 * @param pccId the id of pcc client to check
42 * @return true if valid, false otherwise
43 */
Sho SHIMIZU5fe04e02015-09-04 15:06:33 -070044 boolean validActivation(PccId pccId);
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053045
46 /**
47 * Clear all state in controller client maps for a pcc client that has
48 * disconnected from the local controller. Also release control for
49 * that pccIds client from the global repository. Notify client listeners.
50 *
51 * @param pccIds the id of pcc client to remove.
52 */
Sho SHIMIZU5fe04e02015-09-04 15:06:33 -070053 void removeConnectedClient(PccId pccIds);
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053054
55 /**
56 * Process a message coming from a pcc client.
57 *
58 * @param pccId the id of pcc client the message was received.
59 * @param m the message to process
60 */
Sho SHIMIZU5fe04e02015-09-04 15:06:33 -070061 void processPcepMessage(PccId pccId, PcepMessage m);
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053062
Priyanka B94395bf2016-05-21 18:39:46 +053063 /**
64 * Adds PCEP device when session is successfully established.
65 *
66 * @param pc PCEP client details
67 */
68 void addNode(PcepClient pc);
69
70 /**
71 * Removes PCEP device when session is disconnected.
72 *
73 * @param pccId PCEP client ID
74 */
75 void deleteNode(PccId pccId);
Avantika-Huaweid1e36bd2016-05-26 12:47:16 +053076
77 /**
78 * Analyzes report messages received during LSP DB sync again tunnel store and takes necessary actions.
79 *
80 * @param pccId the id of pcc client
81 * @return success or failure
82 */
83 boolean analyzeSyncMsgList(PccId pccId);
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053084}