/** * Adds this identity to the specified user. */ public void addTo(User u) throws IOException { FederatedLoginServiceUserProperty p = u.getProperty(getUserPropertyClass()); if (p==null) { p = (FederatedLoginServiceUserProperty) UserProperty.all().find(getUserPropertyClass()).newInstance(u); u.addProperty(p); } p.addIdentifier(getIdentifier()); }
/** * Really creates a new agent. */ @RequirePOST public synchronized void doDoCreateItem( StaplerRequest req, StaplerResponse rsp, @QueryParameter String name, @QueryParameter String type ) throws IOException, ServletException, FormException { final Jenkins app = Jenkins.getInstance(); app.checkPermission(Computer.CREATE); String fixedName = Util.fixEmptyAndTrim(name); checkName(fixedName); JSONObject formData = req.getSubmittedForm(); formData.put("name", fixedName); // TODO type is probably NodeDescriptor.id but confirm Node result = NodeDescriptor.all().find(type).newInstance(req, formData); app.addNode(result); // take the user back to the agent list top page rsp.sendRedirect2("."); }
public static List<ListViewColumn> getDefaultColumns() { ArrayList<ListViewColumn> r = new ArrayList<ListViewColumn>(); DescriptorExtensionList<ListViewColumn, Descriptor<ListViewColumn>> all = ListViewColumn.all(); for (Class<? extends ListViewColumn> d: DEFAULT_COLUMNS) { Descriptor<ListViewColumn> des = all.find(d); if (des != null) { try { r.add(des.newInstance(null, null)); } catch (FormException e) { LOGGER.log(Level.WARNING, "Failed to instantiate "+des.clazz,e); } } } return Collections.unmodifiableList(r); }
private void sort(List<Component> components) { ComponentComparatorDescriptor comparatorDescriptor = GenericComponentComparator.all().find(sorting); if (comparatorDescriptor != null) { components.sort(comparatorDescriptor.createInstance()); } }
Descriptor<ListViewColumn> des = all.find(d); if (des != null) { try {
Descriptor<ListViewColumn> des = all.find(d); if (des != null) { try {
Descriptor<ListViewColumn> des = all.find(d); if (des != null) { try {
/** * Really creates a new slave. */ public synchronized void doDoCreateItem( StaplerRequest req, StaplerResponse rsp, @QueryParameter String name, @QueryParameter String type ) throws IOException, ServletException, FormException { final Hudson app = Hudson.getInstance(); app.checkPermission(Hudson.ADMINISTER); // TODO: new permission? checkName(name); Node result = NodeDescriptor.all().find(type).newInstance(req, req.getSubmittedForm()); app.addNode(result); // take the user back to the slave list top page rsp.sendRedirect2("."); }
/** * Really creates a new slave. */ public synchronized void doDoCreateItem( StaplerRequest req, StaplerResponse rsp, @QueryParameter String name, @QueryParameter String type ) throws IOException, ServletException, FormException { final Hudson app = Hudson.getInstance(); app.checkPermission(Hudson.ADMINISTER); // TODO: new permission? checkName(name); Node result = NodeDescriptor.all().find(type).newInstance(req, req.getSubmittedForm()); app.addNode(result); // take the user back to the slave list top page rsp.sendRedirect2("."); }
/** * Really creates a new slave. */ public synchronized void doDoCreateItem( StaplerRequest req, StaplerResponse rsp, @QueryParameter String name, @QueryParameter String type ) throws IOException, ServletException, FormException { final Hudson app = Hudson.getInstance(); app.checkPermission(Hudson.ADMINISTER); // TODO: new permission? checkName(name); Node result = NodeDescriptor.all().find(type).newInstance(req, req.getSubmittedForm()); app.addNode(result); // take the user back to the slave list top page rsp.sendRedirect2("."); }
/** * Adds this identity to the specified user. */ public void addTo(User u) throws IOException { FederatedLoginServiceUserProperty p = u.getProperty(getUserPropertyClass()); if (p==null) { p = (FederatedLoginServiceUserProperty) UserProperty.all().find(getUserPropertyClass()).newInstance(u); u.addProperty(p); } p.addIdentifier(getIdentifier()); }
/** * Adds this identity to the specified user. */ public void addTo(User u) throws IOException { FederatedLoginServiceUserProperty p = u.getProperty(getUserPropertyClass()); if (p==null) { p = (FederatedLoginServiceUserProperty) UserProperty.all().find(getUserPropertyClass()).newInstance(u); u.addProperty(p); } p.addIdentifier(getIdentifier()); }
/** * Really creates a new agent. */ @RequirePOST public synchronized void doDoCreateItem( StaplerRequest req, StaplerResponse rsp, @QueryParameter String name, @QueryParameter String type ) throws IOException, ServletException, FormException { final Jenkins app = Jenkins.getInstance(); app.checkPermission(Computer.CREATE); String fixedName = Util.fixEmptyAndTrim(name); checkName(fixedName); JSONObject formData = req.getSubmittedForm(); formData.put("name", fixedName); // TODO type is probably NodeDescriptor.id but confirm Node result = NodeDescriptor.all().find(type).newInstance(req, formData); app.addNode(result); // take the user back to the agent list top page rsp.sendRedirect2("."); }
/** * Adds this identity to the specified user. */ public void addTo(User u) throws IOException { FederatedLoginServiceUserProperty p = u.getProperty(getUserPropertyClass()); if (p==null) { p = (FederatedLoginServiceUserProperty) UserProperty.all().find(getUserPropertyClass()).newInstance(u); u.addProperty(p); } p.addIdentifier(getIdentifier()); }
/** * Adds this identity to the specified user. */ public void addTo(User u) throws IOException { FederatedLoginServiceUserProperty p = u.getProperty(getUserPropertyClass()); if (p==null) { p = (FederatedLoginServiceUserProperty) UserProperty.all().find(getUserPropertyClass()).newInstance(u); u.addProperty(p); } p.addIdentifier(getIdentifier()); }
NodeDescriptor d = NodeDescriptor.all().find(mode); d.handleNewNodePage(this,name,req,rsp);
/** * Adds this identity to the specified user. */ public void addTo(User u) throws IOException { FederatedLoginServiceUserProperty p = u.getProperty(getUserPropertyClass()); if (p == null) { p = (FederatedLoginServiceUserProperty) UserProperty.all().find(getUserPropertyClass()).newInstance(u); u.addProperty(p); } p.addIdentifier(getIdentifier()); }
NodeDescriptor d = NodeDescriptor.all().find(mode); d.handleNewNodePage(this,name,req,rsp);
NodeDescriptor d = NodeDescriptor.all().find(mode); d.handleNewNodePage(this,name,req,rsp);
/** * Really creates a new slave. */ public synchronized void doDoCreateItem(StaplerRequest req, StaplerResponse rsp, @QueryParameter String name, @QueryParameter String type) throws IOException, ServletException, FormException { final Hudson app = Hudson.getInstance(); if (app.getTeamManager().isTeamManagementEnabled()) { app.checkPermission(Computer.CREATE); } else { app.checkPermission(Hudson.ADMINISTER); // TODO: new permission? } checkName(name); Node result = NodeDescriptor.all().find(type).newInstance(req, req.getSubmittedForm()); app.addNode(result); addToTeam(result.getNodeName(), null); // take the user back to the slave list top page rsp.sendRedirect2("."); }