@Deprecated public void postCheckout(AbstractBuild<?,?> build, Launcher launcher, FilePath workspace, BuildListener listener) throws IOException, InterruptedException { if (Util.isOverridden(SCM.class, getClass(), "postCheckout", Run.class, Launcher.class, FilePath.class, TaskListener.class)) { postCheckout((Run) build, launcher, workspace, listener); } /* Default implementation is noop */ }
@Deprecated public void onLoad(AbstractBuild<?,?> build) { if (Util.isOverridden(Cause.class, getClass(), "onLoad", Run.class)) { onLoad((Run) build); } }
/** * Can the {@link #restart()} method restart Hudson? * * @throws RestartNotSupportedException * If the restart is not supported, throw this exception and explain the cause. */ public void verifyRestartable() throws RestartNotSupportedException { // the rewriteHudsonWar method isn't overridden. if (!Util.isOverridden(Lifecycle.class,getClass(), "restart")) throw new RestartNotSupportedException("Restart is not supported in this running mode (" + getClass().getName() + ")."); }
@Deprecated public boolean isApplicable(AbstractProject project) { if (Util.isOverridden(SCMDescriptor.class, getClass(), "isApplicable", Job.class)) { return isApplicable((Job) project); } else { return true; } }
/** * @deprecated since 1.382 * Use/override {@link #getModuleRoot(FilePath, AbstractBuild)} instead. */ @Deprecated public FilePath getModuleRoot(FilePath workspace) { if (Util.isOverridden(SCM.class,getClass(),"getModuleRoot", FilePath.class,AbstractBuild.class)) // if the subtype already implements newer getModuleRoot(FilePath,AbstractBuild), call that. return getModuleRoot(workspace,null); return workspace; }
@Deprecated public void onAddedTo(AbstractBuild build) { if (Util.isOverridden(Cause.class, getClass(), "onAddedTo", Run.class)) { onAddedTo((Run) build); } }
@Deprecated public boolean processWorkspaceBeforeDeletion(AbstractProject<?,?> project, FilePath workspace, Node node) throws IOException, InterruptedException { if (Util.isOverridden(SCM.class, getClass(), "processWorkspaceBeforeDeletion", Job.class, FilePath.class, Node.class)) { return processWorkspaceBeforeDeletion((Job) project, workspace, node); } else { return true; } }
/** * @deprecated in favor of {@link #buildEnvironment(Run, Map)}. */ @Deprecated public void buildEnvVars(AbstractBuild<?,?> build, Map<String, String> env) { if (Util.isOverridden(SCM.class, getClass(), "buildEnvironment", Run.class, Map.class)) { buildEnvironment(build, env); } // default implementation is noop. }
/** * Called by {@link Run} to allow plugins to contribute environment variables. * * @param run * The calling build. Never null. * @param env * Environment variables should be added to this map. * @since 2.76 */ default void buildEnvironment(@Nonnull Run<?, ?> run, @Nonnull EnvVars env) { if (run instanceof AbstractBuild && Util.isOverridden(EnvironmentContributingAction.class, getClass(), "buildEnvVars", AbstractBuild.class, EnvVars.class)) { buildEnvVars((AbstractBuild) run, env); } }
/** * Called on the start of each build, giving extensions a chance to intercept * the data that is written to the log. * * @deprecated as of 1.632. Use {@link #decorateLogger(Run, OutputStream)} */ public OutputStream decorateLogger(AbstractBuild build, OutputStream logger) throws IOException, InterruptedException { if (Util.isOverridden(ConsoleLogFilter.class, getClass(), "decorateLogger", Run.class, OutputStream.class)) { // old client calling newer implementation. forward the call. return decorateLogger((Run) build, logger); } else { // happens only if the subtype fails to override neither decorateLogger method throw new AssertionError("The plugin '" + this.getClass().getName() + "' still uses " + "deprecated decorateLogger(AbstractBuild,OutputStream) method. " + "Update the plugin to use setUp(Run,OutputStream) instead."); } }
/** @deprecated Use {@link #buildEnvironment(Run, EnvVars)} instead. */ @Deprecated public void buildEnvVars(AbstractBuild<?,?> build, EnvVars env) { if (Util.isOverridden(ParameterValue.class, getClass(), "buildEnvironment", Run.class, EnvVars.class)) { buildEnvironment(build, env); } else { // for backward compatibility buildEnvVars(build,(Map<String,String>)env); } }
/** * @deprecated as of 1.382. * Use/derive from {@link #getModuleRoots(FilePath, AbstractBuild)} instead. */ @Deprecated public FilePath[] getModuleRoots(FilePath workspace) { if (Util.isOverridden(SCM.class,getClass(),"getModuleRoots", FilePath.class, AbstractBuild.class)) // if the subtype already derives newer getModuleRoots(FilePath,AbstractBuild), delegate to it return getModuleRoots(workspace,null); // otherwise the default implementation return new FilePath[] { getModuleRoot(workspace), }; }
/** * @deprecated * Use {@link #perform(AbstractBuild, Launcher, BuildListener)} instead. */ @Deprecated public boolean perform(Build<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { if (build instanceof AbstractBuild && Util.isOverridden(BuildStepCompatibilityLayer.class, this.getClass(), "perform", AbstractBuild.class, Launcher.class, BuildListener.class)) { return perform((AbstractBuild<?, ?>) build, launcher, listener); } throw new AbstractMethodError(); }
/** * @since 1.568 */ public ChangeLogSet<? extends Entry> parse(Run build, RepositoryBrowser<?> browser, File changelogFile) throws IOException, SAXException { if (build instanceof AbstractBuild && Util.isOverridden(ChangeLogParser.class, getClass(), "parse", AbstractBuild.class, File.class)) { return parse((AbstractBuild) build, changelogFile); } else { throw new AbstractMethodError("You must override the newer overload of parse"); } }
@Deprecated public void onChangeLogParsed(AbstractBuild<?,?> build, BuildListener listener, ChangeLogSet<?> changelog) throws Exception { if (Util.isOverridden(SCMListener.class, getClass(), "onChangeLogParsed", Run.class, SCM.class, TaskListener.class, ChangeLogSet.class)) { onChangeLogParsed((Run) build, build.getProject().getScm(), listener, changelog); } }
/** * Called by {@link AbstractBuild} to allow plugins to contribute environment variables. * * @deprecated Use {@link #buildEnvironment} instead * * @param build * The calling build. Never null. * @param env * Environment variables should be added to this map. */ @Deprecated @Restricted(ProtectedExternally.class) default void buildEnvVars(AbstractBuild<?, ?> build, EnvVars env) { if (Util.isOverridden(EnvironmentContributingAction.class, getClass(), "buildEnvironment", Run.class, EnvVars.class)) { buildEnvironment(build, env); } } }
/** * Determines the identity in which the {@link hudson.model.Queue.Executable} will run as. * The default implementation delegates to {@link #authenticate(hudson.model.Queue.Task)}. * @param item * The contextual information to assist the authentication. * The primary interest is likely {@link hudson.model.Queue.Item#task}, which is often {@link AbstractProject}. * {@link Action}s associated with the item is also likely of interest, such as {@link CauseAction}. * * @return * returning non-null will determine the identity. If null is returned, the next * configured {@link QueueItemAuthenticator} will be given a chance to authenticate * the executor. If everything fails, fall back to {@link Task#getDefaultAuthentication()}. */ public @CheckForNull Authentication authenticate(Queue.Item item) { if (Util.isOverridden(QueueItemAuthenticator.class, getClass(), "authenticate", Queue.Task.class)) { return authenticate(item.task); } else { throw new AbstractMethodError("you must override at least one of the QueueItemAuthenticator.authenticate methods"); } }
/** * Determines the identity in which the {@link hudson.model.Queue.Executable} will run as. * The default implementation delegates to {@link #authenticate(hudson.model.Queue.Item)} (there will be no associated actions). * @param task * Often {@link AbstractProject}. * * @return * returning non-null will determine the identity. If null is returned, the next * configured {@link QueueItemAuthenticator} will be given a chance to authenticate * the executor. If everything fails, fall back to {@link Task#getDefaultAuthentication()}. * @since 1.560 */ public @CheckForNull Authentication authenticate(Queue.Task task) { if (Util.isOverridden(QueueItemAuthenticator.class, getClass(), "authenticate", Queue.Item.class)) { // Need a fake (unscheduled) item. All the other calls assume a BuildableItem but probably it does not matter. return authenticate(new Queue.WaitingItem(Calendar.getInstance(), task, Collections.<Action>emptyList())); } else { throw new AbstractMethodError("you must override at least one of the QueueItemAuthenticator.authenticate methods"); } }
/** * Equivalent to {@code disconnect(null)} * * @deprecated as of 1.320. * Use {@link #disconnect(OfflineCause)} and specify the cause. */ @Deprecated public Future<?> disconnect() { recordTermination(); if (Util.isOverridden(Computer.class,getClass(),"disconnect",OfflineCause.class)) // if the subtype already derives disconnect(OfflineCause), delegate to it return disconnect(null); connectTime=0; return Futures.precomputed(null); }
/** * Disconnect this computer. * * If this is the master, no-op. This method may return immediately * while the launch operation happens asynchronously. * * @param cause * Object that identifies the reason the node was disconnected. * * @return * {@link Future} to track the asynchronous disconnect operation. * @see #connect(boolean) * @since 1.320 */ public Future<?> disconnect(OfflineCause cause) { recordTermination(); offlineCause = cause; if (Util.isOverridden(Computer.class,getClass(),"disconnect")) return disconnect(); // legacy subtypes that extend disconnect(). connectTime=0; return Futures.precomputed(null); }