View Javadoc
1   /*
2    * Copyright 2016-2022 The OSHI Project Contributors
3    * SPDX-License-Identifier: MIT
4    */
5   package oshi.hardware.platform.linux;
6   
7   import java.util.List;
8   
9   import oshi.annotation.concurrent.ThreadSafe;
10  import oshi.hardware.CentralProcessor;
11  import oshi.hardware.ComputerSystem;
12  import oshi.hardware.Display;
13  import oshi.hardware.GlobalMemory;
14  import oshi.hardware.GraphicsCard;
15  import oshi.hardware.HWDiskStore;
16  import oshi.hardware.LogicalVolumeGroup;
17  import oshi.hardware.NetworkIF;
18  import oshi.hardware.PowerSource;
19  import oshi.hardware.Sensors;
20  import oshi.hardware.SoundCard;
21  import oshi.hardware.UsbDevice;
22  import oshi.hardware.common.AbstractHardwareAbstractionLayer;
23  import oshi.hardware.platform.unix.UnixDisplay;
24  
25  /**
26   * LinuxHardwareAbstractionLayer class.
27   */
28  @ThreadSafe
29  public final class LinuxHardwareAbstractionLayer extends AbstractHardwareAbstractionLayer {
30  
31      @Override
32      public ComputerSystem createComputerSystem() {
33          return new LinuxComputerSystem();
34      }
35  
36      @Override
37      public GlobalMemory createMemory() {
38          return new LinuxGlobalMemory();
39      }
40  
41      @Override
42      public CentralProcessor createProcessor() {
43          return new LinuxCentralProcessor();
44      }
45  
46      @Override
47      public Sensors createSensors() {
48          return new LinuxSensors();
49      }
50  
51      @Override
52      public List<PowerSource> getPowerSources() {
53          return LinuxPowerSource.getPowerSources();
54      }
55  
56      @Override
57      public List<HWDiskStore> getDiskStores() {
58          return LinuxHWDiskStore.getDisks();
59      }
60  
61      @Override
62      public List<LogicalVolumeGroup> getLogicalVolumeGroups() {
63          return LinuxLogicalVolumeGroup.getLogicalVolumeGroups();
64      }
65  
66      @Override
67      public List<Display> getDisplays() {
68          return UnixDisplay.getDisplays();
69      }
70  
71      @Override
72      public List<NetworkIF> getNetworkIFs(boolean includeLocalInterfaces) {
73          return LinuxNetworkIF.getNetworks(includeLocalInterfaces);
74      }
75  
76      @Override
77      public List<UsbDevice> getUsbDevices(boolean tree) {
78          return LinuxUsbDevice.getUsbDevices(tree);
79      }
80  
81      @Override
82      public List<SoundCard> getSoundCards() {
83          return LinuxSoundCard.getSoundCards();
84      }
85  
86      @Override
87      public List<GraphicsCard> getGraphicsCards() {
88          return LinuxGraphicsCard.getGraphicsCards();
89      }
90  }