blob: 8134f49eb78498b6da3599b7ba4eb7f6b98f0dc6 [file] [log] [blame]
RafaƂ Szaleckide5cf842018-11-17 13:30:01 +01001/*
2 * Copyright 2018-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 com.google.common.annotations.Beta;
19import org.onosproject.net.HostId;
20import org.onosproject.net.host.HostDescription;
21
22import java.util.Optional;
23
24
25/**
26 * {@link ConfigOperator} for Host.
27 * <p>
28 * Note: We currently assume {@link HostConfigOperator}s are commutative.
29 */
30@Beta
31public interface HostConfigOperator extends ConfigOperator {
32
33 /**
34 * Binds {@link NetworkConfigService} to use for retrieving configuration.
35 *
36 * @param networkConfigService the service to use
37 */
38 void bindService(NetworkConfigService networkConfigService);
39
40
41 /**
42 * Generates a HostDescription containing fields from a HostDescription and
43 * configuration.
44 *
45 * @param hostId {@link HostId} representing the port.
46 * @param descr input {@link HostDescription}
47 * @param prevConfig previous config {@link Config}
48 * @return Combined {@link HostDescription}
49 */
50 HostDescription combine(HostId hostId, HostDescription descr,
51 Optional<Config> prevConfig);
52}