blob: e89b6be763a6dee86ec7b5c41f5f009bb023f44d [file] [log] [blame]
Hyunsun Moon5c143952016-10-19 18:34:46 -07001/*
Brian O'Connor80dff972017-08-03 22:46:30 -07002 * Copyright 2016-present Open Networking Foundation
Hyunsun Moon5c143952016-10-19 18:34:46 -07003 *
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 */
Hyunsun Moon187bf532017-01-19 10:57:40 +090016package org.opencord.cordvtn.api.core;
17
18import org.onosproject.event.ListenerService;
19import org.opencord.cordvtn.api.net.NetworkId;
20import org.opencord.cordvtn.api.net.PortId;
21import org.opencord.cordvtn.api.net.ServiceNetwork;
22import org.opencord.cordvtn.api.net.ServicePort;
Hyunsun Moon5c143952016-10-19 18:34:46 -070023
24import java.util.Set;
25
26/**
27 * Service for interacting with the inventory of {@link ServiceNetwork} and
28 * {@link ServicePort}.
29 */
Hyunsun Moon187bf532017-01-19 10:57:40 +090030public interface ServiceNetworkService
31 extends ListenerService<ServiceNetworkEvent, ServiceNetworkListener> {
Hyunsun Moon5c143952016-10-19 18:34:46 -070032
33 /**
34 * Returns the service network with the supplied network ID.
35 *
Hyunsun Moon187bf532017-01-19 10:57:40 +090036 * @param networkId network id
Hyunsun Moon5c143952016-10-19 18:34:46 -070037 * @return service network
38 */
Hyunsun Moon187bf532017-01-19 10:57:40 +090039 ServiceNetwork serviceNetwork(NetworkId networkId);
Hyunsun Moon5c143952016-10-19 18:34:46 -070040
41 /**
42 * Returns all service networks registered in the service.
43 *
44 * @return set of service networks
45 */
46 Set<ServiceNetwork> serviceNetworks();
47
48 /**
49 * Returns the service port with the supplied port ID.
50 *
51 * @param portId port id
52 * @return service port
53 */
54 ServicePort servicePort(PortId portId);
55
56 /**
57 * Returns all service ports registered in the service.
58 *
59 * @return set of service ports
60 */
61 Set<ServicePort> servicePorts();
Hyunsun Moon187bf532017-01-19 10:57:40 +090062
63 /**
64 * Returns all service ports associated with the supplied network.
65 * @param networkId network id
66 * @return set of service ports
67 */
68 Set<ServicePort> servicePorts(NetworkId networkId);
Hyunsun Moon5c143952016-10-19 18:34:46 -070069}