* @param displayName If we're editing an existing RA, its name
* @param adapterAbstractName If we're editing an existing RA, its AbstractName
* @return resource adapter parameter data object
*/
public ResourceAdapterParams getRARConfiguration(PortletRequest request, String rarPath, String displayName, String adapterAbstractName) {
PortletSession session = request.getPortletSession(true);
if (rarPath != null && !rarPath.equals("")) {
ResourceAdapterParams results = (ResourceAdapterParams) session.getAttribute(
CONFIG_SESSION_KEY + "-" + rarPath, PortletSession.APPLICATION_SCOPE);
if (results == null) {
results = loadConfigPropertiesByPath(request, rarPath);
session.setAttribute(CONFIG_SESSION_KEY + "-" + rarPath, results, PortletSession.APPLICATION_SCOPE);
session.setAttribute(CONFIG_SESSION_KEY + "-" + results.displayName, results, PortletSession.APPLICATION_SCOPE);
}
return results;
} else if (displayName != null && !displayName.equals(
"") && adapterAbstractName != null && !adapterAbstractName.equals("")) {
ResourceAdapterParams results = (ResourceAdapterParams) session.getAttribute(
CONFIG_SESSION_KEY + "-" + displayName, PortletSession.APPLICATION_SCOPE);
if (results == null) {
results = loadConfigPropertiesByAbstractName(request, rarPathMap.get(displayName), adapterAbstractName);
session.setAttribute(CONFIG_SESSION_KEY + "-" + displayName, results, PortletSession.APPLICATION_SCOPE);
}
return results;
} else {
throw new IllegalArgumentException();
}