1 16 17 package org.apache.webapp.admin.users; 18 19 20 import javax.management.ObjectName ; 21 import javax.servlet.http.HttpServletRequest ; 22 import org.apache.struts.action.ActionError; 23 import org.apache.struts.action.ActionErrors; 24 import org.apache.struts.action.ActionForm; 25 import org.apache.struts.action.ActionMapping; 26 27 28 36 37 public class BaseForm extends ActionForm { 38 39 40 42 43 45 46 49 private String databaseName = null; 50 51 public String getDatabaseName() { 52 if ((this.databaseName == null) && (this.objectName != null)) { 53 try { 54 ObjectName oname = new ObjectName (this.objectName); 55 this.databaseName = oname.getDomain() + ":" + 56 "type=UserDatabase,database=" + 57 oname.getKeyProperty("database"); 58 } catch (Throwable t) { 59 this.databaseName = null; 60 } 61 } 62 return (this.databaseName); 63 } 64 65 public void setDatabaseName(String databaseName) { 66 if ((databaseName != null) && (databaseName.length() < 1)) { 67 this.databaseName = null; 68 } else { 69 this.databaseName = databaseName; 70 } 71 } 72 73 74 77 private String nodeLabel = null; 78 79 public String getNodeLabel() { 80 return (this.nodeLabel); 81 } 82 83 public void setNodeLabel(String nodeLabel) { 84 this.nodeLabel = nodeLabel; 85 } 86 87 88 92 private String objectName = null; 93 94 public String getObjectName() { 95 return (this.objectName); 96 } 97 98 public void setObjectName(String objectName) { 99 if ((objectName != null) && (objectName.length() < 1)) { 100 this.objectName = null; 101 } else { 102 this.objectName = objectName; 103 } 104 } 105 106 107 109 115 public void reset(ActionMapping mapping, HttpServletRequest request) { 116 117 databaseName = null; 118 nodeLabel = null; 119 objectName = null; 120 121 } 122 123 124 } 125 | Popular Tags |