package jenkins.python.expoint; import hudson.ExtensionPoint; import hudson.Extension; import hudson.DescriptorExtensionList; import hudson.slaves.NodeProvisioner.PlannedNode; import hudson.model.Describable; import jenkins.model.Jenkins; import hudson.model.Node; import hudson.model.AbstractModelObject; import hudson.model.Label; import hudson.model.Descriptor; import hudson.security.ACL; import hudson.security.AccessControlled; import hudson.security.Permission; import hudson.util.DescriptorList; import java.util.Collection; import hudson.slaves.*; import hudson.slaves.Cloud.*; import hudson.search.SearchFactory; import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.StaplerResponse; import org.kohsuke.stapler.Stapler; import javax.servlet.ServletException; import java.io.IOException; import hudson.search.SearchableModelObject; import hudson.search.Search; import hudson.search.SearchIndexBuilder; import hudson.search.SearchIndex; import org.kohsuke.stapler.interceptor.RequirePOST; import hudson.model.*; import hudson.model.AbstractModelObject.*; import jenkins.python.DataConvertor; import jenkins.python.PythonExecutor; /** * This class was automatically generated by the PWM tool on 2014/03/21. * @see hudson.slaves.Cloud */ public abstract class CloudPW extends Cloud { private transient PythonExecutor pexec; private void initPython() { if (pexec == null) { pexec = new PythonExecutor(this); String[] jMethods = new String[2]; jMethods[0] = "provision"; jMethods[1] = "canProvision"; String[] pFuncs = new String[2]; pFuncs[0] = "provision"; pFuncs[1] = "can_provision"; Class[][] argTypes = new Class[2][]; argTypes[0] = new Class[2]; argTypes[0][0] = Label.class; argTypes[0][1] = int.class; argTypes[1] = new Class[1]; argTypes[1][0] = Label.class; pexec.checkAbstrMethods(jMethods, pFuncs, argTypes); String[] functions = new String[7]; functions[0] = "get_display_name"; functions[1] = "get_search_url"; functions[2] = "get_acl"; functions[3] = "get_descriptor"; functions[4] = "make_search_index"; functions[5] = "get_search"; functions[6] = "get_search_name"; int[] argsCount = new int[7]; argsCount[0] = 0; argsCount[1] = 0; argsCount[2] = 0; argsCount[3] = 0; argsCount[4] = 0; argsCount[5] = 0; argsCount[6] = 0; pexec.registerFunctions(functions, argsCount); } } public CloudPW(String name) { super(name); } @Override public Collection<PlannedNode> provision(Label label, int excessWorkload) { initPython(); return (Collection) pexec.execPython("provision", label, DataConvertor.fromInt(excessWorkload)); } @Override public boolean canProvision(Label label) { initPython(); return pexec.execPythonBool("can_provision", label); } @Override public String getDisplayName() { initPython(); if (pexec.isImplemented(0)) { return (String) pexec.execPython("get_display_name"); } else { return super.getDisplayName(); } } @Override public String getSearchUrl() { initPython(); if (pexec.isImplemented(1)) { return (String) pexec.execPython("get_search_url"); } else { return super.getSearchUrl(); } } @Override public ACL getACL() { initPython(); if (pexec.isImplemented(2)) { return (ACL) pexec.execPython("get_acl"); } else { return super.getACL(); } } @Override public Descriptor<Cloud> getDescriptor() { initPython(); if (pexec.isImplemented(3)) { return (Descriptor) pexec.execPython("get_descriptor"); } else { return super.getDescriptor(); } } @Override public SearchIndexBuilder makeSearchIndex() { initPython(); if (pexec.isImplemented(4)) { return (SearchIndexBuilder) pexec.execPython("make_search_index"); } else { return super.makeSearchIndex(); } } @Override public Search getSearch() { initPython(); if (pexec.isImplemented(5)) { return (Search) pexec.execPython("get_search"); } else { return super.getSearch(); } } @Override public String getSearchName() { initPython(); if (pexec.isImplemented(6)) { return (String) pexec.execPython("get_search_name"); } else { return super.getSearchName(); } } public String superGetDisplayName() { return super.getDisplayName(); } public String superGetSearchUrl() { return super.getSearchUrl(); } public ACL superGetACL() { return super.getACL(); } public Descriptor<Cloud> superGetDescriptor() { return super.getDescriptor(); } public SearchIndexBuilder superMakeSearchIndex() { return super.makeSearchIndex(); } public Search superGetSearch() { return super.getSearch(); } public String superGetSearchName() { return super.getSearchName(); } 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); } }