f728de544f3948c105a6d6556feb5180455ea695
[onosfw.git] /
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.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      */
37     void setAgent(PcepAgent agent);
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      */
44     boolean connectClient();
45
46     /**
47      * Remove this pcc client from the Pcep agent.
48      */
49     void removeConnectedClient();
50
51     /**
52      * Sets the PCEP version for this pcc.
53      *
54      * @param pcepVersion the version to set.
55      */
56     void setPcVersion(PcepVersion pcepVersion);
57
58     /**
59      * Sets the associated Netty channel for this pcc.
60      *
61      * @param channel the Netty channel
62      */
63     void setChannel(Channel channel);
64
65
66     /**
67      * Sets the keep alive time for this pcc.
68      *
69      * @param keepAliveTime the keep alive time to set.
70      */
71     void setPcKeepAliveTime(byte keepAliveTime);
72
73     /**
74      * Sets the dead time for this pcc.
75      *
76      * @param deadTime the dead timer value to set.
77      */
78     void setPcDeadTime(byte deadTime);
79
80     /**
81      * Sets the session id for this pcc.
82      *
83      * @param sessionId the session id value to set.
84      */
85     void setPcSessionId(byte sessionId);
86
87     /**
88      * Sets whether the pcc is connected.
89      *
90      * @param connected whether the pcc is connected
91      */
92     void setConnected(boolean connected);
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 }