blob: d8820f38caee56f83dcfdf4e0133067a3c32ee88 [file] [log] [blame]
Jian Li1a424692016-02-03 16:21:18 -08001/*
2 * Copyright 2016 Open Networking Laboratory
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 */
16package org.onosproject.cpman;
17
18/**
19 * System information interface.
20 */
21public interface SystemInfo {
22
23 /**
24 * Returns number of CPU cores.
25 *
26 * @return number of CPU cores
27 */
28 int coreCount();
29
30 /**
31 * Returns number of CPUs.
32 *
33 * @return number of CPUs
34 */
35 int cpuCount();
36
37 /**
38 * Returns CPU speed in MHz.
39 *
40 * @return CPU speed
41 */
42 int cpuSpeed();
43
44 /**
45 * Returns the total amount of memory in Mega Bytes.
46 *
47 * @return memory size
48 */
49 int totalMemory();
50
51 /**
52 * A builder of SystemInfo.
53 */
54 interface Builder {
55
56 /**
57 * Sets number of CPU cores.
58 *
59 * @param numOfCores number of CPU cores
60 * @return Builder object
61 */
62 Builder numOfCores(int numOfCores);
63
64 /**
65 * Sets number of CPUs.
66 * @param numOfCpus number of CPUs
67 * @return Builder object
68 */
69 Builder numOfCpus(int numOfCpus);
70
71 /**
72 * Sets CPU speed.
73 *
74 * @param cpuSpeedMhz CPU speed in Mhz
75 * @return Builder object
76 */
77 Builder cpuSpeed(int cpuSpeedMhz);
78
79 /**
80 * Sets total amount of memory.
81 *
82 * @param totalMemoryMbytes memory size in Mega Bytes
83 * @return Builder object
84 */
85 Builder totalMemory(int totalMemoryMbytes);
86
87 /**
88 * Builds a SystemInfo object.
89 *
90 * @return SystemInfo object
91 */
92 SystemInfo build();
93 }
94}