Palash Kala | a06a616 | 2017-11-15 20:42:40 +0900 | [diff] [blame] | 1 | /* |
| 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 | */ |
| 16 | package org.onosproject.net.config; |
| 17 | |
| 18 | import org.onosproject.net.DeviceId; |
| 19 | import org.onosproject.net.device.DeviceDescription; |
| 20 | |
| 21 | import com.google.common.annotations.Beta; |
| 22 | |
| 23 | import 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 |
| 32 | public 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 | } |