2 * Copyright 2015 Open Networking Laboratory
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 package org.onosproject.pcep.controller.driver;
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;
26 * Represents the driver side of an Path computation client(pcc).
29 public interface PcepClientDriver extends PcepClient {
32 * Sets the Pcep agent to be used. This method
33 * can only be called once.
35 * @param agent the agent to set.
37 void setAgent(PcepAgent agent);
40 * Announce to the Pcep agent that this pcc client has connected.
42 * @return true if successful, false if duplicate switch.
44 boolean connectClient();
47 * Remove this pcc client from the Pcep agent.
49 void removeConnectedClient();
52 * Sets the PCEP version for this pcc.
54 * @param pcepVersion the version to set.
56 void setPcVersion(PcepVersion pcepVersion);
59 * Sets the associated Netty channel for this pcc.
61 * @param channel the Netty channel
63 void setChannel(Channel channel);
67 * Sets the keep alive time for this pcc.
69 * @param keepAliveTime the keep alive time to set.
71 void setPcKeepAliveTime(byte keepAliveTime);
74 * Sets the dead time for this pcc.
76 * @param deadTime the dead timer value to set.
78 void setPcDeadTime(byte deadTime);
81 * Sets the session id for this pcc.
83 * @param sessionId the session id value to set.
85 void setPcSessionId(byte sessionId);
88 * Sets whether the pcc is connected.
90 * @param connected whether the pcc is connected
92 void setConnected(boolean connected);
95 * Initializes the behavior.
97 * @param pccId id of pcc
98 * @param pcepVersion Pcep version
99 * @param pktStats Pcep Packet Stats
101 void init(PccId pccId, PcepVersion pcepVersion, PcepPacketStats pktStats);
104 * Checks whether the handshake is complete.
106 * @return true is finished, false if not.
108 boolean isHandshakeComplete();