package jenkins.python.expoint;
import hudson.AbortException;
import hudson.Extension;
import hudson.ExtensionList;
import hudson.ExtensionPoint;
import hudson.cli.declarative.CLIMethod;
import hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson;
import hudson.cli.declarative.OptionHandlerExtension;
import jenkins.model.Jenkins;
import hudson.remoting.Callable;
import hudson.remoting.Channel;
import hudson.remoting.ChannelProperty;
import hudson.security.CliAuthenticator;
import hudson.security.SecurityRealm;
import org.acegisecurity.Authentication;
import org.acegisecurity.context.SecurityContext;
import org.acegisecurity.context.SecurityContextHolder;
import org.apache.commons.discovery.ResourceClassIterator;
import org.apache.commons.discovery.ResourceNameIterator;
import org.apache.commons.discovery.resource.ClassLoaders;
import org.apache.commons.discovery.resource.classes.DiscoverClasses;
import org.apache.commons.discovery.resource.names.DiscoverServiceNames;
import org.jvnet.hudson.annotation_indexer.Index;
import org.jvnet.tiger_types.Types;
import org.kohsuke.args4j.ClassParser;
import org.kohsuke.args4j.CmdLineException;
import org.kohsuke.args4j.CmdLineParser;
import org.kohsuke.args4j.spi.OptionHandler;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.lang.reflect.Type;
import java.nio.charset.Charset;
import java.nio.charset.UnsupportedCharsetException;
import java.util.List;
import java.util.Locale;
import java.util.logging.Level;
import java.util.logging.Logger;
import hudson.cli.*;
import hudson.cli.CLICommand.*;
import jenkins.python.DataConvertor;
import jenkins.python.PythonExecutor;
/**
* This class was automatically generated by the PWM tool on 2014/03/21.
* @see hudson.cli.CLICommand
*/
public abstract class CLICommandPW extends CLICommand {
private transient PythonExecutor pexec;
private void initPython() {
if (pexec == null) {
pexec = new PythonExecutor(this);
String[] jMethods = new String[2];
jMethods[0] = "getShortDescription";
jMethods[1] = "run";
String[] pFuncs = new String[2];
pFuncs[0] = "get_short_description";
pFuncs[1] = "run";
Class[][] argTypes = new Class[2][];
argTypes[0] = new Class[0];
argTypes[1] = new Class[0];
pexec.checkAbstrMethods(jMethods, pFuncs, argTypes);
String[] functions = new String[14];
functions[0] = "get_name";
functions[1] = "main";
functions[2] = "check_channel";
functions[3] = "load_stored_authentication";
functions[4] = "should_perform_authentication";
functions[5] = "get_transport_authentication";
functions[6] = "set_transport_auth";
functions[7] = "print_usage";
functions[8] = "print_usage_summary";
functions[9] = "get_client_system_property";
functions[10] = "get_client_charset";
functions[11] = "get_client_environment_variable";
functions[12] = "create_clone";
functions[13] = "register_option_handlers";
int[] argsCount = new int[14];
argsCount[0] = 0;
argsCount[1] = 5;
argsCount[2] = 0;
argsCount[3] = 0;
argsCount[4] = 1;
argsCount[5] = 0;
argsCount[6] = 1;
argsCount[7] = 2;
argsCount[8] = 1;
argsCount[9] = 1;
argsCount[10] = 0;
argsCount[11] = 1;
argsCount[12] = 0;
argsCount[13] = 0;
pexec.registerFunctions(functions, argsCount);
}
}
@Override
public String getShortDescription() {
initPython();
return (String) pexec.execPython("get_short_description");
}
@Override
public int run() throws Exception {
initPython();
return pexec.execPythonInt("run");
}
@Override
public String getName() {
initPython();
if (pexec.isImplemented(0)) {
return (String) pexec.execPython("get_name");
} else {
return super.getName();
}
}
@Override
public int main(List<String> args, Locale locale, InputStream stdin, PrintStream stdout, PrintStream stderr) {
initPython();
if (pexec.isImplemented(1)) {
return pexec.execPythonInt("main", args, locale, stdin, stdout, stderr);
} else {
return super.main(args, locale, stdin, stdout, stderr);
}
}
@Override
public Channel checkChannel() throws AbortException {
initPython();
if (pexec.isImplemented(2)) {
return (Channel) pexec.execPython("check_channel");
} else {
return super.checkChannel();
}
}
@Override
public Authentication loadStoredAuthentication() throws InterruptedException {
initPython();
if (pexec.isImplemented(3)) {
return (Authentication) pexec.execPython("load_stored_authentication");
} else {
return super.loadStoredAuthentication();
}
}
@Override
public boolean shouldPerformAuthentication(Authentication auth) {
initPython();
if (pexec.isImplemented(4)) {
return pexec.execPythonBool("should_perform_authentication", auth);
} else {
return super.shouldPerformAuthentication(auth);
}
}
@Override
public Authentication getTransportAuthentication() {
initPython();
if (pexec.isImplemented(5)) {
return (Authentication) pexec.execPython("get_transport_authentication");
} else {
return super.getTransportAuthentication();
}
}
@Override
public void setTransportAuth(Authentication transportAuth) {
initPython();
if (pexec.isImplemented(6)) {
pexec.execPythonVoid("set_transport_auth", transportAuth);
} else {
super.setTransportAuth(transportAuth);
}
}
@Override
public void printUsage(PrintStream stderr, CmdLineParser p) {
initPython();
if (pexec.isImplemented(7)) {
pexec.execPythonVoid("print_usage", stderr, p);
} else {
super.printUsage(stderr, p);
}
}
@Override
public void printUsageSummary(PrintStream stderr) {
initPython();
if (pexec.isImplemented(8)) {
pexec.execPythonVoid("print_usage_summary", stderr);
} else {
super.printUsageSummary(stderr);
}
}
@Override
public String getClientSystemProperty(String name) throws IOException, InterruptedException {
initPython();
if (pexec.isImplemented(9)) {
return (String) pexec.execPython("get_client_system_property", name);
} else {
return super.getClientSystemProperty(name);
}
}
@Override
public Charset getClientCharset() throws IOException, InterruptedException {
initPython();
if (pexec.isImplemented(10)) {
return (Charset) pexec.execPython("get_client_charset");
} else {
return super.getClientCharset();
}
}
@Override
public String getClientEnvironmentVariable(String name) throws IOException, InterruptedException {
initPython();
if (pexec.isImplemented(11)) {
return (String) pexec.execPython("get_client_environment_variable", name);
} else {
return super.getClientEnvironmentVariable(name);
}
}
@Override
public CLICommand createClone() {
initPython();
if (pexec.isImplemented(12)) {
return (CLICommand) pexec.execPython("create_clone");
} else {
return super.createClone();
}
}
@Override
public void registerOptionHandlers() {
initPython();
if (pexec.isImplemented(13)) {
pexec.execPythonVoid("register_option_handlers");
} else {
super.registerOptionHandlers();
}
}
public String superGetName() {
return super.getName();
}
public int superMain(List<String> args, Locale locale, InputStream stdin, PrintStream stdout, PrintStream stderr) {
return super.main(args, locale, stdin, stdout, stderr);
}
public Channel superCheckChannel() throws AbortException {
return super.checkChannel();
}
public Authentication superLoadStoredAuthentication() throws InterruptedException {
return super.loadStoredAuthentication();
}
public boolean superShouldPerformAuthentication(Authentication auth) {
return super.shouldPerformAuthentication(auth);
}
public Authentication superGetTransportAuthentication() {
return super.getTransportAuthentication();
}
public void superSetTransportAuth(Authentication transportAuth) {
super.setTransportAuth(transportAuth);
}
public void superPrintUsage(PrintStream stderr, CmdLineParser p) {
super.printUsage(stderr, p);
}
public void superPrintUsageSummary(PrintStream stderr) {
super.printUsageSummary(stderr);
}
public String superGetClientSystemProperty(String name) throws IOException, InterruptedException {
return super.getClientSystemProperty(name);
}
public Charset superGetClientCharset() throws IOException, InterruptedException {
return super.getClientCharset();
}
public String superGetClientEnvironmentVariable(String name) throws IOException, InterruptedException {
return super.getClientEnvironmentVariable(name);
}
public CLICommand superCreateClone() {
return super.createClone();
}
public void superRegisterOptionHandlers() {
super.registerOptionHandlers();
}
public Object execPython(String function, Object... params) {
initPython();
return pexec.execPython(function, params);
}
public byte execPythonByte(String function, Object... params) {
initPython();
return pexec.execPythonByte(function, params);
}
public short execPythonShort(String function, Object... params) {
initPython();
return pexec.execPythonShort(function, params);
}
public char execPythonChar(String function, Object... params) {
initPython();
return pexec.execPythonChar(function, params);
}
public int execPythonInt(String function, Object... params) {
initPython();
return pexec.execPythonInt(function, params);
}
public long execPythonLong(String function, Object... params) {
initPython();
return pexec.execPythonLong(function, params);
}
public float execPythonFloat(String function, Object... params) {
initPython();
return pexec.execPythonFloat(function, params);
}
public double execPythonDouble(String function, Object... params) {
initPython();
return pexec.execPythonDouble(function, params);
}
public boolean execPythonBool(String function, Object... params) {
initPython();
return pexec.execPythonBool(function, params);
}
public void execPythonVoid(String function, Object... params) {
initPython();
pexec.execPythonVoid(function, params);
}
}