Hyunsun Moon | 44aac66 | 2017-02-18 02:07:01 +0900 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2017-present Open Networking Foundation |
Hyunsun Moon | 44aac66 | 2017-02-18 02:07:01 +0900 | [diff] [blame] | 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.openstacknetworking.api; |
| 17 | |
| 18 | import org.onlab.packet.IpAddress; |
| 19 | import org.onlab.packet.MacAddress; |
| 20 | import org.onosproject.event.ListenerService; |
| 21 | |
| 22 | import java.util.Set; |
| 23 | |
| 24 | /** |
| 25 | * Service for interacting with the inventory of instance ports. |
| 26 | */ |
| 27 | public interface InstancePortService |
| 28 | extends ListenerService<InstancePortEvent, InstancePortListener> { |
| 29 | |
| 30 | /** |
| 31 | * Returns instance port with the given MAC address. |
| 32 | * |
| 33 | * @param macAddress mac address |
| 34 | * @return instance port; null if not found |
| 35 | */ |
| 36 | InstancePort instancePort(MacAddress macAddress); |
| 37 | |
| 38 | /** |
| 39 | * Returns instance port with the given IP address in the given OpenStack network. |
| 40 | * |
| 41 | * @param ipAddress ip address |
| 42 | * @param osNetId openstack network id |
| 43 | * @return instance port; null if not found |
| 44 | */ |
| 45 | InstancePort instancePort(IpAddress ipAddress, String osNetId); |
| 46 | |
| 47 | /** |
| 48 | * Returns instance port with the given openstack port ID. |
| 49 | * |
| 50 | * @param osPortId openstack port id |
| 51 | * @return instance port; null if not found |
| 52 | */ |
| 53 | InstancePort instancePort(String osPortId); |
| 54 | |
| 55 | /** |
| 56 | * Returns all instance ports. |
| 57 | * |
| 58 | * @return set of instance ports; empty list if no port exists |
| 59 | */ |
| 60 | Set<InstancePort> instancePorts(); |
| 61 | |
| 62 | /** |
| 63 | * Returns instance ports in the given OpenStack network. |
| 64 | * |
| 65 | * @param osNetId openstack network |
| 66 | * @return set of instance ports; empty list if no port exists |
| 67 | */ |
| 68 | Set<InstancePort> instancePorts(String osNetId); |
| 69 | } |