Class WinRMExecutorFactory

java.lang.Object
org.metricshub.winrm.service.WinRMExecutorFactory

public final class WinRMExecutorFactory extends Object
Creates the WindowsRemoteExecutor that fulfils a request. Since 2.0.0 the dependency-free LightWinRMService is the only implementation: the legacy CXF-based backend has been removed.
  • Method Details

    • createInstance

      public static WindowsRemoteExecutor createInstance(WinRMEndpoint winRMEndpoint, long timeout, Path ticketCache, List<AuthenticationEnum> authentications) throws WinRMException
      Parameters:
      winRMEndpoint - endpoint with credentials (mandatory)
      timeout - timeout in milliseconds (must be > 0)
      ticketCache - Kerberos ticket cache path (may be null)
      authentications - requested authentication schemes (may be null)
      Returns:
      an executor backed by LightWinRMService
      Throws:
      WinRMException - for any problem creating the executor
    • createInstance

      public static WindowsRemoteExecutor createInstance(WinRMEndpoint winRMEndpoint, long timeout, Path ticketCache, List<AuthenticationEnum> authentications, SSLContext sslContext, boolean trustAllCertificates) throws WinRMException
      Create a WindowsRemoteExecutor with an explicit TLS configuration, overriding the org.metricshub.winrm.tls.insecure system property for this instance.
      Parameters:
      winRMEndpoint - endpoint with credentials (mandatory)
      timeout - timeout in milliseconds (must be > 0)
      ticketCache - Kerberos ticket cache path (may be null)
      authentications - requested authentication schemes (may be null)
      sslContext - the SSLContext providing the HTTPS socket factory (hostname verification stays on); null uses the default configuration
      trustAllCertificates - when true (and no sslContext is given), trust every server certificate and skip hostname verification — insecure, testing only
      Returns:
      an executor backed by LightWinRMService
      Throws:
      WinRMException - for any problem creating the executor
    • createInstance

      public static WindowsRemoteExecutor createInstance(WinRMEndpoint winRMEndpoint, long timeout, Path ticketCache, List<AuthenticationEnum> authentications, SSLContext sslContext, boolean trustAllCertificates, int consoleCodePage) throws WinRMException
      Create a WindowsRemoteExecutor with an explicit console code page for the command shell.
      Parameters:
      winRMEndpoint - endpoint with credentials (mandatory)
      timeout - timeout in milliseconds (must be > 0)
      ticketCache - Kerberos ticket cache path (may be null)
      authentications - requested authentication schemes (may be null)
      sslContext - the SSLContext providing the HTTPS socket factory (hostname verification stays on); null uses the default configuration
      trustAllCertificates - when true (and no sslContext is given), trust every server certificate and skip hostname verification — insecure, testing only
      consoleCodePage - the console code page of the command shell; 0 keeps the default 65001
      Returns:
      an executor backed by LightWinRMService
      Throws:
      WinRMException - for any problem creating the executor