blob: 2c478ece53bf2e517a201a4ade19ce70702ab163 [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 */
33 public void sendMessage(PcepMessage msg);
34
35 /**
36 * Writes the PcepMessage list to the driver.
37 *
38 * @param msgs the messages to be written
39 */
40 public void sendMessage(List<PcepMessage> msgs);
41
42 /**
43 * Handle a message from the pcc.
44 *
45 * @param fromClient the message to handle
46 */
47 public void handleMessage(PcepMessage fromClient);
48
49 /**
50 * Provides the factory for this PCEP version.
51 *
52 * @return PCEP version specific factory.
53 */
54 public PcepFactory factory();
55
56 /**
57 * Gets a string version of the ID for this pcc.
58 *
59 * @return string version of the ID
60 */
61 public String getStringId();
62
63 /**
64 * Gets the ipAddress of the client.
65 *
66 * @return the client pccId in IPAddress format
67 */
68 public PccId getPccId();
69
70 /**
71 * Checks if the pcc is still connected.
72 *
73 * @return true if client is connected, false otherwise
74 */
75 public boolean isConnected();
76
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 */
81 public void disconnectClient();
82
83 /**
84 * Indicates if this pcc is optical.
85 *
86 * @return true if optical
87 */
88 public boolean isOptical();
89
90 /**
91 * Identifies the channel used to communicate with the pcc.
92 *
93 * @return string representation of the connection to the client
94 */
95 public String channelId();
96
97 /**
98 * To set the status of state synchronization.
99 *
100 * @param value to set the synchronization status
101 */
102 public void setIsSyncComplete(boolean value);
103
104 /**
105 * Indicates the state synchronization status of this pcc.
106 *
107 * @return true/false if the synchronization is completed/not completed
108 */
109 public boolean isSyncComplete();
110}