Georgios Katsikas | 8360098 | 2017-05-28 20:41:45 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017-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 | |
| 17 | package org.onosproject.drivers.server.devices; |
| 18 | |
Georgios Katsikas | 2ebd8a0 | 2018-06-27 18:32:50 +0200 | [diff] [blame] | 19 | import org.onosproject.drivers.server.devices.nic.NicDevice; |
Georgios Katsikas | 8360098 | 2017-05-28 20:41:45 +0200 | [diff] [blame] | 20 | import org.onosproject.protocol.rest.RestSBDevice; |
| 21 | |
| 22 | import java.util.Collection; |
| 23 | |
| 24 | /** |
| 25 | * Represents an abstraction of a REST server device in ONOS. |
| 26 | */ |
| 27 | public interface RestServerSBDevice extends RestSBDevice { |
| 28 | /** |
| 29 | * Returns the set of CPUs of the server. |
| 30 | * |
| 31 | * @return set of CPUs |
| 32 | */ |
| 33 | Collection<CpuDevice> cpus(); |
| 34 | |
| 35 | /** |
| 36 | * Returns the number of CPUs of the server. |
| 37 | * |
| 38 | * @return number of CPUs |
| 39 | */ |
| 40 | int numberOfCpus(); |
| 41 | |
| 42 | /** |
| 43 | * Returns the set of NICs of the server. |
| 44 | * |
| 45 | * @return set of NICs |
| 46 | */ |
| 47 | Collection<NicDevice> nics(); |
| 48 | |
| 49 | /** |
| 50 | * Returns the number of NICs of the server. |
| 51 | * |
| 52 | * @return number of NICs |
| 53 | */ |
| 54 | int numberOfNics(); |
| 55 | |
Georgios Katsikas | 80e0b9f | 2018-07-21 20:29:18 +0200 | [diff] [blame] | 56 | /** |
| 57 | * Returns the port number of a specific NIC. |
| 58 | * |
| 59 | * @param portName name of the NIC |
| 60 | * @return NIC port number |
| 61 | */ |
| 62 | long portNumberFromName(String portName); |
| 63 | |
| 64 | /** |
| 65 | * Returns the port name of a specific NIC. |
| 66 | * |
| 67 | * @param portNumber NIC port number |
| 68 | * @return NIC name |
| 69 | */ |
| 70 | String portNameFromNumber(long portNumber); |
| 71 | |
Georgios Katsikas | 8360098 | 2017-05-28 20:41:45 +0200 | [diff] [blame] | 72 | } |