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 | 13ccba6 | 2020-03-18 12:05:03 +0100 | [diff] [blame^] | 19 | import org.onosproject.drivers.server.devices.cpu.CpuCacheHierarchyDevice; |
| 20 | import org.onosproject.drivers.server.devices.cpu.CpuDevice; |
| 21 | import org.onosproject.drivers.server.devices.memory.MemoryHierarchyDevice; |
Georgios Katsikas | 2ebd8a0 | 2018-06-27 18:32:50 +0200 | [diff] [blame] | 22 | import org.onosproject.drivers.server.devices.nic.NicDevice; |
Georgios Katsikas | 8360098 | 2017-05-28 20:41:45 +0200 | [diff] [blame] | 23 | import org.onosproject.protocol.rest.RestSBDevice; |
| 24 | |
| 25 | import java.util.Collection; |
| 26 | |
| 27 | /** |
Georgios Katsikas | 13ccba6 | 2020-03-18 12:05:03 +0100 | [diff] [blame^] | 28 | * Represents an abstraction of a REST server device. |
Georgios Katsikas | 8360098 | 2017-05-28 20:41:45 +0200 | [diff] [blame] | 29 | */ |
| 30 | public interface RestServerSBDevice extends RestSBDevice { |
Georgios Katsikas | 13ccba6 | 2020-03-18 12:05:03 +0100 | [diff] [blame^] | 31 | |
Georgios Katsikas | 8360098 | 2017-05-28 20:41:45 +0200 | [diff] [blame] | 32 | /** |
| 33 | * Returns the set of CPUs of the server. |
| 34 | * |
| 35 | * @return set of CPUs |
| 36 | */ |
| 37 | Collection<CpuDevice> cpus(); |
| 38 | |
| 39 | /** |
| 40 | * Returns the number of CPUs of the server. |
| 41 | * |
| 42 | * @return number of CPUs |
| 43 | */ |
| 44 | int numberOfCpus(); |
| 45 | |
| 46 | /** |
Georgios Katsikas | 13ccba6 | 2020-03-18 12:05:03 +0100 | [diff] [blame^] | 47 | * Returns the CPU cache hierarchy of the server. |
| 48 | * |
| 49 | * @return CPU cache hierarchy |
| 50 | */ |
| 51 | CpuCacheHierarchyDevice caches(); |
| 52 | |
| 53 | /** |
| 54 | * Returns the number of CPU caches of the server. |
| 55 | * |
| 56 | * @return number of CPU caches |
| 57 | */ |
| 58 | int numberOfCaches(); |
| 59 | |
| 60 | /** |
| 61 | * Returns the capacity of the CPU caches of the server. |
| 62 | * |
| 63 | * @return total CPU cache capacity |
| 64 | */ |
| 65 | long cacheCapacity(); |
| 66 | |
| 67 | /** |
| 68 | * Returns the main memory hierarchy of the server. |
| 69 | * |
| 70 | * @return main memory hierarchy |
| 71 | */ |
| 72 | MemoryHierarchyDevice memory(); |
| 73 | |
| 74 | /** |
| 75 | * Returns the capacity of the server's main memory. |
| 76 | * |
| 77 | * @return total main memory capacity |
| 78 | */ |
| 79 | long memoryCapacity(); |
| 80 | |
| 81 | /** |
Georgios Katsikas | 8360098 | 2017-05-28 20:41:45 +0200 | [diff] [blame] | 82 | * Returns the set of NICs of the server. |
| 83 | * |
| 84 | * @return set of NICs |
| 85 | */ |
| 86 | Collection<NicDevice> nics(); |
| 87 | |
| 88 | /** |
| 89 | * Returns the number of NICs of the server. |
| 90 | * |
| 91 | * @return number of NICs |
| 92 | */ |
| 93 | int numberOfNics(); |
| 94 | |
Georgios Katsikas | 80e0b9f | 2018-07-21 20:29:18 +0200 | [diff] [blame] | 95 | /** |
| 96 | * Returns the port number of a specific NIC. |
| 97 | * |
| 98 | * @param portName name of the NIC |
| 99 | * @return NIC port number |
| 100 | */ |
| 101 | long portNumberFromName(String portName); |
| 102 | |
| 103 | /** |
| 104 | * Returns the port name of a specific NIC. |
| 105 | * |
| 106 | * @param portNumber NIC port number |
| 107 | * @return NIC name |
| 108 | */ |
| 109 | String portNameFromNumber(long portNumber); |
| 110 | |
Georgios Katsikas | 8360098 | 2017-05-28 20:41:45 +0200 | [diff] [blame] | 111 | } |