1 23 24 package com.sun.enterprise.admin.common; 25 26 import javax.management.*; 27 import com.sun.enterprise.admin.util.ArgChecker; 28 import com.sun.enterprise.admin.common.Param; 29 import com.sun.enterprise.admin.common.AdminRequest; 30 import com.sun.enterprise.admin.common.constant.AdminConstants; 31 32 34 public class AdminRequestConfigurator 35 { 36 private final AdminRequest request; 37 38 41 public AdminRequestConfigurator(AdminRequest request) 42 { 43 ArgChecker.checkValid(request, "request"); this.request = request; 45 } 46 47 50 public void setObjectName(ObjectName objectName) 51 { 52 request.addParam(new Param(AdminConstants.OBJECT_NAME, objectName)); 53 } 54 55 58 public ObjectName getObjectName() 59 { 60 ObjectName objectName = null; 61 Param param = request.getParam(AdminConstants.OBJECT_NAME); 62 if (param != null) 63 { 64 objectName = (ObjectName)(param.mValue); 65 } 66 return objectName; 67 } 68 69 72 public void setClientVersion(String clientVersion) 73 { 74 request.addParam(new Param(AdminConstants.CLIENT_VERSION, 75 clientVersion)); 76 } 77 78 81 public String getClientVersion() 82 { 83 String clientVersion = null; 84 Param param = request.getParam(AdminConstants.CLIENT_VERSION); 85 if (param != null) 86 { 87 clientVersion = (String )(param.mValue); 88 } 89 return clientVersion; 90 } 91 92 95 public void setOperationName(String operationName) 96 { 97 request.addParam(new Param(AdminConstants.OPERATION_NAME, 98 operationName)); 99 } 100 101 104 public String getOperationName() 105 { 106 String operationName = null; 107 Param param = request.getParam(AdminConstants.OPERATION_NAME); 108 if (param != null) 109 { 110 operationName = (String )(param.mValue); 111 } 112 return operationName; 113 } 114 115 118 public void setOperationParams(Object [] params) 119 { 120 request.addParam(new Param(AdminConstants.OPERATION_PARAMS, params)); 121 } 122 123 126 public Object [] getOperationParams() 127 { 128 Object [] params = null; 129 Param param = request.getParam(AdminConstants.OPERATION_PARAMS); 130 if (param != null) 131 { 132 params = (Object [])(param.mValue); 133 } 134 return params; 135 } 136 137 140 public void setOperationSignature(String [] signature) 141 { 142 request.addParam(new Param(AdminConstants.OPERATION_SIGNATURE, 143 signature)); 144 } 145 146 149 public String [] getOperationSignature() 150 { 151 String [] signature = null; 152 Param param = request.getParam(AdminConstants.OPERATION_SIGNATURE); 153 if (param != null) 154 { 155 signature = (String [])(param.mValue); 156 } 157 return signature; 158 } 159 160 162 public void setAttributeName(String attributeName) 163 { 164 request.addParam(new Param(AdminConstants.ATTRIBUTE_NAME, 165 attributeName)); 166 } 167 168 170 public String getAttributeName() 171 { 172 String attributeName = null; 173 Param param = request.getParam(AdminConstants.ATTRIBUTE_NAME); 174 if (param != null) 175 { 176 attributeName = (String )(param.mValue); 177 } 178 return attributeName; 179 } 180 181 183 public void setAttribute(Attribute attribute) 184 { 185 request.addParam(new Param(AdminConstants.ATTRIBUTE, attribute)); 186 } 187 188 190 public Attribute getAttribute() 191 { 192 Attribute attribute = null; 193 Param param = request.getParam(AdminConstants.ATTRIBUTE); 194 if (param != null) 195 { 196 attribute = (Attribute)(param.mValue); 197 } 198 return attribute; 199 } 200 201 203 public void setAttributeList(AttributeList al) 204 { 205 request.addParam(new Param(AdminConstants.ATTRIBUTE_LIST, al)); 206 } 207 208 210 public AttributeList getAttributeList() 211 { 212 AttributeList attributeList = null; 213 Param param = request.getParam(AdminConstants.ATTRIBUTE_LIST); 214 if (param != null) 215 { 216 attributeList = (AttributeList)(param.mValue); 217 } 218 return attributeList; 219 } 220 221 223 public String [] getAttributeNames() 224 { 225 String [] attributeNames = null; 226 Param param = request.getParam(AdminConstants.ATTRIBUTE_NAMES); 227 if (param != null) 228 { 229 attributeNames = (String [])(param.mValue); 230 } 231 return attributeNames; 232 } 233 234 236 public void setAttributeNames(String [] attributeNames) 237 { 238 request.addParam(new Param(AdminConstants.ATTRIBUTE_NAMES, 239 attributeNames)); 240 } 241 } | Popular Tags |