blob: f01abf4a02f4d04c0f6bc68cd2c7363f55c031b6 [file] [log] [blame]
Palash Kalaa06a6162017-11-15 20:42:40 +09001/*
2 * Copyright 2016-present Open Networking Foundation
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.config;
17
18import org.onosproject.net.DeviceId;
19import org.onosproject.net.device.DeviceDescription;
20
21import com.google.common.annotations.Beta;
22
23import java.util.Optional;
24
25
26/**
27 * {@link ConfigOperator} for Device.
28 * <p>
29 * Note: We currently assume {@link DeviceConfigOperator}s are commutative.
30 */
31@Beta
32public interface DeviceConfigOperator extends ConfigOperator {
33
34 /**
35 * Binds {@link NetworkConfigService} to use for retrieving configuration.
36 *
37 * @param networkConfigService the service to use
38 */
39 void bindService(NetworkConfigService networkConfigService);
40
41
42 /**
43 * Generates a DeviceDescription containing fields from a DeviceDescription and
44 * configuration.
45 *
46 * @param deviceId {@link DeviceId} representing the port.
47 * @param descr input {@link DeviceDescription}
48 * @param prevConfig previous config {@link Config}
49 * @return Combined {@link DeviceDescription}
50 */
51 DeviceDescription combine(DeviceId deviceId, DeviceDescription descr,
52 Optional<Config> prevConfig);
53}