blob: afeeae83f6b6e0220b9dca73cf03f08caa58f4e6 [file] [log] [blame]
Phaneendra Manda1c0061d2015-08-06 12:29:38 +05301/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Phaneendra Manda1c0061d2015-08-06 12:29:38 +05303 *
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;
17
18import java.util.List;
19
20import org.onosproject.pcepio.protocol.PcepFactory;
21import org.onosproject.pcepio.protocol.PcepMessage;
22
23/**
24 * Represents to provider facing side of a path computation client(pcc).
25 */
26public interface PcepClient {
27
28 /**
29 * Writes the message to the driver.
30 *
31 * @param msg the message to write
32 */
Sho SHIMIZU5fe04e02015-09-04 15:06:33 -070033 void sendMessage(PcepMessage msg);
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053034
35 /**
36 * Writes the PcepMessage list to the driver.
37 *
38 * @param msgs the messages to be written
39 */
Sho SHIMIZU5fe04e02015-09-04 15:06:33 -070040 void sendMessage(List<PcepMessage> msgs);
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053041
42 /**
43 * Handle a message from the pcc.
44 *
45 * @param fromClient the message to handle
46 */
Sho SHIMIZU5fe04e02015-09-04 15:06:33 -070047 void handleMessage(PcepMessage fromClient);
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053048
49 /**
50 * Provides the factory for this PCEP version.
51 *
52 * @return PCEP version specific factory.
53 */
Sho SHIMIZU5fe04e02015-09-04 15:06:33 -070054 PcepFactory factory();
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053055
56 /**
57 * Gets a string version of the ID for this pcc.
58 *
59 * @return string version of the ID
60 */
Sho SHIMIZU5fe04e02015-09-04 15:06:33 -070061 String getStringId();
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053062
63 /**
64 * Gets the ipAddress of the client.
65 *
66 * @return the client pccId in IPAddress format
67 */
Sho SHIMIZU5fe04e02015-09-04 15:06:33 -070068 PccId getPccId();
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053069
70 /**
71 * Checks if the pcc is still connected.
72 *
73 * @return true if client is connected, false otherwise
74 */
Sho SHIMIZU5fe04e02015-09-04 15:06:33 -070075 boolean isConnected();
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053076
77 /**
78 * Disconnects the pcc by closing the TCP connection. Results in a call
79 * to the channel handler's channelDisconnected method for cleanup.
80 */
Sho SHIMIZU5fe04e02015-09-04 15:06:33 -070081 void disconnectClient();
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053082
83 /**
84 * Indicates if this pcc is optical.
85 *
86 * @return true if optical
87 */
Sho SHIMIZU5fe04e02015-09-04 15:06:33 -070088 boolean isOptical();
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053089
90 /**
91 * Identifies the channel used to communicate with the pcc.
92 *
93 * @return string representation of the connection to the client
94 */
Sho SHIMIZU5fe04e02015-09-04 15:06:33 -070095 String channelId();
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053096
97 /**
Avantika-Huawei7f7376a2016-05-11 17:07:50 +053098 * Sets the status of LSP state synchronization.
Phaneendra Manda1c0061d2015-08-06 12:29:38 +053099 *
Avantika-Huawei7f7376a2016-05-11 17:07:50 +0530100 * @param syncStatus LSP synchronization status to be set
Phaneendra Manda1c0061d2015-08-06 12:29:38 +0530101 */
Avantika-Huawei7f7376a2016-05-11 17:07:50 +0530102 void setLspDbSyncStatus(PcepSyncStatus syncStatus);
Phaneendra Manda1c0061d2015-08-06 12:29:38 +0530103
104 /**
Avantika-Huawei7f7376a2016-05-11 17:07:50 +0530105 * Indicates the LSP state synchronization status of this pcc.
Phaneendra Manda1c0061d2015-08-06 12:29:38 +0530106 *
Avantika-Huawei7f7376a2016-05-11 17:07:50 +0530107 * @return LSP state synchronization status.
Phaneendra Manda1c0061d2015-08-06 12:29:38 +0530108 */
Avantika-Huawei7f7376a2016-05-11 17:07:50 +0530109 PcepSyncStatus lspDbSyncStatus();
110
111 /**
112 * Sets the status of label DB synchronization.
113 *
114 * @param syncStatus label DB synchronization status to be set
115 */
116 void setLabelDbSyncStatus(PcepSyncStatus syncStatus);
117
118 /**
119 * Indicates the label DB synchronization status of this pcc.
120 *
121 * @return label DB synchronization status.
122 */
123 PcepSyncStatus labelDbSyncStatus();
Priyanka Bd2b28882016-04-04 16:57:04 +0530124
125 /**
126 * Sets capability negotiated during open message exchange.
127 *
128 * @param capability supported by client
129 */
130 void setCapability(ClientCapability capability);
131
132 /**
133 * Obtains capability supported by client.
134 *
135 * @return capability supported by client
136 */
137 ClientCapability capability();
Phaneendra Manda1c0061d2015-08-06 12:29:38 +0530138}