package jenkins.python.expoint; import com.infradna.tool.bridge_method_injector.WithBridgeMethods; import hudson.Extension; import hudson.ExtensionPoint; import hudson.FilePath; import hudson.FileSystemProvisioner; import hudson.Launcher; import hudson.model.Descriptor.FormException; import hudson.model.Queue.Task; import hudson.model.labels.LabelAtom; import hudson.model.queue.CauseOfBlockage; import hudson.node_monitors.NodeMonitor; import hudson.remoting.VirtualChannel; import hudson.security.ACL; import hudson.security.AccessControlled; import hudson.security.Permission; import hudson.slaves.ComputerListener; import hudson.slaves.NodeDescriptor; import hudson.slaves.NodeProperty; import hudson.slaves.NodePropertyDescriptor; import hudson.slaves.OfflineCause; import hudson.util.ClockDifference; import hudson.util.DescribableList; import hudson.util.EnumConverter; import hudson.util.TagCloud; import hudson.util.TagCloud.WeightFunction; import java.io.IOException; import java.lang.reflect.Type; import java.util.Collections; import java.util.HashSet; import java.util.Set; import java.util.List; import java.util.logging.Logger; import javax.annotation.CheckForNull; import jenkins.model.Jenkins; import jenkins.util.io.OnMaster; import net.sf.json.JSONObject; import org.kohsuke.stapler.BindInterceptor; import org.kohsuke.stapler.Stapler; import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.export.ExportedBean; import org.kohsuke.stapler.export.Exported; import hudson.model.*; import hudson.model.Node.*; import hudson.search.SearchFactory; import org.kohsuke.stapler.StaplerResponse; import javax.servlet.ServletException; 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.AbstractModelObject.*; import jenkins.python.DataConvertor; import jenkins.python.PythonExecutor; /** * This class was automatically generated by the PWM tool on 2014/03/21. * @see hudson.model.Node */ public abstract class NodePW extends Node { private transient PythonExecutor pexec; private void initPython() { if (pexec == null) { pexec = new PythonExecutor(this); String[] jMethods = new String[13]; jMethods[0] = "getNodeName"; jMethods[1] = "setNodeName"; jMethods[2] = "getNodeDescription"; jMethods[3] = "createLauncher"; jMethods[4] = "getNumExecutors"; jMethods[5] = "getMode"; jMethods[6] = "createComputer"; jMethods[7] = "getLabelString"; jMethods[8] = "getWorkspaceFor"; jMethods[9] = "getRootPath"; jMethods[10] = "getNodeProperties"; jMethods[11] = "getDescriptor"; jMethods[12] = "getClockDifference"; String[] pFuncs = new String[13]; pFuncs[0] = "get_node_name"; pFuncs[1] = "set_node_name"; pFuncs[2] = "get_node_description"; pFuncs[3] = "create_launcher"; pFuncs[4] = "get_num_executors"; pFuncs[5] = "get_mode"; pFuncs[6] = "create_computer"; pFuncs[7] = "get_label_string"; pFuncs[8] = "get_workspace_for"; pFuncs[9] = "get_root_path"; pFuncs[10] = "get_node_properties"; pFuncs[11] = "get_descriptor"; pFuncs[12] = "get_clock_difference"; Class[][] argTypes = new Class[13][]; argTypes[0] = new Class[0]; argTypes[1] = new Class[1]; argTypes[1][0] = String.class; argTypes[2] = new Class[0]; argTypes[3] = new Class[1]; argTypes[3][0] = TaskListener.class; argTypes[4] = new Class[0]; argTypes[5] = new Class[0]; argTypes[6] = new Class[0]; argTypes[7] = new Class[0]; argTypes[8] = new Class[1]; argTypes[8][0] = TopLevelItem.class; argTypes[9] = new Class[0]; argTypes[10] = new Class[0]; argTypes[11] = new Class[0]; argTypes[12] = new Class[0]; pexec.checkAbstrMethods(jMethods, pFuncs, argTypes); String[] functions = new String[19]; functions[0] = "get_display_name"; functions[1] = "get_search_url"; functions[2] = "is_hold_off_launch_until_save"; functions[3] = "get_label_cloud"; functions[4] = "get_assigned_labels"; functions[5] = "set_label_string"; functions[6] = "get_self_label"; functions[7] = "can_take"; functions[8] = "can_take"; functions[9] = "create_path"; functions[10] = "get_file_system_provisioner"; functions[11] = "get_node_property_descriptors"; functions[12] = "get_acl"; functions[13] = "reconfigure"; functions[14] = "get_description"; functions[15] = "get_name"; functions[16] = "make_search_index"; functions[17] = "get_search"; functions[18] = "get_search_name"; int[] argsCount = new int[19]; argsCount[0] = 0; argsCount[1] = 0; argsCount[2] = 0; argsCount[3] = 0; argsCount[4] = 0; argsCount[5] = 1; argsCount[6] = 0; argsCount[7] = 1; argsCount[8] = 1; argsCount[9] = 1; argsCount[10] = 0; argsCount[11] = 0; argsCount[12] = 0; argsCount[13] = 2; argsCount[14] = 0; argsCount[15] = 0; argsCount[16] = 0; argsCount[17] = 0; argsCount[18] = 0; pexec.registerFunctions(functions, argsCount); } } @Override @Exported(visibility = 999) public String getNodeName() { initPython(); return (String) pexec.execPython("get_node_name"); } @Override public void setNodeName(String name) { initPython(); pexec.execPythonVoid("set_node_name", name); } @Override @Exported public String getNodeDescription() { initPython(); return (String) pexec.execPython("get_node_description"); } @Override public Launcher createLauncher(TaskListener listener) { initPython(); return (Launcher) pexec.execPython("create_launcher", listener); } @Override @Exported public int getNumExecutors() { initPython(); return pexec.execPythonInt("get_num_executors"); } @Override @Exported public Mode getMode() { initPython(); return (Mode) pexec.execPython("get_mode"); } @Override public Computer createComputer() { initPython(); return (Computer) pexec.execPython("create_computer"); } @Override public String getLabelString() { initPython(); return (String) pexec.execPython("get_label_string"); } @Override public FilePath getWorkspaceFor(TopLevelItem item) { initPython(); return (FilePath) pexec.execPython("get_workspace_for", item); } @Override public FilePath getRootPath() { initPython(); return (FilePath) pexec.execPython("get_root_path"); } @Override public DescribableList<NodeProperty<?>, NodePropertyDescriptor> getNodeProperties() { initPython(); return (DescribableList) pexec.execPython("get_node_properties"); } @Override public NodeDescriptor getDescriptor() { initPython(); return (NodeDescriptor) pexec.execPython("get_descriptor"); } @Override public ClockDifference getClockDifference() throws IOException, InterruptedException { initPython(); return (ClockDifference) pexec.execPython("get_clock_difference"); } @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 boolean isHoldOffLaunchUntilSave() { initPython(); if (pexec.isImplemented(2)) { return pexec.execPythonBool("is_hold_off_launch_until_save"); } else { return super.isHoldOffLaunchUntilSave(); } } @Override public TagCloud<LabelAtom> getLabelCloud() { initPython(); if (pexec.isImplemented(3)) { return (TagCloud) pexec.execPython("get_label_cloud"); } else { return super.getLabelCloud(); } } @Override @Exported public Set<LabelAtom> getAssignedLabels() { initPython(); if (pexec.isImplemented(4)) { return (Set) pexec.execPython("get_assigned_labels"); } else { return super.getAssignedLabels(); } } @Override public void setLabelString(String labelString) throws IOException { initPython(); if (pexec.isImplemented(5)) { pexec.execPythonVoid("set_label_string", labelString); } else { super.setLabelString(labelString); } } @Override @WithBridgeMethods(Label.class) public LabelAtom getSelfLabel() { initPython(); if (pexec.isImplemented(6)) { return (LabelAtom) pexec.execPython("get_self_label"); } else { return super.getSelfLabel(); } } @Override public CauseOfBlockage canTake(Task task) { initPython(); if (pexec.isImplemented(7)) { return (CauseOfBlockage) pexec.execPython("can_take", task); } else { return super.canTake(task); } } @Override public CauseOfBlockage canTake(Queue.BuildableItem item) { initPython(); if (pexec.isImplemented(8)) { return (CauseOfBlockage) pexec.execPython("can_take", item); } else { return super.canTake(item); } } @Override public @CheckForNull FilePath createPath(String absolutePath) { initPython(); if (pexec.isImplemented(9)) { return (FilePath) pexec.execPython("create_path", absolutePath); } else { return super.createPath(absolutePath); } } @Override public FileSystemProvisioner getFileSystemProvisioner() { initPython(); if (pexec.isImplemented(10)) { return (FileSystemProvisioner) pexec.execPython("get_file_system_provisioner"); } else { return super.getFileSystemProvisioner(); } } @Override public List<NodePropertyDescriptor> getNodePropertyDescriptors() { initPython(); if (pexec.isImplemented(11)) { return (List) pexec.execPython("get_node_property_descriptors"); } else { return super.getNodePropertyDescriptors(); } } @Override public ACL getACL() { initPython(); if (pexec.isImplemented(12)) { return (ACL) pexec.execPython("get_acl"); } else { return super.getACL(); } } @Override public Node reconfigure(final StaplerRequest req, JSONObject form) throws FormException { initPython(); if (pexec.isImplemented(13)) { return (Node) pexec.execPython("reconfigure", req, form); } else { return super.reconfigure(req, form); } } @Override public SearchIndexBuilder makeSearchIndex() { initPython(); if (pexec.isImplemented(16)) { return (SearchIndexBuilder) pexec.execPython("make_search_index"); } else { return super.makeSearchIndex(); } } @Override public Search getSearch() { initPython(); if (pexec.isImplemented(17)) { return (Search) pexec.execPython("get_search"); } else { return super.getSearch(); } } @Override public String getSearchName() { initPython(); if (pexec.isImplemented(18)) { return (String) pexec.execPython("get_search_name"); } else { return super.getSearchName(); } } public String superGetDisplayName() { return super.getDisplayName(); } public String superGetSearchUrl() { return super.getSearchUrl(); } public boolean superIsHoldOffLaunchUntilSave() { return super.isHoldOffLaunchUntilSave(); } public TagCloud<LabelAtom> superGetLabelCloud() { return super.getLabelCloud(); } public Set<LabelAtom> superGetAssignedLabels() { return super.getAssignedLabels(); } public void superSetLabelString(String labelString) throws IOException { super.setLabelString(labelString); } public LabelAtom superGetSelfLabel() { return super.getSelfLabel(); } public CauseOfBlockage superCanTake(Task task) { return super.canTake(task); } public CauseOfBlockage superCanTake(Queue.BuildableItem item) { return super.canTake(item); } public FilePath superCreatePath(String absolutePath) { return super.createPath(absolutePath); } public FileSystemProvisioner superGetFileSystemProvisioner() { return super.getFileSystemProvisioner(); } public List<NodePropertyDescriptor> superGetNodePropertyDescriptors() { return super.getNodePropertyDescriptors(); } public ACL superGetACL() { return super.getACL(); } public Node superReconfigure(final StaplerRequest req, JSONObject form) throws FormException { return super.reconfigure(req, form); } 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); } }