Class LocalOsHandler
java.lang.Object
org.sentrysoftware.metricshub.engine.common.helpers.LocalOsHandler
Helper class for handling the local operating system.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents the Aix operating system.static classRepresents the FreeBsd operating system.static classRepresents the HP-UX operating system.static classAbstract base class representing a local operating system.static interfaceVisitor interface for local operating system types.static classRepresents the Linux operating system.static classRepresents the macOS operating system.static classRepresents the NetBSD operating system.static classRepresents the OpenBSD operating system.static classRepresents the Solaris operating system.static classRepresents the Sun operating system.static classRepresents the Windows operating system. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final LocalOsHandler.ILocalOsRepresents the AIX operating system.static final LocalOsHandler.ILocalOsRepresents the FreeBSD operating system.static final LocalOsHandler.ILocalOsRepresents the HP-UX operating system.static final LocalOsHandler.ILocalOsRepresents the Linux operating system.static final LocalOsHandler.ILocalOsRepresents the macOS operating system.static final LocalOsHandler.ILocalOsRepresents the NetBSD operating system.static final LocalOsHandler.ILocalOsRepresents the OpenBSD operating system.static final LocalOsHandler.ILocalOsRepresents the Solaris operating system.static final LocalOsHandler.ILocalOsRepresents the Sun operating system.static final LocalOsHandler.ILocalOsRepresents the Windows operating system. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the OS Name from the System.Get the OS Version from the System.static booleanCheck if the Local OS is a Windows.
-
Field Details
-
WINDOWS
Represents the Windows operating system. -
LINUX
Represents the Linux operating system. -
SUN
Represents the Sun operating system. -
HP
Represents the HP-UX operating system. -
SOLARIS
Represents the Solaris operating system. -
AIX
Represents the AIX operating system. -
FREE_BSD
Represents the FreeBSD operating system. -
OPEN_BSD
Represents the OpenBSD operating system. -
NET_BSD
Represents the NetBSD operating system. -
MAC_OS_X
Represents the macOS operating system.
-
-
Constructor Details
-
LocalOsHandler
public LocalOsHandler()
-
-
Method Details
-
isWindows
public static boolean isWindows()Check if the Local OS is a Windows.- Returns:
- true if Windows false otherwise.
-
getSystemOsName
Get the OS Name from the System.- Returns:
- An Optional of the OS name. Empty if not defined.
-
getSystemOsVersion
Get the OS Version from the System.- Returns:
- An Optional of the OS version. Empty if not defined.
-