blob: 95e7789fa50a7d376741a3bbc231678f338e98e9 [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;
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 /**
98 * To set the status of state synchronization.
99 *
100 * @param value to set the synchronization status
101 */
Sho SHIMIZU5fe04e02015-09-04 15:06:33 -0700102 void setIsSyncComplete(boolean value);
Phaneendra Manda1c0061d2015-08-06 12:29:38 +0530103
104 /**
105 * Indicates the state synchronization status of this pcc.
106 *
107 * @return true/false if the synchronization is completed/not completed
108 */
Sho SHIMIZU5fe04e02015-09-04 15:06:33 -0700109 boolean isSyncComplete();
Phaneendra Manda1c0061d2015-08-06 12:29:38 +0530110}