Phaneendra Manda | 1c0061d | 2015-08-06 12:29:38 +0530 | [diff] [blame] | 1 | /* |
| 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 | */ |
| 16 | package org.onosproject.pcep.controller.driver; |
| 17 | |
| 18 | import org.onosproject.pcep.controller.PccId; |
| 19 | import org.onosproject.pcep.controller.PcepClient; |
| 20 | import 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 | */ |
| 27 | public 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 SHIMIZU | 5fe04e0 | 2015-09-04 15:06:33 -0700 | [diff] [blame] | 36 | boolean addConnectedClient(PccId pccId, PcepClient pc); |
Phaneendra Manda | 1c0061d | 2015-08-06 12:29:38 +0530 | [diff] [blame] | 37 | |
| 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 SHIMIZU | 5fe04e0 | 2015-09-04 15:06:33 -0700 | [diff] [blame] | 44 | boolean validActivation(PccId pccId); |
Phaneendra Manda | 1c0061d | 2015-08-06 12:29:38 +0530 | [diff] [blame] | 45 | |
| 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 SHIMIZU | 5fe04e0 | 2015-09-04 15:06:33 -0700 | [diff] [blame] | 53 | void removeConnectedClient(PccId pccIds); |
Phaneendra Manda | 1c0061d | 2015-08-06 12:29:38 +0530 | [diff] [blame] | 54 | |
| 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 SHIMIZU | 5fe04e0 | 2015-09-04 15:06:33 -0700 | [diff] [blame] | 61 | void processPcepMessage(PccId pccId, PcepMessage m); |
Phaneendra Manda | 1c0061d | 2015-08-06 12:29:38 +0530 | [diff] [blame] | 62 | |
| 63 | } |