Phaneendra Manda | 1c0061d | 2015-08-06 12:29:38 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Laboratory |
Phaneendra Manda | 1c0061d | 2015-08-06 12:29:38 +0530 | [diff] [blame] | 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.jboss.netty.channel.Channel; |
| 19 | import org.onosproject.pcep.controller.PccId; |
| 20 | import org.onosproject.pcep.controller.PcepClient; |
| 21 | import org.onosproject.pcep.controller.PcepPacketStats; |
| 22 | import org.onosproject.pcepio.protocol.PcepVersion; |
| 23 | |
| 24 | |
| 25 | /** |
| 26 | * Represents the driver side of an Path computation client(pcc). |
| 27 | * |
| 28 | */ |
| 29 | public interface PcepClientDriver extends PcepClient { |
| 30 | |
| 31 | /** |
| 32 | * Sets the Pcep agent to be used. This method |
| 33 | * can only be called once. |
| 34 | * |
| 35 | * @param agent the agent to set. |
| 36 | */ |
Sho SHIMIZU | 5fe04e0 | 2015-09-04 15:06:33 -0700 | [diff] [blame] | 37 | void setAgent(PcepAgent agent); |
Phaneendra Manda | 1c0061d | 2015-08-06 12:29:38 +0530 | [diff] [blame] | 38 | |
| 39 | /** |
| 40 | * Announce to the Pcep agent that this pcc client has connected. |
| 41 | * |
| 42 | * @return true if successful, false if duplicate switch. |
| 43 | */ |
Sho SHIMIZU | 5fe04e0 | 2015-09-04 15:06:33 -0700 | [diff] [blame] | 44 | boolean connectClient(); |
Phaneendra Manda | 1c0061d | 2015-08-06 12:29:38 +0530 | [diff] [blame] | 45 | |
| 46 | /** |
| 47 | * Remove this pcc client from the Pcep agent. |
| 48 | */ |
Sho SHIMIZU | 5fe04e0 | 2015-09-04 15:06:33 -0700 | [diff] [blame] | 49 | void removeConnectedClient(); |
Phaneendra Manda | 1c0061d | 2015-08-06 12:29:38 +0530 | [diff] [blame] | 50 | |
| 51 | /** |
| 52 | * Sets the PCEP version for this pcc. |
| 53 | * |
| 54 | * @param pcepVersion the version to set. |
| 55 | */ |
Sho SHIMIZU | 5fe04e0 | 2015-09-04 15:06:33 -0700 | [diff] [blame] | 56 | void setPcVersion(PcepVersion pcepVersion); |
Phaneendra Manda | 1c0061d | 2015-08-06 12:29:38 +0530 | [diff] [blame] | 57 | |
| 58 | /** |
| 59 | * Sets the associated Netty channel for this pcc. |
| 60 | * |
| 61 | * @param channel the Netty channel |
| 62 | */ |
Sho SHIMIZU | 5fe04e0 | 2015-09-04 15:06:33 -0700 | [diff] [blame] | 63 | void setChannel(Channel channel); |
Phaneendra Manda | 1c0061d | 2015-08-06 12:29:38 +0530 | [diff] [blame] | 64 | |
| 65 | |
| 66 | /** |
| 67 | * Sets the keep alive time for this pcc. |
| 68 | * |
| 69 | * @param keepAliveTime the keep alive time to set. |
| 70 | */ |
Sho SHIMIZU | 5fe04e0 | 2015-09-04 15:06:33 -0700 | [diff] [blame] | 71 | void setPcKeepAliveTime(byte keepAliveTime); |
Phaneendra Manda | 1c0061d | 2015-08-06 12:29:38 +0530 | [diff] [blame] | 72 | |
| 73 | /** |
| 74 | * Sets the dead time for this pcc. |
| 75 | * |
| 76 | * @param deadTime the dead timer value to set. |
| 77 | */ |
Sho SHIMIZU | 5fe04e0 | 2015-09-04 15:06:33 -0700 | [diff] [blame] | 78 | void setPcDeadTime(byte deadTime); |
Phaneendra Manda | 1c0061d | 2015-08-06 12:29:38 +0530 | [diff] [blame] | 79 | |
| 80 | /** |
| 81 | * Sets the session id for this pcc. |
| 82 | * |
| 83 | * @param sessionId the session id value to set. |
| 84 | */ |
Sho SHIMIZU | 5fe04e0 | 2015-09-04 15:06:33 -0700 | [diff] [blame] | 85 | void setPcSessionId(byte sessionId); |
Phaneendra Manda | 1c0061d | 2015-08-06 12:29:38 +0530 | [diff] [blame] | 86 | |
| 87 | /** |
| 88 | * Sets whether the pcc is connected. |
| 89 | * |
| 90 | * @param connected whether the pcc is connected |
| 91 | */ |
Sho SHIMIZU | 5fe04e0 | 2015-09-04 15:06:33 -0700 | [diff] [blame] | 92 | void setConnected(boolean connected); |
Phaneendra Manda | 1c0061d | 2015-08-06 12:29:38 +0530 | [diff] [blame] | 93 | |
| 94 | /** |
| 95 | * Initializes the behavior. |
| 96 | * |
| 97 | * @param pccId id of pcc |
| 98 | * @param pcepVersion Pcep version |
| 99 | * @param pktStats Pcep Packet Stats |
| 100 | */ |
| 101 | void init(PccId pccId, PcepVersion pcepVersion, PcepPacketStats pktStats); |
| 102 | |
| 103 | /** |
| 104 | * Checks whether the handshake is complete. |
| 105 | * |
| 106 | * @return true is finished, false if not. |
| 107 | */ |
| 108 | boolean isHandshakeComplete(); |
| 109 | |
| 110 | } |