blob: 7b28f0b51759cea4a9020f3ba91bee76d7777c83 [file] [log] [blame]
Andrea Campanella241896c2017-05-10 13:11:04 -07001/*
2 * Copyright 2015-present 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.net.driver;
17
18import com.google.common.annotations.Beta;
19
20import java.util.concurrent.CompletableFuture;
21
22/**
23 * Abstraction of handler behaviour used to set-up and tear-down
24 * connection with a device.
25 */
26@Beta
27public interface DeviceConnect extends HandlerBehaviour {
28
29 /**
30 * Connects to the device.
31 * It's supposed to initiate the transport sessions, channel and also,
32 * if applicable, store them in the proper protocol specific
33 * controller (e.g. GrpcController).
34 *
35 * @return CompletableFuture with true if the operation was successful
36 */
37 CompletableFuture<Boolean> connect();
38
39 /**
40 * Disconnects from the device.
41 * It's supposed to destroy the transport sessions and channel and also,
42 * if applicable, remove them in the proper protocol specific
43 * controller (e.g. GrpcController).
44 *
45 * @return CompletableFuture with true if the operation was successful
46 */
47 CompletableFuture<Boolean> disconnect();
48
49}