com.dtolabs.rundeck.plugin.overthere
Class OTWinRMNodeExecutor

java.lang.Object
  extended by com.dtolabs.rundeck.plugin.overthere.OTWinRMNodeExecutor
All Implemented Interfaces:
com.dtolabs.rundeck.core.execution.service.NodeExecutor, com.dtolabs.rundeck.core.plugins.configuration.Describable

public class OTWinRMNodeExecutor
extends Object
implements com.dtolabs.rundeck.core.execution.service.NodeExecutor, com.dtolabs.rundeck.core.plugins.configuration.Describable

Executes a command via WinRM. Subclass to extend, there are places to alter the generation of user@realm, and to alter the password resolution mechanism. See getKerberosUsername(com.dtolabs.rundeck.plugin.overthere.OTWinRMNodeExecutor.ConnectionOptionsBuilder) and getClearAuthPassword(com.dtolabs.rundeck.plugin.overthere.OTWinRMNodeExecutor.ConnectionOptionsBuilder). The connection options can be altered as well by overriding willUseConnectionOptions(com.xebialabs.overthere.ConnectionOptions).


Nested Class Summary
protected  class OTWinRMNodeExecutor.ConnectionOptionsBuilder
           
static class OTWinRMNodeExecutor.Reason
           
 
Field Summary
static String AUTH_TYPE_BASIC
           
static String AUTH_TYPE_KERBEROS
           
static String CERT_TRUST_ALL
           
static String CERT_TRUST_DEFAULT
           
static String CERT_TRUST_SELF_SIGNED
           
static String CONFIG_AUTHENTICATION
           
static String CONFIG_CERT_TRUST
           
static String CONFIG_HOSTNAME_VERIFY
           
static String CONFIG_LOCALE
           
static String CONFIG_PROTOCOL
           
static String CONFIG_SPN_ADD_PORT
           
static String CONFIG_SPN_USE_HTTP
           
static String CONFIG_WINRM_TIMEOUT
           
static String DEBUG_KERBEROS_AUTH
           
static String DEFAULT_AUTH_TYPE
           
static com.xebialabs.overthere.cifs.WinrmHttpsCertificateTrustStrategy DEFAULT_CERT_TRUST
           
static Boolean DEFAULT_DEBUG_KERBEROS_AUTH
           
static com.xebialabs.overthere.cifs.WinrmHttpsHostnameVerificationStrategy DEFAULT_HOSTNAME_VERIFY
           
static int DEFAULT_HTTP_PORT
           
static int DEFAULT_HTTPS_PORT
           
static boolean DEFAULT_WINRM_CONNECTION_ENCRYPTED
           
static int DEFAULT_WINRM_CONNECTION_TIMEOUT
           
static String DEFAULT_WINRM_PASSWORD_OPTION
           
static String DEFAULT_WINRM_PROTOCOL
           
static String HOSTNAME_TRUST_ALL
           
static String HOSTNAME_TRUST_BROWSER_COMPATIBLE
           
static String HOSTNAME_TRUST_STRICT
           
static String SERVICE_PROVIDER_TYPE
           
static String WINRM_AUTH_TYPE
           
static String WINRM_CERT_TRUST
           
static String WINRM_CONNECTION_TIMEOUT_PROPERTY
           
static String WINRM_HOSTNAME_TRUST
           
static String WINRM_LOCALE
           
static String WINRM_PASSWORD_OPTION
           
static String WINRM_PORT
           
static String WINRM_PROTOCOL
           
static String WINRM_PROTOCOL_HTTP
           
static String WINRM_PROTOCOL_HTTPS
           
static String WINRM_SPN_ADD_PORT
           
static String WINRM_SPN_USE_HTTP
           
static String WINRM_TIMEOUT
           
static String WINRM_USER
           
 
Constructor Summary
OTWinRMNodeExecutor(com.dtolabs.rundeck.core.common.Framework framework)
           
 
Method Summary
static com.xebialabs.overthere.CmdLine buildCmdLineRaw(String... args)
          Build a CmdLine without escaping any part, using Raw arguments
protected  com.xebialabs.overthere.CmdLine buildCommandLine(String[] command)
          Create the CmdLine to run from the input string array, the default behavior is to use buildCmdLineRaw(String...)
 com.dtolabs.rundeck.core.execution.service.NodeExecutorResult executeCommand(com.dtolabs.rundeck.core.execution.ExecutionContext context, String[] command, com.dtolabs.rundeck.core.common.INodeEntry node)
           
protected  String getClearAuthPassword(OTWinRMNodeExecutor.ConnectionOptionsBuilder options)
          Return the cleartext user password
 com.dtolabs.rundeck.core.plugins.configuration.Description getDescription()
           
protected  String getKerberosUsername(OTWinRMNodeExecutor.ConnectionOptionsBuilder options)
          Return the full username@domain to use for kerberos authentication.
protected  com.xebialabs.overthere.ConnectionOptions willUseConnectionOptions(com.xebialabs.overthere.ConnectionOptions options)
          Called before connecting with the ConnectionnOptions that will be used, which can be altered here by a subclass.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVICE_PROVIDER_TYPE

public static final String SERVICE_PROVIDER_TYPE
See Also:
Constant Field Values

DEFAULT_WINRM_CONNECTION_TIMEOUT

public static final int DEFAULT_WINRM_CONNECTION_TIMEOUT
See Also:
Constant Field Values

DEFAULT_WINRM_CONNECTION_ENCRYPTED

public static final boolean DEFAULT_WINRM_CONNECTION_ENCRYPTED
See Also:
Constant Field Values

WINRM_PASSWORD_OPTION

public static final String WINRM_PASSWORD_OPTION
See Also:
Constant Field Values

DEFAULT_WINRM_PASSWORD_OPTION

public static final String DEFAULT_WINRM_PASSWORD_OPTION
See Also:
Constant Field Values

DEFAULT_HTTPS_PORT

public static final int DEFAULT_HTTPS_PORT
See Also:
Constant Field Values

DEFAULT_HTTP_PORT

public static final int DEFAULT_HTTP_PORT
See Also:
Constant Field Values

WINRM_CONNECTION_TIMEOUT_PROPERTY

public static final String WINRM_CONNECTION_TIMEOUT_PROPERTY
See Also:
Constant Field Values

WINRM_USER

public static final String WINRM_USER
See Also:
Constant Field Values

WINRM_PORT

public static final String WINRM_PORT
See Also:
Constant Field Values

WINRM_AUTH_TYPE

public static final String WINRM_AUTH_TYPE
See Also:
Constant Field Values

WINRM_CERT_TRUST

public static final String WINRM_CERT_TRUST
See Also:
Constant Field Values

WINRM_HOSTNAME_TRUST

public static final String WINRM_HOSTNAME_TRUST
See Also:
Constant Field Values

WINRM_PROTOCOL

public static final String WINRM_PROTOCOL
See Also:
Constant Field Values

AUTH_TYPE_KERBEROS

public static final String AUTH_TYPE_KERBEROS
See Also:
Constant Field Values

AUTH_TYPE_BASIC

public static final String AUTH_TYPE_BASIC
See Also:
Constant Field Values

WINRM_PROTOCOL_HTTPS

public static final String WINRM_PROTOCOL_HTTPS
See Also:
Constant Field Values

WINRM_PROTOCOL_HTTP

public static final String WINRM_PROTOCOL_HTTP
See Also:
Constant Field Values

WINRM_SPN_ADD_PORT

public static final String WINRM_SPN_ADD_PORT
See Also:
Constant Field Values

WINRM_SPN_USE_HTTP

public static final String WINRM_SPN_USE_HTTP
See Also:
Constant Field Values

WINRM_LOCALE

public static final String WINRM_LOCALE
See Also:
Constant Field Values

WINRM_TIMEOUT

public static final String WINRM_TIMEOUT
See Also:
Constant Field Values

HOSTNAME_TRUST_BROWSER_COMPATIBLE

public static final String HOSTNAME_TRUST_BROWSER_COMPATIBLE
See Also:
Constant Field Values

HOSTNAME_TRUST_STRICT

public static final String HOSTNAME_TRUST_STRICT
See Also:
Constant Field Values

HOSTNAME_TRUST_ALL

public static final String HOSTNAME_TRUST_ALL
See Also:
Constant Field Values

CERT_TRUST_DEFAULT

public static final String CERT_TRUST_DEFAULT
See Also:
Constant Field Values

CERT_TRUST_ALL

public static final String CERT_TRUST_ALL
See Also:
Constant Field Values

CERT_TRUST_SELF_SIGNED

public static final String CERT_TRUST_SELF_SIGNED
See Also:
Constant Field Values

DEFAULT_AUTH_TYPE

public static final String DEFAULT_AUTH_TYPE
See Also:
Constant Field Values

DEBUG_KERBEROS_AUTH

public static final String DEBUG_KERBEROS_AUTH
See Also:
Constant Field Values

DEFAULT_DEBUG_KERBEROS_AUTH

public static final Boolean DEFAULT_DEBUG_KERBEROS_AUTH

DEFAULT_WINRM_PROTOCOL

public static final String DEFAULT_WINRM_PROTOCOL
See Also:
Constant Field Values

DEFAULT_CERT_TRUST

public static final com.xebialabs.overthere.cifs.WinrmHttpsCertificateTrustStrategy DEFAULT_CERT_TRUST

DEFAULT_HOSTNAME_VERIFY

public static final com.xebialabs.overthere.cifs.WinrmHttpsHostnameVerificationStrategy DEFAULT_HOSTNAME_VERIFY

CONFIG_AUTHENTICATION

public static final String CONFIG_AUTHENTICATION
See Also:
Constant Field Values

CONFIG_PROTOCOL

public static final String CONFIG_PROTOCOL
See Also:
Constant Field Values

CONFIG_CERT_TRUST

public static final String CONFIG_CERT_TRUST
See Also:
Constant Field Values

CONFIG_HOSTNAME_VERIFY

public static final String CONFIG_HOSTNAME_VERIFY
See Also:
Constant Field Values

CONFIG_SPN_ADD_PORT

public static final String CONFIG_SPN_ADD_PORT
See Also:
Constant Field Values

CONFIG_SPN_USE_HTTP

public static final String CONFIG_SPN_USE_HTTP
See Also:
Constant Field Values

CONFIG_LOCALE

public static final String CONFIG_LOCALE
See Also:
Constant Field Values

CONFIG_WINRM_TIMEOUT

public static final String CONFIG_WINRM_TIMEOUT
See Also:
Constant Field Values
Constructor Detail

OTWinRMNodeExecutor

public OTWinRMNodeExecutor(com.dtolabs.rundeck.core.common.Framework framework)
Method Detail

getDescription

public com.dtolabs.rundeck.core.plugins.configuration.Description getDescription()
Specified by:
getDescription in interface com.dtolabs.rundeck.core.plugins.configuration.Describable

executeCommand

public com.dtolabs.rundeck.core.execution.service.NodeExecutorResult executeCommand(com.dtolabs.rundeck.core.execution.ExecutionContext context,
                                                                                    String[] command,
                                                                                    com.dtolabs.rundeck.core.common.INodeEntry node)
Specified by:
executeCommand in interface com.dtolabs.rundeck.core.execution.service.NodeExecutor

buildCommandLine

protected com.xebialabs.overthere.CmdLine buildCommandLine(String[] command)
Create the CmdLine to run from the input string array, the default behavior is to use buildCmdLineRaw(String...)

Parameters:
command -
Returns:

willUseConnectionOptions

protected com.xebialabs.overthere.ConnectionOptions willUseConnectionOptions(com.xebialabs.overthere.ConnectionOptions options)
                                                                      throws com.dtolabs.rundeck.plugin.overthere.OTWinRMNodeExecutor.ConfigurationException
Called before connecting with the ConnectionnOptions that will be used, which can be altered here by a subclass.

Parameters:
options - configured options
Returns:
the ConnectionOptions to use
Throws:
com.dtolabs.rundeck.plugin.overthere.OTWinRMNodeExecutor.ConfigurationException

buildCmdLineRaw

public static com.xebialabs.overthere.CmdLine buildCmdLineRaw(String... args)
Build a CmdLine without escaping any part, using Raw arguments

Parameters:
args - the regular arguments which will be added without escaping
Returns:
the created command line

getClearAuthPassword

protected String getClearAuthPassword(OTWinRMNodeExecutor.ConnectionOptionsBuilder options)
Return the cleartext user password

Returns:

getKerberosUsername

protected String getKerberosUsername(OTWinRMNodeExecutor.ConnectionOptionsBuilder options)
Return the full username@domain to use for kerberos authentication. The default implementation will append "@HOSTNAME" if no "@DOMAIN" is present, otherwise it will convert "@domain" to "@DOMAIN" and return the value.

Parameters:
options - options builder
Returns:


Copyright © 2011-2014. All Rights Reserved.