Thread.State, Thread.UncaughtExceptionHandler| Modifier and Type | Field and Description |
|---|---|
boolean |
failIfWorkDirIsMissing
Fail the initialization if the workDir or internalDir are missing.
|
String |
internalDir
Specifies a directory within
workDir, which stores all the remoting-internal files. |
EngineListener |
listener
Deprecated.
Use
events. |
static String |
REMOTING_MINIMUM_VERSION_HEADER
HTTP header sent by Jenkins to indicate the earliest version of Remoting it is prepared to accept connections from.
|
static String |
WEBSOCKET_COOKIE_HEADER
The header name to be used for the connection cookie when using websockets.
|
Path |
workDir
Specifies a default working directory of the remoting instance.
|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
Engine(EngineListener listener,
List<URL> hudsonUrls,
String secretKey,
String agentName) |
Engine(EngineListener listener,
List<URL> hudsonUrls,
String secretKey,
String agentName,
String directConnection,
String instanceIdentity,
Set<String> protocols) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCandidateCertificate(X509Certificate certificate) |
void |
addListener(EngineListener el) |
static Engine |
current()
|
String |
getAgentName()
Get the agent name associated with this Engine instance.
|
URL |
getHudsonUrl()
Provides Jenkins URL if available.
|
String |
getProtocolName()
Get the name of the communication protocol used in this Engine instance.
|
boolean |
isDisableHttpsCertValidation()
Determines if JNLPAgentEndpointResolver will not perform certificate validation in the HTTPs mode.
|
boolean |
isKeepAlive()
Returns
true if and only if the socket to the controller will have Socket.setKeepAlive(boolean) set. |
void |
removeListener(EngineListener el) |
void |
run() |
void |
setAgentLog(Path agentLog)
Sets the destination for agent logs.
|
void |
setCandidateCertificates(List<X509Certificate> candidateCertificates) |
void |
setCredentials(String creds) |
void |
setDisableHttpsCertValidation(boolean disableHttpsCertValidation)
Sets if JNLPAgentEndpointResolver will not perform certificate validation in the HTTPs mode.
|
void |
setFailIfWorkDirIsMissing(boolean failIfWorkDirIsMissing)
Sets up behavior if the workDir or internalDir are missing during the startup.
|
void |
setInternalDir(String internalDir)
Specifies name of the internal data directory within
workDir. |
void |
setJarCache(JarCache jarCache)
Configures custom JAR Cache location.
|
void |
setKeepAlive(boolean keepAlive)
Sets the
Socket.setKeepAlive(boolean) to use for the connection to the controller. |
void |
setLoggingConfigFile(Path filePath)
Sets path to the property file with JUL settings.
|
void |
setNoReconnect(boolean noReconnect) |
void |
setProxyCredentials(String proxyCredentials) |
void |
setTunnel(String tunnel)
If set, connect to the specified host and port instead of connecting directly to Jenkins.
|
void |
setWebSocket(boolean webSocket) |
void |
setWebSocketHeaders(Map<String,String> webSocketHeaders)
Sets map of custom websocket headers.
|
void |
setWorkDir(Path workDir)
Specified a path to the work directory.
|
void |
startEngine()
Starts the engine.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldpublic static final String REMOTING_MINIMUM_VERSION_HEADER
public static final String WEBSOCKET_COOKIE_HEADER
@Deprecated public final EngineListener listener
events.@CheckForNull public Path workDir
In order to retain compatibility, the option is disabled by default.
Jenkins specifics: This working directory is expected to be equal to the agent root specified in Jenkins configuration.
@NonNull public String internalDir
workDir, which stores all the remoting-internal files.
This option is not expected to be used frequently, but it allows remoting users to specify a custom
storage directory if the default remoting directory is consumed by other stuff.
public boolean failIfWorkDirIsMissing
public Engine(EngineListener listener, List<URL> hudsonUrls, String secretKey, String agentName)
public void startEngine()
throws IOException
IOException - Initialization errorpublic void setJarCache(@NonNull
JarCache jarCache)
jarCache - JAR Cache to be usedpublic void setLoggingConfigFile(@NonNull
Path filePath)
filePath - JAR Cache to be used@CheckForNull public URL getHudsonUrl()
null if the connection is not established or if the URL cannot be determined
in the JnlpAgentEndpointResolver.public void setWebSocket(boolean webSocket)
public void setWebSocketHeaders(@NonNull
Map<String,String> webSocketHeaders)
webSocketHeaders - a map of the headers to apply to the websocket connectionpublic void setTunnel(@CheckForNull
String tunnel)
tunnel - Value. null to disable tunnelingpublic void setCredentials(String creds)
public void setProxyCredentials(String proxyCredentials)
public void setNoReconnect(boolean noReconnect)
public boolean isDisableHttpsCertValidation()
true if the certificate validation is disabled.public void setDisableHttpsCertValidation(boolean disableHttpsCertValidation)
disableHttpsCertValidation - true if the certificate validation is disabled.public void setAgentLog(@CheckForNull
Path agentLog)
agentLog - Path to the agent log.
If null, the engine will pick the default behavior depending on the workDir valuepublic void setWorkDir(@CheckForNull
Path workDir)
workDir - Path to the working directory of the remoting instance.
null Disables the working directory.public void setInternalDir(@NonNull
String internalDir)
workDir.internalDir - Directory namepublic void setFailIfWorkDirIsMissing(boolean failIfWorkDirIsMissing)
failIfWorkDirIsMissing - Flagpublic boolean isKeepAlive()
true if and only if the socket to the controller will have Socket.setKeepAlive(boolean) set.true if and only if the socket to the controller will have Socket.setKeepAlive(boolean) set.public void setKeepAlive(boolean keepAlive)
Socket.setKeepAlive(boolean) to use for the connection to the controller.keepAlive - the Socket.setKeepAlive(boolean) to use for the connection to the controller.public void setCandidateCertificates(List<X509Certificate> candidateCertificates)
public void addCandidateCertificate(X509Certificate certificate)
public void addListener(EngineListener el)
public void removeListener(EngineListener el)
public static Engine current()
public String getAgentName()
public String getProtocolName()
current()) returns null),
use Launcher.getCommunicationProtocolName() instead.Copyright © 2004–2022. All rights reserved.