Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terminology: Clean up X-to-Y-Callables #5494

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions core/src/main/java/hudson/EnvVars.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import hudson.util.CyclicGraphDetector;
import hudson.util.CyclicGraphDetector.CycleDetectedException;
import hudson.util.VariableResolver;
import jenkins.security.MasterToSlaveCallable;
import jenkins.security.ControllerToAgentCallable;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -438,7 +438,7 @@ public static EnvVars getRemote(VirtualChannel channel) throws IOException, Inte
return channel.call(new GetEnvVars());
}

private static final class GetEnvVars extends MasterToSlaveCallable<EnvVars,RuntimeException> {
private static final class GetEnvVars extends ControllerToAgentCallable<EnvVars,RuntimeException> {
@Override
public EnvVars call() {
return new EnvVars(EnvVars.masterEnvVars);
Expand Down
22 changes: 11 additions & 11 deletions core/src/main/java/hudson/FilePath.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@
import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.Nullable;
import jenkins.AgentToControllerFileCallable;
import jenkins.FilePathFilter;
import jenkins.MasterToSlaveFileCallable;
import jenkins.SlaveToMasterFileCallable;
import jenkins.ControllerToAgentFileCallable;
import jenkins.SoloFilePathFilter;
import jenkins.model.Jenkins;
import jenkins.security.MasterToSlaveCallable;
import jenkins.security.ControllerToAgentCallable;
import jenkins.util.ContextResettingExecutorService;
import jenkins.util.VirtualFile;
import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
Expand Down Expand Up @@ -1036,7 +1036,7 @@ private boolean installIfNecessaryFrom(@NonNull URL archive, @NonNull TaskListen
}

// this reads from arbitrary URL
private final class Unpack extends MasterToSlaveFileCallable<Void> {
private final class Unpack extends ControllerToAgentFileCallable<Void> {
private final URL archive;
Unpack(URL archive) {
this.archive = archive;
Expand Down Expand Up @@ -1117,8 +1117,8 @@ public void copyFrom(FileItem file) throws IOException, InterruptedException {
* <strong>Warning:</strong> implementations must be serializable, so prefer a static nested class to an inner class.
*
* <p>
* Subtypes would likely want to extend from either {@link MasterToSlaveCallable}
* or {@link SlaveToMasterFileCallable}.
* Subtypes would likely want to extend from either {@link jenkins.ControllerToAgentFileCallable}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this was wrong before, since this discusses FileCallables.

* or {@link jenkins.AgentToControllerFileCallable}.
*
* @see FilePath#act(FileCallable)
*/
Expand All @@ -1141,10 +1141,10 @@ public interface FileCallable<T> extends Serializable, RoleSensitive {
/**
* {@link FileCallable}s that can be executed anywhere, including the master.
*
* The code is the same as {@link SlaveToMasterFileCallable}, but used as a marker to
* The code is the same as {@link AgentToControllerFileCallable}, but used as a marker to
* designate those impls that use {@link FilePathFilter}.
*/
/*package*/ abstract static class SecureFileCallable<T> extends SlaveToMasterFileCallable<T> {
/*package*/ abstract static class SecureFileCallable<T> extends AgentToControllerFileCallable<T> {
}

/**
Expand Down Expand Up @@ -2879,7 +2879,7 @@ public Launcher createLauncher(TaskListener listener) throws IOException, Interr
return new RemoteLauncher(listener,channel,channel.call(new IsUnix()));
}

private static final class IsUnix extends MasterToSlaveCallable<Boolean,IOException> {
private static final class IsUnix extends ControllerToAgentCallable<Boolean,IOException> {
@Override
@NonNull
public Boolean call() throws IOException {
Expand Down Expand Up @@ -2936,7 +2936,7 @@ public String validateAntFileMask(final String fileMasks, final int bound) throw
public @CheckForNull String validateAntFileMask(final String fileMasks, final int bound, final boolean caseSensitive) throws IOException, InterruptedException {
return act(new ValidateAntFileMask(fileMasks, caseSensitive, bound));
}
private class ValidateAntFileMask extends MasterToSlaveFileCallable<String> {
private class ValidateAntFileMask extends ControllerToAgentFileCallable<String> {
private final String fileMasks;
private final boolean caseSensitive;
private final int bound;
Expand Down Expand Up @@ -3376,7 +3376,7 @@ public int compare(String o1, String o2) {
public static FilePath getHomeDirectory(VirtualChannel ch) throws InterruptedException, IOException {
return ch.call(new GetHomeDirectory());
}
private static class GetHomeDirectory extends MasterToSlaveCallable<FilePath, IOException> {
private static class GetHomeDirectory extends ControllerToAgentCallable<FilePath, IOException> {
@Override
public FilePath call() throws IOException {
return new FilePath(new File(System.getProperty("user.home")));
Expand Down
8 changes: 4 additions & 4 deletions core/src/main/java/hudson/Launcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import hudson.util.StreamCopyThread;
import hudson.util.ArgumentListBuilder;
import hudson.util.ProcessTree;
import jenkins.security.MasterToSlaveCallable;
import jenkins.security.ControllerToAgentCallable;
import jenkins.tasks.filters.EnvVarsFilterRuleWrapper;
import jenkins.tasks.filters.EnvVarsFilterLocalRule;
import jenkins.tasks.filters.EnvVarsFilterableBuilder;
Expand Down Expand Up @@ -1154,7 +1154,7 @@ public String toString() {
return "RemoteLauncher[" + getChannel() + "]";
}

private static final class KillTask extends MasterToSlaveCallable<Void,RuntimeException> {
private static final class KillTask extends ControllerToAgentCallable<Void,RuntimeException> {
private final Map<String, String> modelEnvVars;

KillTask(Map<String, String> modelEnvVars) {
Expand Down Expand Up @@ -1333,7 +1333,7 @@ public interface RemoteProcess {
IOTriplet getIOtriplet();
}

private static class RemoteLaunchCallable extends MasterToSlaveCallable<RemoteProcess,IOException> {
private static class RemoteLaunchCallable extends ControllerToAgentCallable<RemoteProcess,IOException> {
private final @NonNull List<String> cmd;
private final @CheckForNull boolean[] masks;
private final @CheckForNull String[] env;
Expand Down Expand Up @@ -1436,7 +1436,7 @@ public IOTriplet getIOtriplet() {
private static final long serialVersionUID = 1L;
}

private static class RemoteChannelLaunchCallable extends MasterToSlaveCallable<OutputStream,IOException> {
private static class RemoteChannelLaunchCallable extends ControllerToAgentCallable<OutputStream,IOException> {
@NonNull
private final String[] cmd;
@NonNull
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/hudson/logging/LogRecorder.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
import hudson.util.CopyOnWriteList;
import hudson.util.RingBufferLogHandler;
import hudson.util.XStream2;
import jenkins.security.MasterToSlaveCallable;
import jenkins.security.ControllerToAgentCallable;
import net.sf.json.JSONObject;
import org.apache.commons.lang.StringUtils;
import org.kohsuke.stapler.DataBoundConstructor;
Expand Down Expand Up @@ -284,7 +284,7 @@ public int compare(Target left, Target right) {
}
}

private static final class SetLevel extends MasterToSlaveCallable<Void,Error> {
private static final class SetLevel extends ControllerToAgentCallable<Void,Error> {
/** known loggers (kept per agent), to avoid GC */
@SuppressWarnings("MismatchedQueryAndUpdateOfCollection") private static final Set<Logger> loggers = new HashSet<>();
private final String name;
Expand Down
8 changes: 4 additions & 4 deletions core/src/main/java/hudson/model/Computer.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
import jenkins.model.Jenkins;
import jenkins.util.ContextResettingExecutorService;
import jenkins.util.SystemProperties;
import jenkins.security.MasterToSlaveCallable;
import jenkins.security.ControllerToAgentCallable;
import jenkins.security.ImpersonatingExecutorService;

import org.apache.commons.lang.StringUtils;
Expand Down Expand Up @@ -1316,7 +1316,7 @@ public String getHostName() throws IOException, InterruptedException {
oneOffExecutors.remove(e);
}

private static class ListPossibleNames extends MasterToSlaveCallable<List<String>,IOException> {
private static class ListPossibleNames extends ControllerToAgentCallable<List<String>,IOException> {
/**
* In the normal case we would use {@link Computer} as the logger's name, however to
* do that we would have to send the {@link Computer} class over to the remote classloader
Expand Down Expand Up @@ -1358,7 +1358,7 @@ public List<String> call() throws IOException {
private static final long serialVersionUID = 1L;
}

private static class GetFallbackName extends MasterToSlaveCallable<String,IOException> {
private static class GetFallbackName extends ControllerToAgentCallable<String,IOException> {
@Override
public String call() throws IOException {
return SystemProperties.getString("host.name");
Expand Down Expand Up @@ -1460,7 +1460,7 @@ public void doDumpExportTable( StaplerRequest req, StaplerResponse rsp ) throws
}
}

private static final class DumpExportTableTask extends MasterToSlaveCallable<String,IOException> {
private static final class DumpExportTableTask extends ControllerToAgentCallable<String,IOException> {
@Override
public String call() throws IOException {
final Channel ch = getChannelOrFail();
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/hudson/model/DirectoryBrowserSupport.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletResponse;
import jenkins.model.Jenkins;
import jenkins.security.MasterToSlaveCallable;
import jenkins.security.ControllerToAgentCallable;
import jenkins.security.ResourceDomainConfiguration;
import jenkins.security.ResourceDomainRootAction;
import jenkins.util.SystemProperties;
Expand Down Expand Up @@ -700,7 +700,7 @@ private int dirRank(VirtualFile f) {
}
}

private static final class BuildChildPaths extends MasterToSlaveCallable<List<List<Path>>,IOException> {
private static final class BuildChildPaths extends ControllerToAgentCallable<List<List<Path>>,IOException> {
private VirtualFile root;
private final VirtualFile cur;
private final Locale locale;
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/hudson/model/Run.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
import jenkins.model.StandardArtifactManager;
import jenkins.model.lazy.BuildReference;
import jenkins.model.lazy.LazyBuildMixIn;
import jenkins.security.MasterToSlaveCallable;
import jenkins.security.ControllerToAgentCallable;
import jenkins.util.VirtualFile;
import jenkins.util.io.OnMaster;
import net.sf.json.JSONObject;
Expand Down Expand Up @@ -1177,7 +1177,7 @@ public boolean getHasArtifacts() {
return !getArtifactsUpTo(1).isEmpty();
}

private static final class AddArtifacts extends MasterToSlaveCallable<SerializableArtifactList, IOException> {
private static final class AddArtifacts extends ControllerToAgentCallable<SerializableArtifactList, IOException> {
private static final long serialVersionUID = 1L;
private final VirtualFile root;
private final int artifactsNumber;
Expand Down
6 changes: 3 additions & 3 deletions core/src/main/java/hudson/model/Slave.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
import edu.umd.cs.findbugs.annotations.NonNull;
import javax.servlet.ServletException;
import jenkins.model.Jenkins;
import jenkins.security.MasterToSlaveCallable;
import jenkins.security.ControllerToAgentCallable;
import jenkins.slaves.WorkspaceLocator;
import jenkins.util.SystemProperties;
import org.apache.commons.io.IOUtils;
Expand Down Expand Up @@ -693,7 +693,7 @@ public final List<NodePropertyDescriptor> nodePropertyDescriptors(@CheckForNull
* <li>When it's read on this side as a return value, it morphs itself into {@link ClockDifference}.
* </ol>
*/
private static final class GetClockDifference1 extends MasterToSlaveCallable<ClockDifference,IOException> {
private static final class GetClockDifference1 extends ControllerToAgentCallable<ClockDifference,IOException> {
@Override
public ClockDifference call() {
// this method must be being invoked locally, which means the clock is in sync
Expand All @@ -707,7 +707,7 @@ private Object writeReplace() {
private static final long serialVersionUID = 1L;
}

private static final class GetClockDifference2 extends MasterToSlaveCallable<GetClockDifference3,IOException> {
private static final class GetClockDifference2 extends ControllerToAgentCallable<GetClockDifference3,IOException> {
/**
* Capture the time on the master when this object is sent to remote, which is when
* {@link GetClockDifference1#writeReplace()} is run.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import hudson.model.Computer;
import hudson.remoting.Callable;
import hudson.Extension;
import jenkins.security.MasterToSlaveCallable;
import jenkins.security.ControllerToAgentCallable;
import net.sf.json.JSONObject;
import org.jenkinsci.Symbol;
import org.kohsuke.stapler.StaplerRequest;
Expand Down Expand Up @@ -60,7 +60,7 @@ public NodeMonitor newInstance(StaplerRequest req, JSONObject formData) throws F
/**
* Obtains the string that represents the architecture.
*/
private static class GetArchTask extends MasterToSlaveCallable<String,IOException> {
private static class GetArchTask extends ControllerToAgentCallable<String,IOException> {
@Override
public String call() {
String os = System.getProperty("os.name");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
package hudson.node_monitors;

import hudson.Functions;
import jenkins.MasterToSlaveFileCallable;
import jenkins.ControllerToAgentFileCallable;
import hudson.remoting.VirtualChannel;
import hudson.Util;
import hudson.node_monitors.DiskSpaceMonitorDescriptor.DiskSpace;
Expand Down Expand Up @@ -167,7 +167,7 @@ public static DiskSpace parse(String size) throws ParseException {
private static final long serialVersionUID = 2L;
}

protected static final class GetUsableSpace extends MasterToSlaveFileCallable<DiskSpace> {
protected static final class GetUsableSpace extends ControllerToAgentFileCallable<DiskSpace> {
public GetUsableSpace() {}
@Override
public DiskSpace invoke(File f, VirtualChannel channel) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import hudson.Extension;
import hudson.model.Computer;
import hudson.remoting.Callable;
import jenkins.security.MasterToSlaveCallable;
import jenkins.security.ControllerToAgentCallable;
import net.sf.json.JSONObject;
import org.kohsuke.stapler.StaplerRequest;

Expand Down Expand Up @@ -92,7 +92,7 @@ public NodeMonitor newInstance(StaplerRequest req, JSONObject formData) throws F
}
};

private static final class Step1 extends MasterToSlaveCallable<Data,IOException> {
private static final class Step1 extends ControllerToAgentCallable<Data,IOException> {
private Data cur;

private Step1(Data cur) {
Expand All @@ -112,7 +112,7 @@ private Object writeReplace() {
private static final long serialVersionUID = 1L;
}

private static final class Step2 extends MasterToSlaveCallable<Step3,IOException> {
private static final class Step2 extends ControllerToAgentCallable<Step3,IOException> {
private final Data cur;
private final long start = System.currentTimeMillis();

Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/hudson/node_monitors/SwapSpaceMonitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import hudson.Functions;
import hudson.model.Computer;
import jenkins.model.Jenkins;
import jenkins.security.MasterToSlaveCallable;
import jenkins.security.ControllerToAgentCallable;
import net.sf.json.JSONObject;
import org.jenkinsci.Symbol;
import org.jvnet.hudson.MemoryMonitor;
Expand Down Expand Up @@ -113,7 +113,7 @@ public NodeMonitor newInstance(StaplerRequest req, JSONObject formData) throws F
/**
* Obtains the string that represents the architecture.
*/
private static class MonitorTask extends MasterToSlaveCallable<MemoryUsage,IOException> {
private static class MonitorTask extends ControllerToAgentCallable<MemoryUsage,IOException> {
@Override
public MemoryUsage call() throws IOException {
MemoryMonitor mm;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import hudson.Extension;
import hudson.FilePath;
import jenkins.MasterToSlaveFileCallable;
import jenkins.ControllerToAgentFileCallable;
import hudson.model.Computer;
import hudson.model.Node;
import hudson.remoting.Callable;
Expand Down Expand Up @@ -100,7 +100,7 @@ public static DiskSpaceMonitorDescriptor install() {
return DESCRIPTOR;
}

protected static final class GetTempSpace extends MasterToSlaveFileCallable<DiskSpace> {
protected static final class GetTempSpace extends ControllerToAgentFileCallable<DiskSpace> {
@Override
public DiskSpace invoke(File f, VirtualChannel channel) throws IOException {
// if the disk is really filled up we can't even create a single file,
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/hudson/slaves/ChannelPinger.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import hudson.model.TaskListener;
import hudson.remoting.Channel;
import hudson.remoting.PingThread;
import jenkins.security.MasterToSlaveCallable;
import jenkins.security.ControllerToAgentCallable;
import jenkins.slaves.PingFailureAnalyzer;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
Expand Down Expand Up @@ -123,7 +123,7 @@ public void install(Channel channel) {

@VisibleForTesting
@Restricted(NoExternalUse.class)
public static class SetUpRemotePing extends MasterToSlaveCallable<Void, IOException> {
public static class SetUpRemotePing extends ControllerToAgentCallable<Void, IOException> {
private static final long serialVersionUID = -2702219700841759872L;
@Deprecated
private transient int pingInterval;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
import hudson.remoting.VirtualChannel;
import hudson.remoting.Channel;
import hudson.Extension;
import jenkins.security.AgentToControllerCallable;
import jenkins.util.SystemProperties;
import jenkins.security.SlaveToMasterCallable;
import org.jenkinsci.Symbol;

import java.io.IOException;
Expand Down Expand Up @@ -106,7 +106,7 @@ public long getRecurrencePeriod() {
public boolean enabled = SystemProperties.getBoolean(ConnectionActivityMonitor.class.getName()+".enabled");

private static final PingCommand PING_COMMAND = new PingCommand();
private static final class PingCommand extends SlaveToMasterCallable<Void,RuntimeException> {
private static final class PingCommand extends AgentToControllerCallable<Void,RuntimeException> {
@Override
public Void call() throws RuntimeException {
return null;
Expand Down
Loading