KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > infoglue > cms > applications > managementtool > actions > UpdateServerNodeAction


1 /* ===============================================================================
2  *
3  * Part of the InfoGlue Content Management Platform (www.infoglue.org)
4  *
5  * ===============================================================================
6  *
7  * Copyright (C)
8  *
9  * This program is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License version 2, as published by the
11  * Free Software Foundation. See the file LICENSE.html for more information.
12  *
13  * This program is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY, including the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along with
18  * this program; if not, write to the Free Software Foundation, Inc. / 59 Temple
19  * Place, Suite 330 / Boston, MA 02111-1307 / USA.
20  *
21  * ===============================================================================
22  */

23
24 package org.infoglue.cms.applications.managementtool.actions;
25
26 import org.infoglue.cms.controllers.kernel.impl.simple.ServerNodeController;
27 import org.infoglue.cms.entities.management.ServerNodeVO;
28 import org.infoglue.cms.util.ConstraintExceptionBuffer;
29
30
31 /**
32   * This is the action-class for UpdateServerNode
33   *
34   * @author Mattias Bogeblad
35   */

36 public class UpdateServerNodeAction extends ViewServerNodeAction //WebworkAbstractAction
37
{
38     
39     private ServerNodeVO serverNodeVO;
40     private Integer JavaDoc serverNodeId;
41     private String JavaDoc userAction = "";
42     private ConstraintExceptionBuffer ceb;
43     
44     public UpdateServerNodeAction()
45     {
46         this(new ServerNodeVO());
47     }
48     
49     public UpdateServerNodeAction(ServerNodeVO serverNodeVO)
50     {
51         this.serverNodeVO = serverNodeVO;
52         this.ceb = new ConstraintExceptionBuffer();
53     }
54
55         
56     public String JavaDoc doExecute() throws Exception JavaDoc
57     {
58         super.initialize(getServerNodeId());
59
60         ceb.add(this.serverNodeVO.validate());
61         ceb.throwIfNotEmpty();
62         
63         ServerNodeController.getController().update(this.serverNodeVO);
64                 
65         return "success";
66     }
67
68     public String JavaDoc doSaveAndExit() throws Exception JavaDoc
69     {
70         doExecute();
71                         
72         return "saveAndExit";
73     }
74
75     public void setServerNodeId(Integer JavaDoc serverNodeId) throws Exception JavaDoc
76     {
77         this.serverNodeVO.setServerNodeId(serverNodeId);
78     }
79
80     public java.lang.Integer JavaDoc getServerNodeId()
81     {
82         return this.serverNodeVO.getServerNodeId();
83     }
84         
85     public java.lang.String JavaDoc getName()
86     {
87         return this.serverNodeVO.getName();
88     }
89         
90     public void setName(java.lang.String JavaDoc name)
91     {
92         this.serverNodeVO.setName(name);
93     }
94
95     public String JavaDoc getDescription()
96     {
97         return this.serverNodeVO.getDescription();
98     }
99         
100     public void setDescription(String JavaDoc description)
101     {
102         this.serverNodeVO.setDescription(description);
103     }
104     
105     public String JavaDoc getDnsName()
106     {
107         return this.serverNodeVO.getDnsName();
108     }
109         
110     public void setDnsName(String JavaDoc dnsName)
111     {
112         this.serverNodeVO.setDnsName(dnsName);
113     }
114     
115 }
116
Popular Tags