RoleMemoryRealmForm.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: RoleMemoryRealmForm.java,v 1.3 2003/06/20 17:15:41 antonma Exp $
00024  * --------------------------------------------------------------------------
00025  */
00026 
00027 package org.objectweb.jonas.webapp.jonasadmin.security;
00028 
00029 import javax.servlet.http.HttpServletRequest;
00030 
00031 import org.apache.struts.action.ActionError;
00032 import org.apache.struts.action.ActionErrors;
00033 import org.apache.struts.action.ActionForm;
00034 import org.apache.struts.action.ActionMapping;
00035 
00036 public class RoleMemoryRealmForm extends ActionForm {
00037 
00038 // --------------------------------------------------------- Constants
00039 
00040 // --------------------------------------------------------- Properties variables
00041 
00042     private String action = null;
00043     private String role = null;
00044     private String description = null;
00045 
00046 // --------------------------------------------------------- Public Methods
00047 
00054     public void reset(ActionMapping mapping, HttpServletRequest request) {
00055     }
00056 
00067     public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
00068         ActionErrors oErrors = new ActionErrors();
00069         // Create errors
00070         if (action.equals("create") == true) {
00071             role = role.trim();
00072             if (role.length() == 0) {
00073                 oErrors.add("role"
00074                     , new ActionError("error.security.factory.memory.realm.role.name.required"));
00075             }
00076         }
00077         return oErrors;
00078     }
00079 
00080 // --------------------------------------------------------- Properties Methods
00081 
00082     public String getRole() {
00083         return role;
00084     }
00085 
00086     public void setRole(String role) {
00087         this.role = role;
00088     }
00089 
00090     public String getDescription() {
00091         return description;
00092     }
00093 
00094     public void setDescription(String description) {
00095         this.description = description;
00096     }
00097 
00098     public String getAction() {
00099         return action;
00100     }
00101 
00102     public void setAction(String action) {
00103         this.action = action;
00104     }
00105 
00106 }

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