|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthudson.plugins.accurev.AccurevLauncher
public final class AccurevLauncher
Utility class that knows how to run AccuRev commands and (optionally) have something parse their output.
| Nested Class Summary | |
|---|---|
static interface |
AccurevLauncher.ICmdOutputParser<TResult,TContext>
Interface implemented by code that interprets the output of AccuRev commands. |
static interface |
AccurevLauncher.ICmdOutputXmlParser<TResult,TContext>
Interface implemented by code that interprets the output of AccuRev commands. |
static class |
AccurevLauncher.UnhandledAccurevCommandOutput
Exception that can be throw if the AccuRev command's output cannot be parsed or is otherwise invalid. |
| Constructor Summary | |
|---|---|
AccurevLauncher()
|
|
| Method Summary | ||
|---|---|---|
static
|
runCommand(String humanReadableCommandName,
hudson.Launcher launcher,
hudson.util.ArgumentListBuilder machineReadableCommand,
boolean[] masksOrNull,
Lock synchronizationLockObjectOrNull,
Map<String,String> environmentVariables,
hudson.FilePath directoryToRunCommandFrom,
hudson.model.TaskListener listenerToLogFailuresTo,
Logger loggerToLogFailuresTo,
AccurevLauncher.ICmdOutputParser<TResult,TContext> commandOutputParser,
TContext commandOutputParserContext)
Runs a command a parses the output, returning the result of parsing that output. |
|
static boolean |
runCommand(String humanReadableCommandName,
hudson.Launcher launcher,
hudson.util.ArgumentListBuilder machineReadableCommand,
boolean[] masksOrNull,
Lock synchronizationLockObjectOrNull,
Map<String,String> environmentVariables,
hudson.FilePath directoryToRunCommandFrom,
hudson.model.TaskListener listenerToLogFailuresTo,
Logger loggerToLogFailuresTo,
boolean... optionalFlagToCopyAllOutputToTaskListener)
Runs a command and returns true if it passed,
false if it failed, and logs the errors. |
|
static
|
runCommand(String humanReadableCommandName,
hudson.Launcher launcher,
hudson.util.ArgumentListBuilder machineReadableCommand,
boolean[] masksOrNull,
Lock synchronizationLockObjectOrNull,
Map<String,String> environmentVariables,
hudson.FilePath directoryToRunCommandFrom,
hudson.model.TaskListener listenerToLogFailuresTo,
Logger loggerToLogFailuresTo,
org.xmlpull.v1.XmlPullParserFactory xmlParserFactory,
AccurevLauncher.ICmdOutputXmlParser<TResult,TContext> commandOutputParser,
TContext commandOutputParserContext)
As runCommand(String, Launcher, ArgumentListBuilder, boolean[], Lock, Map, FilePath, TaskListener, Logger, ICmdOutputParser, Object)
but uses an AccurevLauncher.ICmdOutputXmlParser instead. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AccurevLauncher()
| Method Detail |
|---|
public static boolean runCommand(String humanReadableCommandName,
hudson.Launcher launcher,
hudson.util.ArgumentListBuilder machineReadableCommand,
boolean[] masksOrNull,
Lock synchronizationLockObjectOrNull,
Map<String,String> environmentVariables,
hudson.FilePath directoryToRunCommandFrom,
hudson.model.TaskListener listenerToLogFailuresTo,
Logger loggerToLogFailuresTo,
boolean... optionalFlagToCopyAllOutputToTaskListener)
true if it passed,
false if it failed, and logs the errors.
humanReadableCommandName - Human-readable text saying what this command is. This appears
in the logs if there is a failure.launcher - Means of executing the command.machineReadableCommand - The command to be executed.masksOrNull - Argument for Launcher.ProcStarter.masks(boolean...), or
null if not required.synchronizationLockObjectOrNull - The Lock object to be used to prevent concurrent
execution on the same machine, or null if no
synchronization is required.environmentVariables - The environment variables to be passed to the command.directoryToRunCommandFrom - The direction that the command should be run in.listenerToLogFailuresTo - One possible place to log failures, or null.loggerToLogFailuresTo - Another place to log failures, or null.optionalFlagToCopyAllOutputToTaskListener - Optional: If present and true, all command output
will also be copied to the listener if the command is
successful.
true if the command succeeded.
public static <TResult,TContext> TResult runCommand(String humanReadableCommandName,
hudson.Launcher launcher,
hudson.util.ArgumentListBuilder machineReadableCommand,
boolean[] masksOrNull,
Lock synchronizationLockObjectOrNull,
Map<String,String> environmentVariables,
hudson.FilePath directoryToRunCommandFrom,
hudson.model.TaskListener listenerToLogFailuresTo,
Logger loggerToLogFailuresTo,
org.xmlpull.v1.XmlPullParserFactory xmlParserFactory,
AccurevLauncher.ICmdOutputXmlParser<TResult,TContext> commandOutputParser,
TContext commandOutputParserContext)
runCommand(String, Launcher, ArgumentListBuilder, boolean[], Lock, Map, FilePath, TaskListener, Logger, ICmdOutputParser, Object)
but uses an AccurevLauncher.ICmdOutputXmlParser instead.
xmlParserFactory - The XmlPullParserFactory to be used to create the
parser. If this is null then no command will be
executed and the function will return null
immediately.
public static <TResult,TContext> TResult runCommand(String humanReadableCommandName,
hudson.Launcher launcher,
hudson.util.ArgumentListBuilder machineReadableCommand,
boolean[] masksOrNull,
Lock synchronizationLockObjectOrNull,
Map<String,String> environmentVariables,
hudson.FilePath directoryToRunCommandFrom,
hudson.model.TaskListener listenerToLogFailuresTo,
Logger loggerToLogFailuresTo,
AccurevLauncher.ICmdOutputParser<TResult,TContext> commandOutputParser,
TContext commandOutputParserContext)
null if the command failed or if parsing
failed. Failures are logged.
TResult - The type of the result returned by the parser.TContext - The type of data to be passed to the parser. Can be
Void if no result is needed.humanReadableCommandName - Human-readable text saying what this command is. This appears
in the logs if there is a failure.launcher - Means of executing the command.machineReadableCommand - The command to be executed.masksOrNull - Argument for Launcher.ProcStarter.masks(boolean...), or
null if not required.synchronizationLockObjectOrNull - The Lock object to be used to prevent concurrent
execution on the same machine, or null if no
synchronization is required.environmentVariables - The environment variables to be passed to the command.directoryToRunCommandFrom - The direction that the command should be run in.listenerToLogFailuresTo - One possible place to log failures, or null.loggerToLogFailuresTo - Another place to log failures, or null.commandOutputParser - The code that will parse the command's output (if the command
succeeds).commandOutputParserContext - Data to be passed to the parser.
AccurevLauncher.ICmdOutputParser, or
null if an error occurred.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||