Package com.pi4j.system.impl
Class DefaultSystemInfoProvider
- java.lang.Object
-
- com.pi4j.system.impl.SystemInfoProviderBase
-
- com.pi4j.system.impl.DefaultSystemInfoProvider
-
- All Implemented Interfaces:
SystemInfoProvider
- Direct Known Subclasses:
RaspiSystemInfoProvider
public abstract class DefaultSystemInfoProvider extends SystemInfoProviderBase implements SystemInfoProvider
Abstract base implementation of the SystemInfoProvider interface. This base impl includes support for all common method across all the supported platforms.
-
-
Constructor Summary
Constructors Constructor Description DefaultSystemInfoProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
getBashVersionInfo()
String
getBogoMIPS()
String
getCpuArchitecture()
String[]
getCpuFeatures()
String
getCpuImplementer()
protected String
getCpuInfo(String target)
This method will read and parse the '/proc/cpuinfo' into a collection of properties.String
getCpuPart()
String
getCpuRevision()
String
getCpuVariant()
String
getHardware()
String
getJavaRuntime()
String
getJavaVendor()
String
getJavaVendorUrl()
String
getJavaVersion()
String
getJavaVirtualMachine()
protected List<Long>
getMemory()
long
getMemoryBuffers()
long
getMemoryCached()
long
getMemoryFree()
long
getMemoryShared()
long
getMemoryTotal()
long
getMemoryUsed()
String
getOsArch()
String
getOsName()
String
getOsVersion()
String
getProcessor()
protected String
getReadElfTag(String tag)
String
getRevision()
String
getSerial()
protected boolean
hasReadElfTag(String tag)
boolean
isHardFloatAbi()
-
Methods inherited from class com.pi4j.system.impl.SystemInfoProviderBase
getBoardType, getClockFrequencyArm, getClockFrequencyCore, getClockFrequencyDPI, getClockFrequencyEMMC, getClockFrequencyH264, getClockFrequencyHDMI, getClockFrequencyISP, getClockFrequencyPixel, getClockFrequencyPWM, getClockFrequencyUART, getClockFrequencyV3D, getClockFrequencyVEC, getCodecH264Enabled, getCodecMPG2Enabled, getCodecWVC1Enabled, getCpuTemperature, getCpuVoltage, getMemoryVoltageSDRam_C, getMemoryVoltageSDRam_I, getMemoryVoltageSDRam_P, getModelName, getOsFirmwareBuild, getOsFirmwareDate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.pi4j.system.SystemInfoProvider
getBoardType, getClockFrequencyArm, getClockFrequencyCore, getClockFrequencyDPI, getClockFrequencyEMMC, getClockFrequencyH264, getClockFrequencyHDMI, getClockFrequencyISP, getClockFrequencyPixel, getClockFrequencyPWM, getClockFrequencyUART, getClockFrequencyV3D, getClockFrequencyVEC, getCodecH264Enabled, getCodecMPG2Enabled, getCodecWVC1Enabled, getCpuTemperature, getCpuVoltage, getMemoryVoltageSDRam_C, getMemoryVoltageSDRam_I, getMemoryVoltageSDRam_P, getModelName, getOsFirmwareBuild, getOsFirmwareDate
-
-
-
-
Method Detail
-
getCpuInfo
protected String getCpuInfo(String target) throws IOException, InterruptedException, UnsupportedOperationException
This method will read and parse the '/proc/cpuinfo' into a collection of properties.- Parameters:
target
-- Returns:
- Throws:
IOException
InterruptedException
UnsupportedOperationException
-
getBashVersionInfo
protected String getBashVersionInfo()
-
hasReadElfTag
protected boolean hasReadElfTag(String tag)
-
getMemory
protected List<Long> getMemory() throws IOException, InterruptedException
- Throws:
IOException
InterruptedException
-
getProcessor
public String getProcessor() throws IOException, InterruptedException, UnsupportedOperationException
- Specified by:
getProcessor
in interfaceSystemInfoProvider
- Overrides:
getProcessor
in classSystemInfoProviderBase
- Throws:
IOException
InterruptedException
UnsupportedOperationException
-
getBogoMIPS
public String getBogoMIPS() throws IOException, InterruptedException, UnsupportedOperationException
- Specified by:
getBogoMIPS
in interfaceSystemInfoProvider
- Overrides:
getBogoMIPS
in classSystemInfoProviderBase
- Throws:
IOException
InterruptedException
UnsupportedOperationException
-
getCpuFeatures
public String[] getCpuFeatures() throws IOException, InterruptedException, UnsupportedOperationException
- Specified by:
getCpuFeatures
in interfaceSystemInfoProvider
- Overrides:
getCpuFeatures
in classSystemInfoProviderBase
- Throws:
IOException
InterruptedException
UnsupportedOperationException
-
getCpuImplementer
public String getCpuImplementer() throws IOException, InterruptedException, UnsupportedOperationException
- Specified by:
getCpuImplementer
in interfaceSystemInfoProvider
- Overrides:
getCpuImplementer
in classSystemInfoProviderBase
- Throws:
IOException
InterruptedException
UnsupportedOperationException
-
getCpuArchitecture
public String getCpuArchitecture() throws IOException, InterruptedException, UnsupportedOperationException
- Specified by:
getCpuArchitecture
in interfaceSystemInfoProvider
- Overrides:
getCpuArchitecture
in classSystemInfoProviderBase
- Throws:
IOException
InterruptedException
UnsupportedOperationException
-
getCpuVariant
public String getCpuVariant() throws IOException, InterruptedException, UnsupportedOperationException
- Specified by:
getCpuVariant
in interfaceSystemInfoProvider
- Overrides:
getCpuVariant
in classSystemInfoProviderBase
- Throws:
IOException
InterruptedException
UnsupportedOperationException
-
getCpuPart
public String getCpuPart() throws IOException, InterruptedException, UnsupportedOperationException
- Specified by:
getCpuPart
in interfaceSystemInfoProvider
- Overrides:
getCpuPart
in classSystemInfoProviderBase
- Throws:
IOException
InterruptedException
UnsupportedOperationException
-
getCpuRevision
public String getCpuRevision() throws IOException, InterruptedException, UnsupportedOperationException
- Specified by:
getCpuRevision
in interfaceSystemInfoProvider
- Overrides:
getCpuRevision
in classSystemInfoProviderBase
- Throws:
IOException
InterruptedException
UnsupportedOperationException
-
getHardware
public String getHardware() throws IOException, InterruptedException, UnsupportedOperationException
- Specified by:
getHardware
in interfaceSystemInfoProvider
- Overrides:
getHardware
in classSystemInfoProviderBase
- Throws:
IOException
InterruptedException
UnsupportedOperationException
-
getRevision
public String getRevision() throws IOException, InterruptedException, UnsupportedOperationException
- Specified by:
getRevision
in interfaceSystemInfoProvider
- Overrides:
getRevision
in classSystemInfoProviderBase
- Throws:
IOException
InterruptedException
UnsupportedOperationException
-
getSerial
public String getSerial() throws IOException, InterruptedException, UnsupportedOperationException
- Specified by:
getSerial
in interfaceSystemInfoProvider
- Overrides:
getSerial
in classSystemInfoProviderBase
- Throws:
IOException
InterruptedException
UnsupportedOperationException
-
getOsName
public String getOsName() throws UnsupportedOperationException
- Specified by:
getOsName
in interfaceSystemInfoProvider
- Overrides:
getOsName
in classSystemInfoProviderBase
- Throws:
UnsupportedOperationException
-
getOsVersion
public String getOsVersion() throws UnsupportedOperationException
- Specified by:
getOsVersion
in interfaceSystemInfoProvider
- Overrides:
getOsVersion
in classSystemInfoProviderBase
- Throws:
UnsupportedOperationException
-
getOsArch
public String getOsArch() throws UnsupportedOperationException
- Specified by:
getOsArch
in interfaceSystemInfoProvider
- Overrides:
getOsArch
in classSystemInfoProviderBase
- Throws:
UnsupportedOperationException
-
getJavaVendor
public String getJavaVendor() throws UnsupportedOperationException
- Specified by:
getJavaVendor
in interfaceSystemInfoProvider
- Overrides:
getJavaVendor
in classSystemInfoProviderBase
- Throws:
UnsupportedOperationException
-
getJavaVendorUrl
public String getJavaVendorUrl() throws UnsupportedOperationException
- Specified by:
getJavaVendorUrl
in interfaceSystemInfoProvider
- Overrides:
getJavaVendorUrl
in classSystemInfoProviderBase
- Throws:
UnsupportedOperationException
-
getJavaVersion
public String getJavaVersion() throws UnsupportedOperationException
- Specified by:
getJavaVersion
in interfaceSystemInfoProvider
- Overrides:
getJavaVersion
in classSystemInfoProviderBase
- Throws:
UnsupportedOperationException
-
getJavaVirtualMachine
public String getJavaVirtualMachine() throws UnsupportedOperationException
- Specified by:
getJavaVirtualMachine
in interfaceSystemInfoProvider
- Overrides:
getJavaVirtualMachine
in classSystemInfoProviderBase
- Throws:
UnsupportedOperationException
-
getJavaRuntime
public String getJavaRuntime() throws UnsupportedOperationException
- Specified by:
getJavaRuntime
in interfaceSystemInfoProvider
- Overrides:
getJavaRuntime
in classSystemInfoProviderBase
- Throws:
UnsupportedOperationException
-
isHardFloatAbi
public boolean isHardFloatAbi() throws UnsupportedOperationException
- Specified by:
isHardFloatAbi
in interfaceSystemInfoProvider
- Overrides:
isHardFloatAbi
in classSystemInfoProviderBase
- Throws:
UnsupportedOperationException
-
getMemoryTotal
public long getMemoryTotal() throws IOException, InterruptedException, UnsupportedOperationException
- Specified by:
getMemoryTotal
in interfaceSystemInfoProvider
- Overrides:
getMemoryTotal
in classSystemInfoProviderBase
- Throws:
IOException
InterruptedException
UnsupportedOperationException
-
getMemoryUsed
public long getMemoryUsed() throws IOException, InterruptedException, UnsupportedOperationException
- Specified by:
getMemoryUsed
in interfaceSystemInfoProvider
- Overrides:
getMemoryUsed
in classSystemInfoProviderBase
- Throws:
IOException
InterruptedException
UnsupportedOperationException
-
getMemoryFree
public long getMemoryFree() throws IOException, InterruptedException, UnsupportedOperationException
- Specified by:
getMemoryFree
in interfaceSystemInfoProvider
- Overrides:
getMemoryFree
in classSystemInfoProviderBase
- Throws:
IOException
InterruptedException
UnsupportedOperationException
-
getMemoryShared
public long getMemoryShared() throws IOException, InterruptedException, UnsupportedOperationException
- Specified by:
getMemoryShared
in interfaceSystemInfoProvider
- Overrides:
getMemoryShared
in classSystemInfoProviderBase
- Throws:
IOException
InterruptedException
UnsupportedOperationException
-
getMemoryBuffers
public long getMemoryBuffers() throws IOException, InterruptedException, UnsupportedOperationException
- Specified by:
getMemoryBuffers
in interfaceSystemInfoProvider
- Overrides:
getMemoryBuffers
in classSystemInfoProviderBase
- Throws:
IOException
InterruptedException
UnsupportedOperationException
-
getMemoryCached
public long getMemoryCached() throws IOException, InterruptedException, UnsupportedOperationException
- Specified by:
getMemoryCached
in interfaceSystemInfoProvider
- Overrides:
getMemoryCached
in classSystemInfoProviderBase
- Throws:
IOException
InterruptedException
UnsupportedOperationException
-
-