Package org.metricshub.winrm.service
Class WinRMExecutorFactory
java.lang.Object
org.metricshub.winrm.service.WinRMExecutorFactory
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 Summary
Modifier and TypeMethodDescriptionstatic WindowsRemoteExecutorcreateInstance(WinRMEndpoint winRMEndpoint, long timeout, Path ticketCache, List<AuthenticationEnum> authentications) Create aWindowsRemoteExecutor.static WindowsRemoteExecutorcreateInstance(WinRMEndpoint winRMEndpoint, long timeout, Path ticketCache, List<AuthenticationEnum> authentications, SSLContext sslContext, boolean trustAllCertificates) Create aWindowsRemoteExecutorwith an explicit TLS configuration, overriding theorg.metricshub.winrm.tls.insecuresystem property for this instance.static WindowsRemoteExecutorcreateInstance(WinRMEndpoint winRMEndpoint, long timeout, Path ticketCache, List<AuthenticationEnum> authentications, SSLContext sslContext, boolean trustAllCertificates, int consoleCodePage) Create aWindowsRemoteExecutorwith an explicit console code page for the command shell.static WindowsRemoteExecutorcreateInstance(WinRMEndpoint winRMEndpoint, long timeout, Path ticketCache, List<AuthenticationEnum> authentications, SSLContext sslContext, boolean trustAllCertificates, int consoleCodePage, int connectRetries, long retryDelay) Create aWindowsRemoteExecutorwith an opt-in retry policy for transient connection failures.
-
Method Details
-
createInstance
public static WindowsRemoteExecutor createInstance(WinRMEndpoint winRMEndpoint, long timeout, Path ticketCache, List<AuthenticationEnum> authentications) throws WinRMException Create aWindowsRemoteExecutor.- Parameters:
winRMEndpoint- endpoint with credentials (mandatory)timeout- timeout in milliseconds (must be > 0)ticketCache- Kerberos ticket cache path (may benull)authentications- requested authentication schemes (may benull)- 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 aWindowsRemoteExecutorwith an explicit TLS configuration, overriding theorg.metricshub.winrm.tls.insecuresystem property for this instance.- Parameters:
winRMEndpoint- endpoint with credentials (mandatory)timeout- timeout in milliseconds (must be > 0)ticketCache- Kerberos ticket cache path (may benull)authentications- requested authentication schemes (may benull)sslContext- theSSLContextproviding the HTTPS socket factory (hostname verification stays on);nulluses the default configurationtrustAllCertificates- whentrue(and nosslContextis 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 aWindowsRemoteExecutorwith 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 benull)authentications- requested authentication schemes (may benull)sslContext- theSSLContextproviding the HTTPS socket factory (hostname verification stays on);nulluses the default configurationtrustAllCertificates- whentrue(and nosslContextis given), trust every server certificate and skip hostname verification — insecure, testing onlyconsoleCodePage- 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
-
createInstance
public static WindowsRemoteExecutor createInstance(WinRMEndpoint winRMEndpoint, long timeout, Path ticketCache, List<AuthenticationEnum> authentications, SSLContext sslContext, boolean trustAllCertificates, int consoleCodePage, int connectRetries, long retryDelay) throws WinRMException Create aWindowsRemoteExecutorwith an opt-in retry policy for transient connection failures. A round trip is retried only when it failed to establish and authenticate the connection — i.e. when its request provably never reached the server — so at-most-once execution semantics are preserved.- Parameters:
winRMEndpoint- endpoint with credentials (mandatory)timeout- timeout in milliseconds (must be > 0)ticketCache- Kerberos ticket cache path (may benull)authentications- requested authentication schemes (may benull)sslContext- theSSLContextproviding the HTTPS socket factory (hostname verification stays on);nulluses the default configurationtrustAllCertificates- whentrue(and nosslContextis given), trust every server certificate and skip hostname verification — insecure, testing onlyconsoleCodePage- the console code page of the command shell; 0 keeps the default 65001connectRetries- how many times one round trip may re-attempt to connect and authenticate (must be >= 0); 0 keeps the historical fail-fast behaviorretryDelay- the pause in milliseconds before each retry (must be >= 0)- Returns:
- an executor backed by
LightWinRMService - Throws:
WinRMException- for any problem creating the executor
-