tom | 89b63c5 | 2014-09-16 09:19:51 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net.host; |
| 2 | |
Jonathan Hart | ac60c08 | 2014-09-23 08:55:17 -0700 | [diff] [blame] | 3 | import java.util.Set; |
| 4 | |
| 5 | import org.onlab.onos.net.ConnectPoint; |
tom | 89b63c5 | 2014-09-16 09:19:51 -0700 | [diff] [blame] | 6 | import org.onlab.onos.net.HostId; |
| 7 | |
| 8 | /** |
| 9 | * Service for administering the inventory of end-station hosts. |
| 10 | */ |
| 11 | public interface HostAdminService { |
| 12 | |
| 13 | /** |
| 14 | * Removes the end-station host with the specified identifier. |
| 15 | * |
| 16 | * @param hostId host identifier |
| 17 | */ |
| 18 | void removeHost(HostId hostId); |
| 19 | |
Jonathan Hart | ac60c08 | 2014-09-23 08:55:17 -0700 | [diff] [blame] | 20 | /** |
Jonathan Hart | 09585c6 | 2014-09-23 16:58:04 -0700 | [diff] [blame] | 21 | * Binds IP and MAC addresses to the given connection point. |
Jonathan Hart | ac60c08 | 2014-09-23 08:55:17 -0700 | [diff] [blame] | 22 | * <p/> |
Jonathan Hart | 09585c6 | 2014-09-23 16:58:04 -0700 | [diff] [blame] | 23 | * The addresses are added to the set of addresses already bound to the |
| 24 | * connection point. If any of the fields in addresses is null, no change |
| 25 | * is made to the corresponding addresses in the store. |
| 26 | * {@link #unbindAddressesFromPort(PortAddresses)} must be use to unbind |
| 27 | * addresses that have previously been bound. |
Jonathan Hart | ac60c08 | 2014-09-23 08:55:17 -0700 | [diff] [blame] | 28 | * |
Jonathan Hart | 09585c6 | 2014-09-23 16:58:04 -0700 | [diff] [blame] | 29 | * @param addresses address object containing addresses to add and the port |
| 30 | * to add them to |
Jonathan Hart | ac60c08 | 2014-09-23 08:55:17 -0700 | [diff] [blame] | 31 | */ |
Jonathan Hart | 09585c6 | 2014-09-23 16:58:04 -0700 | [diff] [blame] | 32 | void bindAddressesToPort(PortAddresses addresses); |
| 33 | |
| 34 | /** |
| 35 | * Removes the addresses contained in the given PortAddresses object from |
| 36 | * the set of addresses bound to the port. |
| 37 | * |
| 38 | * @param portAddresses set of addresses to remove and port to remove them |
| 39 | * from |
| 40 | */ |
| 41 | void unbindAddressesFromPort(PortAddresses portAddresses); |
Jonathan Hart | ac60c08 | 2014-09-23 08:55:17 -0700 | [diff] [blame] | 42 | |
| 43 | /** |
| 44 | * Removes all address information for the given connection point. |
| 45 | * |
| 46 | * @param connectPoint the connection point to remove address information |
| 47 | */ |
Jonathan Hart | 09585c6 | 2014-09-23 16:58:04 -0700 | [diff] [blame] | 48 | void clearAddresses(ConnectPoint connectPoint); |
Jonathan Hart | ac60c08 | 2014-09-23 08:55:17 -0700 | [diff] [blame] | 49 | |
| 50 | /** |
| 51 | * Returns the addresses information for all connection points. |
| 52 | * |
| 53 | * @return the set of address bindings for all connection points |
| 54 | */ |
| 55 | Set<PortAddresses> getAddressBindings(); |
| 56 | |
| 57 | /** |
| 58 | * Retrieves the addresses that have been bound to the given connection |
| 59 | * point. |
| 60 | * |
| 61 | * @param connectPoint the connection point to retrieve address bindings |
| 62 | * for |
| 63 | * @return addresses bound to the port |
| 64 | */ |
| 65 | PortAddresses getAddressBindingsForPort(ConnectPoint connectPoint); |
tom | 89b63c5 | 2014-09-16 09:19:51 -0700 | [diff] [blame] | 66 | } |