blob: f728de544f3948c105a6d6556feb5180455ea695 [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.driver;
17
18import org.jboss.netty.channel.Channel;
19import org.onosproject.pcep.controller.PccId;
20import org.onosproject.pcep.controller.PcepClient;
21import org.onosproject.pcep.controller.PcepPacketStats;
22import org.onosproject.pcepio.protocol.PcepVersion;
23
24
25/**
26 * Represents the driver side of an Path computation client(pcc).
27 *
28 */
29public 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 SHIMIZU5fe04e02015-09-04 15:06:33 -070037 void setAgent(PcepAgent agent);
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053038
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 SHIMIZU5fe04e02015-09-04 15:06:33 -070044 boolean connectClient();
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053045
46 /**
47 * Remove this pcc client from the Pcep agent.
48 */
Sho SHIMIZU5fe04e02015-09-04 15:06:33 -070049 void removeConnectedClient();
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053050
51 /**
52 * Sets the PCEP version for this pcc.
53 *
54 * @param pcepVersion the version to set.
55 */
Sho SHIMIZU5fe04e02015-09-04 15:06:33 -070056 void setPcVersion(PcepVersion pcepVersion);
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053057
58 /**
59 * Sets the associated Netty channel for this pcc.
60 *
61 * @param channel the Netty channel
62 */
Sho SHIMIZU5fe04e02015-09-04 15:06:33 -070063 void setChannel(Channel channel);
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053064
65
66 /**
67 * Sets the keep alive time for this pcc.
68 *
69 * @param keepAliveTime the keep alive time to set.
70 */
Sho SHIMIZU5fe04e02015-09-04 15:06:33 -070071 void setPcKeepAliveTime(byte keepAliveTime);
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053072
73 /**
74 * Sets the dead time for this pcc.
75 *
76 * @param deadTime the dead timer value to set.
77 */
Sho SHIMIZU5fe04e02015-09-04 15:06:33 -070078 void setPcDeadTime(byte deadTime);
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053079
80 /**
81 * Sets the session id for this pcc.
82 *
83 * @param sessionId the session id value to set.
84 */
Sho SHIMIZU5fe04e02015-09-04 15:06:33 -070085 void setPcSessionId(byte sessionId);
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053086
87 /**
88 * Sets whether the pcc is connected.
89 *
90 * @param connected whether the pcc is connected
91 */
Sho SHIMIZU5fe04e02015-09-04 15:06:33 -070092 void setConnected(boolean connected);
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053093
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}