Class WindowsShellOptions
- java.lang.Object
-
- com.oracle.bedrock.runtime.remote.windows.winrm.WindowsShellOptions
-
- All Implemented Interfaces:
com.oracle.bedrock.ComposableOption<WindowsShellOptions>,com.oracle.bedrock.Option
public class WindowsShellOptions extends Object implements com.oracle.bedrock.Option, com.oracle.bedrock.ComposableOption<WindowsShellOptions>
AnOptionto define options to set on a WinRM remote shell.Copyright (c) 2015. All Rights Reserved. Oracle Corporation.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.- Author:
- Jonathan Knight
-
-
Field Summary
Fields Modifier and Type Field Description static DurationDEFAULT_SHELL_LIFETIMEThe default lifetime of a WinRM shell
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static WindowsShellOptionsbasic()Create aWindowsShellOptionscontaining the basic set of WinRM options.WindowsShellOptionscompose(WindowsShellOptions other)com.oracle.bedrock.runtime.PropertiesBuildergetBuilder()Obtains thePropertiesBuilderto use for realizing the WinRM options.DurationgetShellLifetime()Obtain the lifetime of the WinRM shell.WindowsShellOptionsset(String name, Object value)Defines a custom environment variable, overriding any previously defined variable of the same name.WindowsShellOptionsset(String name, Iterator<?> iterator)Defines a custom environment variable, overriding any previously defined variable of the same name, the value to be used to be taken from the specified iterator when thegetBuilder()is realized.WindowsShellOptionssetIfAbsent(String name, Object value)Defines a custom environment variable, if-and-only-if it's not already defined.WindowsShellOptionssetIfAbsent(String name, Iterator<?> iterator)Defines a custom environment variable, if-and-only-if it's not already defined, the value to be used to be taken from the specified iterator when thegetBuilder()is realized.static WindowsShellOptionswith(com.oracle.bedrock.runtime.PropertiesBuilder builder)Create aWindowsShellOptionscontaining the basic set of WinRM options on top of which the the specified set of WinRM options will be added.WindowsShellOptionswithLifetime(long lifetime, TimeUnit units)Set the lifetime of the WinRM shell
-
-
-
Field Detail
-
DEFAULT_SHELL_LIFETIME
public static final Duration DEFAULT_SHELL_LIFETIME
The default lifetime of a WinRM shell
-
-
Method Detail
-
with
public static WindowsShellOptions with(com.oracle.bedrock.runtime.PropertiesBuilder builder)
Create aWindowsShellOptionscontaining the basic set of WinRM options on top of which the the specified set of WinRM options will be added.- Parameters:
builder- thePropertiesBuildercontaining the set of WinRM options to add to the basic options- Returns:
- a
WindowsShellOptionscontaining the basic set of WinRM options on top of which the the specified set of WinRM options will be added.
-
basic
public static WindowsShellOptions basic()
Create aWindowsShellOptionscontaining the basic set of WinRM options.- Returns:
- a
WindowsShellOptionscontaining the basic set of WinRM options
-
getBuilder
public com.oracle.bedrock.runtime.PropertiesBuilder getBuilder()
Obtains thePropertiesBuilderto use for realizing the WinRM options.- Returns:
- the
PropertiesBuilder
-
set
public WindowsShellOptions set(String name, Object value)
Defines a custom environment variable, overriding any previously defined variable of the same name.- Parameters:
name- the name of the environment variablevalue- the value of the environment variable- Returns:
- the
WindowsShellOptionsOptionto permit fluent-method calls
-
setIfAbsent
public WindowsShellOptions setIfAbsent(String name, Object value)
Defines a custom environment variable, if-and-only-if it's not already defined.- Parameters:
name- the name of the environment variablevalue- the value of the environment variable- Returns:
- the
WindowsShellOptionsOptionto permit fluent-method calls
-
set
public WindowsShellOptions set(String name, Iterator<?> iterator)
Defines a custom environment variable, overriding any previously defined variable of the same name, the value to be used to be taken from the specified iterator when thegetBuilder()is realized.- Parameters:
name- the name of the environment variableiterator- theIteratorproviding values for the variable- Returns:
- the
WindowsShellOptionsOptionto permit fluent-method calls
-
setIfAbsent
public WindowsShellOptions setIfAbsent(String name, Iterator<?> iterator)
Defines a custom environment variable, if-and-only-if it's not already defined, the value to be used to be taken from the specified iterator when thegetBuilder()is realized.- Parameters:
name- the name of the environment variableiterator- theIteratorproviding values for the variable- Returns:
- the
WindowsShellOptionsOptionto permit fluent-method calls
-
withLifetime
public WindowsShellOptions withLifetime(long lifetime, TimeUnit units)
Set the lifetime of the WinRM shell- Parameters:
lifetime- the lifetime of the WinRM shellunits- the units to apply to the lifetime value- Returns:
- this
WindowsShellOptions
-
getShellLifetime
public Duration getShellLifetime()
Obtain the lifetime of the WinRM shell.- Returns:
- the lifetime of the WinRM shell
-
compose
public WindowsShellOptions compose(WindowsShellOptions other)
- Specified by:
composein interfacecom.oracle.bedrock.ComposableOption<WindowsShellOptions>
-
-