Package jenkins.slaves
Class RemotingWorkDirSettings
- java.lang.Object
-
- jenkins.slaves.RemotingWorkDirSettings
-
- All Implemented Interfaces:
Describable<RemotingWorkDirSettings>
public class RemotingWorkDirSettings extends Object implements Describable<RemotingWorkDirSettings>
Defines settings of the Remoting work directory. This class contains Remoting Work Directory settings, which can be used when starting Jenkins agents. See Remoting Work Dir Documentation.- Since:
- 2.72
- Author:
- Oleg Nenashev
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRemotingWorkDirSettings.DescriptorImpl
-
Constructor Summary
Constructors Constructor Description RemotingWorkDirSettings()RemotingWorkDirSettings(boolean disabled, String workDirPath, String internalDir, boolean failIfWorkDirIsMissing)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Descriptor<RemotingWorkDirSettings>getDescriptor()Gets the descriptor for this instance.static RemotingWorkDirSettingsgetDisabledDefaults()Gets default settings for the disabled work directory.static RemotingWorkDirSettingsgetEnabledDefaults()Gets default settings of the enabled work directory.StringgetInternalDir()StringgetWorkDirPath()Gets path to the custom workdir path.booleanisDisabled()Check if workdir is disabled.booleanisFailIfWorkDirIsMissing()Check if startup should fail if the workdir is missing.booleanisUseAgentRootDir()Indicates that agent root directory should be used as work directory.List<String>toCommandLineArgs(SlaveComputer computer)Gets list of command-line arguments for the work directory.StringtoCommandLineString(SlaveComputer computer)Gets a command line string, which can be passed to agent start command.
-
-
-
Method Detail
-
isDisabled
public boolean isDisabled()
Check if workdir is disabled.- Returns:
trueif the property is disabled. In such case Remoting will use the legacy mode.
-
isUseAgentRootDir
public boolean isUseAgentRootDir()
Indicates that agent root directory should be used as work directory.- Returns:
trueif the agent root should be a work directory.
-
isFailIfWorkDirIsMissing
public boolean isFailIfWorkDirIsMissing()
Check if startup should fail if the workdir is missing.- Returns:
trueif Remoting should fail if the the work directory is missing instead of creating it
-
getWorkDirPath
@CheckForNull public String getWorkDirPath()
Gets path to the custom workdir path.- Returns:
- Custom workdir path.
If
null, an agent root directory path should be used instead.
-
getInternalDir
@NonNull public String getInternalDir()
-
getDescriptor
public Descriptor<RemotingWorkDirSettings> getDescriptor()
Description copied from interface:DescribableGets the descriptor for this instance.Descriptoris a singleton for every concreteDescribableimplementation, so ifa.getClass() == b.getClass()then by defaulta.getDescriptor() == b.getDescriptor()as well. (In rare cases a single implementation class may be used for instances with distinct descriptors.)- Specified by:
getDescriptorin interfaceDescribable<RemotingWorkDirSettings>
-
toCommandLineArgs
public List<String> toCommandLineArgs(@NonNull SlaveComputer computer)
Gets list of command-line arguments for the work directory.- Parameters:
computer- Computer, for which the arguments are being created- Returns:
- Non-modifiable list of command-line arguments
-
toCommandLineString
@NonNull @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public String toCommandLineString(@NonNull SlaveComputer computer)
Gets a command line string, which can be passed to agent start command.- Parameters:
computer- Computer, for which the arguments need to be constructed.- Returns:
- Command line arguments.
It may be empty if the working directory is disabled or
if the Computer type is not
SlaveComputer.
-
getDisabledDefaults
@NonNull public static RemotingWorkDirSettings getDisabledDefaults()
Gets default settings for the disabled work directory.- Returns:
- Legacy value: disabled work directory.
-
getEnabledDefaults
@NonNull public static RemotingWorkDirSettings getEnabledDefaults()
Gets default settings of the enabled work directory.
-
-