GroupMemoryRealmForm.java

00001 /*
00002  * JOnAS: Java(TM) Open Application Server
00003  * Copyright (C) 1999 Bull S.A.
00004  * Contact: jonas-team@objectweb.org
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
00019  * USA
00020  *
00021  * Initial developer(s): Michel-Ange ANTON
00022  * --------------------------------------------------------------------------
00023  * $Id: GroupMemoryRealmForm.java,v 1.4 2004/03/19 14:31:48 sauthieg Exp $
00024  * --------------------------------------------------------------------------
00025  */
00026 
00027 package org.objectweb.jonas.webapp.jonasadmin.security;
00028 
00029 import java.util.ArrayList;
00030 
00031 import javax.servlet.http.HttpServletRequest;
00032 
00033 import org.apache.struts.action.ActionError;
00034 import org.apache.struts.action.ActionErrors;
00035 import org.apache.struts.action.ActionForm;
00036 import org.apache.struts.action.ActionMapping;
00037 import org.objectweb.jonas.webapp.jonasadmin.Jlists;
00038 
00039 public class GroupMemoryRealmForm extends ActionForm {
00040 
00041 // --------------------------------------------------------- Constants
00042 
00043 // --------------------------------------------------------- Properties variables
00044 
00045     private String action = null;
00046     private String group = null;
00047     private String description = null;
00048     private java.util.ArrayList listRolesGroup = new ArrayList();
00049     private java.util.ArrayList listRolesRealm = new ArrayList();
00050     private java.util.ArrayList listRolesUsed = new ArrayList();
00051     private java.util.ArrayList listRolesNotused = new ArrayList();
00052     private String rolesUsed = null;
00053     private String rolesNotused = null;
00054     private String[] rolesNotusedSelected = new String[0];
00055     private String[] rolesUsedSelected = new String[0];
00056 
00057 // --------------------------------------------------------- Public Methods
00058 
00065     public void reset(ActionMapping mapping, HttpServletRequest request) {
00066         rolesUsed = null;
00067         rolesNotused = null;
00068         // Mandatory !
00069         rolesNotusedSelected = new String[0];
00070         rolesUsedSelected = new String[0];
00071     }
00072 
00083     public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
00084         ActionErrors oErrors = new ActionErrors();
00085         // Create errors
00086         if (action.equals("create") == true) {
00087             group = group.trim();
00088             if (group.length() == 0) {
00089                 oErrors.add("group"
00090                     , new ActionError("error.security.factory.memory.realm.group.name.required"));
00091             }
00092         }
00093         // Replace the elements in their good place
00094         if (oErrors.size() > 0) {
00095             listRolesUsed = Jlists.getArrayList(rolesUsed, Jlists.SEPARATOR);
00096             listRolesNotused = Jlists.getArrayList(rolesNotused, Jlists.SEPARATOR);
00097         }
00098         return oErrors;
00099     }
00100 
00101 // --------------------------------------------------------- Properties Methods
00102 
00103     public String getGroup() {
00104         return group;
00105     }
00106 
00107     public void setGroup(String group) {
00108         this.group = group;
00109     }
00110 
00111     public String getDescription() {
00112         return description;
00113     }
00114 
00115     public void setDescription(String description) {
00116         this.description = description;
00117     }
00118 
00119     public java.util.ArrayList getListRolesGroup() {
00120         return listRolesGroup;
00121     }
00122 
00123     public void setListRolesGroup(java.util.ArrayList listRolesGroup) {
00124         this.listRolesGroup = listRolesGroup;
00125     }
00126 
00127     public java.util.ArrayList getListRolesRealm() {
00128         return listRolesRealm;
00129     }
00130 
00131     public void setListRolesRealm(java.util.ArrayList listRolesRealm) {
00132         this.listRolesRealm = listRolesRealm;
00133     }
00134 
00135     public java.util.ArrayList getListRolesUsed() {
00136         return listRolesUsed;
00137     }
00138 
00139     public void setListRolesUsed(java.util.ArrayList listRolesUsed) {
00140         this.listRolesUsed = listRolesUsed;
00141     }
00142 
00143     public java.util.ArrayList getListRolesNotused() {
00144         return listRolesNotused;
00145     }
00146 
00147     public void setListRolesNotused(java.util.ArrayList listRolesNotused) {
00148         this.listRolesNotused = listRolesNotused;
00149     }
00150 
00151     public String getRolesUsed() {
00152         return rolesUsed;
00153     }
00154 
00155     public void setRolesUsed(String rolesUsed) {
00156         this.rolesUsed = rolesUsed;
00157     }
00158 
00159     public String getRolesNotused() {
00160         return rolesNotused;
00161     }
00162 
00163     public void setRolesNotused(String rolesNotused) {
00164         this.rolesNotused = rolesNotused;
00165     }
00166 
00167     public String[] getRolesNotusedSelected() {
00168         return rolesNotusedSelected;
00169     }
00170 
00171     public void setRolesNotusedSelected(String[] rolesNotusedSelected) {
00172         this.rolesNotusedSelected = rolesNotusedSelected;
00173     }
00174 
00175     public String[] getRolesUsedSelected() {
00176         return rolesUsedSelected;
00177     }
00178 
00179     public void setRolesUsedSelected(String[] rolesUsedSelected) {
00180         this.rolesUsedSelected = rolesUsedSelected;
00181     }
00182 
00183     public String getAction() {
00184         return action;
00185     }
00186 
00187     public void setAction(String action) {
00188         this.action = action;
00189     }
00190 
00191 }

Generated on Tue Feb 15 15:05:30 2005 for JOnAS by  doxygen 1.3.9.1