Interface OptionalCommonServiceInterface<S>
- Type Parameters:
S- the entity type returned by the service implementation
- All Known Implementing Classes:
HardwareIdService, Win32ComputerSystemService
public interface OptionalCommonServiceInterface<S>
Common service interface whose method implementations provide a way to fetch WMI data from PowerShell
in the form of
Optional
Useful for implementing services of classes which return exactly one instance
such as the Win32_ComputerSystem WMI class
- Since:
- 2.2.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionget()Implementations of this method are expected to query the PowerShell using methods that automatically handle the PowerShell process lifecycle and then map the results to the expected entity types using a custom implementation or the default methods ofCommonMappingInterfaceget(long timeout) Implementations of this method are expected to skipPowerShellentirely and rely onTerminalUtilityinstead for PowerShell session management and then map the results to the expected entity types using a custom implementation or the default methods ofCommonMappingInterfaceget(com.profesorfalken.jpowershell.PowerShell powerShell) Implementations of this method are expected to query the PowerShell using methods that delegate the responsibility of managing the PowerShell session to the caller and then map the results to the expected entity types using a custom implementation or the default methods ofCommonMappingInterface
-
Method Details
-
get
Implementations of this method are expected to query the PowerShell using methods that automatically handle the PowerShell process lifecycle and then map the results to the expected entity types using a custom implementation or the default methods ofCommonMappingInterface- Returns:
- an
Optionalentity of type<S>defined by the caller - Since:
- 2.2.0
-
get
Implementations of this method are expected to query the PowerShell using methods that delegate the responsibility of managing the PowerShell session to the caller and then map the results to the expected entity types using a custom implementation or the default methods ofCommonMappingInterface- Parameters:
powerShell- the caller-managed PowerShell session passed to the method- Returns:
- an
Optionalentity of type<S>defined by the caller - Since:
- 2.2.0
-
get
Implementations of this method are expected to skipPowerShellentirely and rely onTerminalUtilityinstead for PowerShell session management and then map the results to the expected entity types using a custom implementation or the default methods ofCommonMappingInterface- Parameters:
timeout- the maximum time (in seconds) to wait for the PowerShell command to complete before terminating the process- Returns:
- an
Optionalentity of type<S>defined by the caller - Since:
- 3.1.0
-