Method from org.apache.geronimo.console.databasemanager.wizard.DatabasePoolPortlet$PoolData Detail: |
public String getAbstractName() {
return abstractName;
}
|
public Map<String, String> getAbstractNameMap() {
if (abstractName == null) return Collections.emptyMap();
if (abstractNameMap != null) return abstractNameMap;
AbstractName name = new AbstractName(URI.create(abstractName));
abstractNameMap = new HashMap< String, String >(name.getName());
abstractNameMap.put("domain", name.getObjectName().getDomain());
abstractNameMap.put("groupId", name.getArtifact().getGroupId());
abstractNameMap.put("artifactId", name.getArtifact().getArtifactId());
abstractNameMap.put("type", name.getArtifact().getType());
abstractNameMap.put("version", name.getArtifact().getVersion().toString());
return abstractNameMap;
}
|
public String getAdapterDescription() {
return adapterDescription;
}
|
public String getAdapterDisplayName() {
return adapterDisplayName;
}
|
public String getAdapterRarPath() {
return adapterRarPath;
}
|
public String getBlockingTimeout() {
return blockingTimeout;
}
|
public String getDbtype() {
return dbtype;
}
|
public String getDeployError() {
return deployError;
}
|
public String getDriverClass() {
return driverClass;
}
|
public String getIdleTimeout() {
return idleTimeout;
}
|
public String getImportSource() {
return importSource;
}
|
public String[] getJars() {
return jars;
}
|
public String getMaxSize() {
return maxSize;
}
|
public String getMinSize() {
return minSize;
}
|
public String getName() {
return name;
}
|
public String getPassword() {
return password;
}
|
public Map<String, String> getProperties() {
return properties;
}
|
public Map<String, String> getPropertyNames() {
return propertyNames;
}
|
public String getRarPath() {
return rarPath;
}
|
public String getTransactionType() {
return transactionType;
}
|
public String getUrl() {
return url;
}
|
public Map<String, Object> getUrlProperties() {
return urlProperties;
}
|
public String getUrlPrototype() {
return urlPrototype;
}
|
public String getUser() {
return user;
}
|
public boolean isGeneric() {
//todo: is there any better way to tell?
return adapterDisplayName == null || adapterDisplayName.equals("TranQL Generic JDBC Resource Adapter");
}
|
public void load(PortletRequest request) {
name = request.getParameter("name");
if (name != null && name.equals("")) name = null;
driverClass = request.getParameter("driverClass");
if (driverClass != null && driverClass.equals("")) driverClass = null;
dbtype = request.getParameter("dbtype");
if (dbtype != null && dbtype.equals("")) dbtype = null;
user = request.getParameter("user");
if (user != null && user.equals("")) user = null;
password = request.getParameter("password");
if (password != null && password.equals("")) password = null;
url = request.getParameter("url");
if (url != null && url.equals("")) {
url = null;
} else if (url != null && url.startsWith("URLENCODED")) {
try {
url = URLDecoder.decode(url.substring(10), "UTF-8");
} catch (UnsupportedEncodingException e) {
throw new RuntimeException("Unable to decode URL", e);
} catch (IllegalArgumentException e) { // not encoded after all??
url = url.substring(10);
}
}
urlPrototype = request.getParameter("urlPrototype");
if (urlPrototype != null && urlPrototype.equals("")) urlPrototype = null;
jars = request.getParameterValues("jars");
minSize = request.getParameter("minSize");
if (minSize != null && minSize.equals("")) minSize = null;
maxSize = request.getParameter("maxSize");
if (maxSize != null && maxSize.equals("")) maxSize = null;
blockingTimeout = request.getParameter("blockingTimeout");
if (blockingTimeout != null && blockingTimeout.equals("")) blockingTimeout = null;
idleTimeout = request.getParameter("idleTimeout");
if (idleTimeout != null && idleTimeout.equals("")) idleTimeout = null;
abstractName = request.getParameter("abstractName");
if (abstractName != null && abstractName.equals("")) abstractName = null;
adapterDisplayName = request.getParameter("adapterDisplayName");
if (adapterDisplayName != null && adapterDisplayName.equals("")) adapterDisplayName = null;
adapterDescription = request.getParameter("adapterDescription");
if (adapterDescription != null && adapterDescription.equals("")) adapterDescription = null;
rarPath = request.getParameter("rarPath");
if (rarPath != null && rarPath.equals("")) rarPath = null;
importSource = request.getParameter("importSource");
if (importSource != null && importSource.equals("")) importSource = null;
transactionType = request.getParameter("transactionType");
if (transactionType != null && "".equals(transactionType)) {
if (dbtype != null && dbtype.endsWith("XA")) {
transactionType = XA;
} else {
transactionType = LOCAL;
}
}
Map map = request.getParameterMap();
propertyNames = new HashMap< String, String >();
for (Object o : map.keySet()) {
String key = (String) o;
if (key.startsWith("urlproperty-")) {
urlProperties.put(key, request.getParameter(key));
} else if (key.startsWith("property-")) {
properties.put(key, request.getParameter(key));
propertyNames.put(key, getPropertyName(key));
}
}
sort();
deployError = request.getParameter("deployError");
if (deployError != null && deployError.equals("")) deployError = null;
}
|
public void loadPropertyNames() {
propertyNames = new HashMap< String, String >();
for (String key : properties.keySet()) {
propertyNames.put(key, getPropertyName(key));
}
}
|
public void setTransactionType(String transactionType) {
this.transactionType = transactionType;
}
|
public void sort() {
Map< String, String > sortedProperties = new LinkedHashMap< String, String >();
for (String propertyName : ORDERED_PROPERTY_NAMES) {
if (properties.containsKey(propertyName)) {
sortedProperties.put(propertyName, properties.get(propertyName));
properties.remove(propertyName);
}
}
sortedProperties.putAll(properties);
properties = sortedProperties;
}
|
public void store(ActionResponse response) {
if (name != null) response.setRenderParameter("name", name);
if (dbtype != null) response.setRenderParameter("dbtype", dbtype);
if (driverClass != null) response.setRenderParameter("driverClass", driverClass);
if (user != null) response.setRenderParameter("user", user);
if (password != null) response.setRenderParameter("password", password);
if (url != null) { // attempt to work around Pluto/Tomcat error with ; in a stored value
try {
response.setRenderParameter("url", "URLENCODED" + URLEncoder.encode(url, "UTF-8"));
} catch (UnsupportedEncodingException e) {
throw new RuntimeException("Unable to encode URL", e);
}
}
if (urlPrototype != null) response.setRenderParameter("urlPrototype", urlPrototype);
if (jars != null) response.setRenderParameter("jars", jars);
if (minSize != null) response.setRenderParameter("minSize", minSize);
if (maxSize != null) response.setRenderParameter("maxSize", maxSize);
if (blockingTimeout != null) response.setRenderParameter("blockingTimeout", blockingTimeout);
if (idleTimeout != null) response.setRenderParameter("idleTimeout", idleTimeout);
if (abstractName != null) response.setRenderParameter("abstractName", abstractName);
if (adapterDisplayName != null) response.setRenderParameter("adapterDisplayName", adapterDisplayName);
if (adapterDescription != null) response.setRenderParameter("adapterDescription", adapterDescription);
if (importSource != null) response.setRenderParameter("importSource", importSource);
if (rarPath != null) response.setRenderParameter("rarPath", rarPath);
if (transactionType != null) response.setRenderParameter("transactionType", transactionType);
for (Map.Entry< String, Object > entry : urlProperties.entrySet()) {
if (entry.getValue() != null) {
response.setRenderParameter(entry.getKey(), entry.getValue().toString());
}
}
for (Map.Entry< String, String > entry : properties.entrySet()) {
if (entry.getValue() != null) {
response.setRenderParameter(entry.getKey(), entry.getValue());
}
}
if (deployError != null) response.setRenderParameter("deployError", deployError);
}
|