Package io.openems.edge.core.host
Class OperatingSystemDebianSystemd
java.lang.Object
io.openems.edge.core.host.OperatingSystemDebianSystemd
- All Implemented Interfaces:
OperatingSystem
OperatingSystem implementation for Debian with systemd.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets the network configuration.Gets the USB configuration.Executes a command.Executes a system restart (soft or hard).void
handleSetNetworkConfigRequest
(User user, NetworkConfiguration oldNetworkConfiguration, SetNetworkConfigRequest request) Handles a SetNetworkConfigRequest.protected static <A> NetworkInterface
<A> parseSystemdNetworkdConfigurationFile
(List<String> lines, A attachment) Parses a Systemd-Networkd configuration file.
-
Constructor Details
-
OperatingSystemDebianSystemd
-
-
Method Details
-
getNetworkConfiguration
Description copied from interface:OperatingSystem
Gets the network configuration.- Specified by:
getNetworkConfiguration
in interfaceOperatingSystem
- Returns:
- the network configuration object
- Throws:
OpenemsError.OpenemsNamedException
- on error
-
handleSetNetworkConfigRequest
public void handleSetNetworkConfigRequest(User user, NetworkConfiguration oldNetworkConfiguration, SetNetworkConfigRequest request) throws OpenemsError.OpenemsNamedException Description copied from interface:OperatingSystem
Handles a SetNetworkConfigRequest.- Specified by:
handleSetNetworkConfigRequest
in interfaceOperatingSystem
- Parameters:
user
- the UseroldNetworkConfiguration
- the current/old network configurationrequest
- the SetNetworkConfigRequest- Throws:
OpenemsError.OpenemsNamedException
- on error
-
handleExecuteSystemCommandRequest
public CompletableFuture<ExecuteSystemCommandResponse> handleExecuteSystemCommandRequest(ExecuteSystemCommandRequest request) Description copied from interface:OperatingSystem
Executes a command.- Specified by:
handleExecuteSystemCommandRequest
in interfaceOperatingSystem
- Parameters:
request
- theExecuteSystemCommandRequest
- Returns:
- a
ExecuteSystemCommandResponse
-
handleExecuteSystemRestartRequest
public CompletableFuture<ExecuteSystemRestartResponse> handleExecuteSystemRestartRequest(ExecuteSystemRestartRequest request) Description copied from interface:OperatingSystem
Executes a system restart (soft or hard).- Specified by:
handleExecuteSystemRestartRequest
in interfaceOperatingSystem
- Parameters:
request
- theExecuteSystemRestartRequest
- Returns:
- an
ExecuteSystemRestartResponse
-
getUsbConfiguration
Description copied from interface:OperatingSystem
Gets the USB configuration.- Specified by:
getUsbConfiguration
in interfaceOperatingSystem
- Returns:
- the original configuration in textual form
- Throws:
OpenemsError.OpenemsNamedException
- on error
-
parseSystemdNetworkdConfigurationFile
protected static <A> NetworkInterface<A> parseSystemdNetworkdConfigurationFile(List<String> lines, A attachment) throws OpenemsError.OpenemsNamedException Parses a Systemd-Networkd configuration file.See systemd.network.5 man page
- Type Parameters:
A
- the type of the attachment- Parameters:
lines
- the lines to parseattachment
- to be added as an attachment to theNetworkInterface
- Returns:
- a
NetworkInterface
- Throws:
OpenemsError.OpenemsNamedException
- on error
-