Parent Project
Project Documentation
CPD ResultsThe following document contains the results of PMD's CPD DuplicationsFile | Line |
---|
org/apache/geronimo/console/car/DownloadCARHandler.java | 48 | org/apache/geronimo/console/car/ViewPluginDownloadHandler.java | 44 | super(VIEW_FOR_DOWNLOAD_MODE, "/WEB-INF/view/car/viewForDownload.jsp");
}
public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
String configId = request.getParameter("configId");
String repo = request.getParameter("repository");
String user = request.getParameter("repo-user");
String pass = request.getParameter("repo-pass");
response.setRenderParameter("configId", configId);
response.setRenderParameter("repository", repo);
if(!isEmpty(user)) response.setRenderParameter("repo-user", user);
if(!isEmpty(pass)) response.setRenderParameter("repo-pass", pass);
return getMode();
}
public void renderView(RenderRequest request, RenderResponse response, MultiPageModel model) throws PortletException, IOException {
String configId = request.getParameter("configId");
String repo = request.getParameter("repository");
String user = request.getParameter("repo-user");
String pass = request.getParameter("repo-pass");
PluginMetadata config = null;
try {
PluginList list = (PluginList) request.getPortletSession(true).getAttribute(CONFIG_LIST_SESSION_KEY);
if(list == null) {
list = PortletManager.getCurrentServer(request).getPluginInstaller().listPlugins(new URL(repo), user, pass);
request.getPortletSession(true).setAttribute(CONFIG_LIST_SESSION_KEY, list);
}
for (int i = 0; i < list.getPlugins().length; i++) {
PluginMetadata metadata = list.getPlugins()[i];
if(metadata.getModuleId().toString().equals(configId)) {
config = metadata;
break;
}
}
} catch (FailedLoginException e) {
throw new PortletException("Invalid login for Maven repository '"+repo+"'", e);
}
if(config == null) {
throw new PortletException("No configuration found for '"+configId+"'");
}
request.setAttribute("configId", configId);
request.setAttribute("plugin", config); | File | Line |
---|
org/apache/geronimo/console/jmsmanager/wizard/ListScreenHandler.java | 83 | org/apache/geronimo/console/jmsmanager/wizard/ListScreenHandler.java | 123 | for (int i = 0; i < modules.length; i++) {
ResourceAdapterModule module = modules[i];
JMSResourceSummary target = null;
for (int j = 0; j < resources.size(); j++) {
JMSResourceSummary data = (JMSResourceSummary) resources.get(j);
if (data.adapterObjectName.equals(module.getObjectName())) {
target = data;
break;
}
}
if (target == null) {
ResourceAdapter[] adapters = PortletManager.getResourceAdapters(renderRequest, module);
String name = null;
if (adapters.length == 1 && adapters[0].getJCAResources().length == 1) {
JCAResource[] resource = PortletManager.getJCAResources(renderRequest, adapters[0]);
if (resource.length == 1 && resource[0].getResourceAdapterInstances().length == 1) {
name = ObjectName.getInstance(resource[0].getResourceAdapterInstanceNames()[0]).getKeyProperty(NameFactory.J2EE_NAME);
}
}
if (name == null) {
name = ObjectName.getInstance(module.getObjectName()).getKeyProperty(NameFactory.J2EE_NAME);
}
target = new JMSResourceSummary(PortletManager.getConfigurationFor(renderRequest, PortletManager.getNameFor(renderRequest, module)).toString(),
module.getObjectName(), name, ((GeronimoManagedBean) module).getState());
resources.add(target);
} | File | Line |
---|
org/apache/geronimo/console/webmanager/ConnectorPortlet.java | 315 | org/apache/geronimo/console/webmanager/ConnectorPortlet.java | 367 | renderRequest.setAttribute("minThreads", String.valueOf(minThreads));
KeystoreManager mgr = PortletManager.getCurrentServer(renderRequest).getKeystoreManager();
KeystoreInstance[] stores = mgr.getUnlockedKeyStores();
String[] storeNames = new String[stores.length];
for (int i = 0; i < storeNames.length; i++) {
storeNames[i] = stores[i].getKeystoreName();
}
renderRequest.setAttribute("keyStores", storeNames);
KeystoreInstance[] trusts = mgr.getUnlockedTrustStores();
String[] trustNames = new String[trusts.length];
for (int i = 0; i < trustNames.length; i++) {
trustNames[i] = trusts[i].getKeystoreName();
}
renderRequest.setAttribute("trustStores", trustNames);
Map aliases = new HashMap();
for (int i = 0; i < stores.length; i++) {
try {
aliases.put(stores[i].getKeystoreName(), stores[i].getUnlockedKeys());
} catch (KeystoreIsLocked locked) {}
}
renderRequest.setAttribute("unlockedKeys", aliases);
}
else if (server.equals(WEB_SERVER_TOMCAT)) {
//todo: Any Tomcat specific processing?
}
else {
//todo: Handle "should not occur" condition
}
renderRequest.setAttribute("mode", "save"); | File | Line |
---|
org/apache/geronimo/console/webmanager/ConnectorPortlet.java | 121 | org/apache/geronimo/console/webmanager/ConnectorPortlet.java | 203 | if(connector instanceof SecureConnector) {
String keystoreType = actionRequest.getParameter("keystoreType");
String keystoreFile = actionRequest.getParameter("keystoreFile");
String privateKeyPass = actionRequest.getParameter("privateKeyPassword");
String keystorePass = actionRequest.getParameter("keystorePassword");
String secureProtocol = actionRequest.getParameter("secureProtocol");
String algorithm = actionRequest.getParameter("algorithm");
String truststoreType = actionRequest.getParameter("truststoreType");
String truststoreFile = actionRequest.getParameter("truststoreFile");
String truststorePass = actionRequest.getParameter("truststorePassword");
boolean clientAuth = isValid(actionRequest.getParameter("clientAuth"));
SecureConnector secure = (SecureConnector) connector;
if(isValid(keystoreType)) {secure.setKeystoreType(keystoreType);}
if(isValid(keystoreFile)) {secure.setKeystoreFileName(keystoreFile);}
if(isValid(keystorePass)) {secure.setKeystorePassword(keystorePass);}
if(isValid(secureProtocol)) {secure.setSecureProtocol(secureProtocol);}
if(isValid(algorithm)) {secure.setAlgorithm(algorithm);}
secure.setClientAuthRequired(clientAuth);
if(server.equals(WEB_SERVER_JETTY)) {
if(isValid(privateKeyPass)) {setProperty(secure, "keyPassword", privateKeyPass);} | File | Line |
---|
org/apache/geronimo/console/certmanager/actions/GenerateKeyPair.java | 100 | org/apache/geronimo/console/certmanager/actions/ViewKeyStore.java | 48 | try {
AbstractName name = portlet.getKeyStoreObjectName();
String keyStoreType = (String) KernelRegistry.getSingleKernel()
.getAttribute(name, "keyStoreType");
String keyStoreProvider = (String) KernelRegistry.getSingleKernel()
.getAttribute(name, "keyStoreProvider");
String keyStoreLocation = (String) KernelRegistry.getSingleKernel()
.getAttribute(name, "keyStoreLocation");
request.setAttribute("org.apache.geronimo.console.keystore.type", keyStoreType);
request.setAttribute("org.apache.geronimo.console.keystore.provider",
keyStoreProvider);
request.setAttribute("org.apache.geronimo.console.keystore.location",
keyStoreLocation);
List storelist = (List) KernelRegistry.getSingleKernel().invoke(
name, "getKeyStoreEntries");
Iterator iter = storelist.iterator();
while (iter.hasNext()) {
portlet.getPortletContext().log("store-item = " + iter.next());
}
request.setAttribute("org.apache.geronimo.console.keystore.list", storelist);
request.setAttribute("org.apache.geronimo.console.keystore.size", String
.valueOf(storelist.size()));
} catch (Exception e) {
throw new PortletException(e);
}
rd = portlet.getPortletContext().getRequestDispatcher(
"/WEB-INF/view/certmanager/viewKeyStoreNormal.jsp"); | File | Line |
---|
org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java | 789 | org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java | 626 | }
private void loadDriverJARList(RenderRequest renderRequest) {
// List the available JARs
List list = new ArrayList();
ListableRepository[] repos = PortletManager.getCurrentServer(renderRequest).getRepositories();
for (int i = 0; i < repos.length; i++) {
ListableRepository repo = repos[i];
SortedSet artifacts = repo.list();
outer:
for (Iterator iterator = artifacts.iterator(); iterator.hasNext();) {
Artifact artifact = (Artifact) iterator.next();
String test = artifact.toString();
// todo should only test groupId and should check for long (org.apache.geronimo) and short form
for (int k = 0; k < SKIP_ENTRIES_WITH.length; k++) {
String skip = SKIP_ENTRIES_WITH[k];
if (test.indexOf(skip) > -1) {
continue outer;
}
}
list.add(test);
}
}
Collections.sort(list);
renderRequest.setAttribute("jars", list); | File | Line |
---|
org/apache/geronimo/console/infomanager/ServerInfoPortlet.java | 82 | org/apache/geronimo/console/internaldb/InternalDBPortlet.java | 74 | renderRequest.setAttribute("internalDB", internalDB);
if (WindowState.NORMAL.equals(renderRequest.getWindowState())) {
normalView.include(renderRequest, renderResponse);
} else {
maximizedView.include(renderRequest, renderResponse);
}
}
protected void doHelp(RenderRequest renderRequest,
RenderResponse renderResponse) throws PortletException, IOException {
helpView.include(renderRequest, renderResponse);
}
public void init(PortletConfig portletConfig) throws PortletException {
super.init(portletConfig);
normalView = portletConfig.getPortletContext().getRequestDispatcher(
NORMALVIEW_JSP);
maximizedView = portletConfig.getPortletContext().getRequestDispatcher(
MAXIMIZEDVIEW_JSP);
helpView = portletConfig.getPortletContext().getRequestDispatcher(
HELPVIEW_JSP);
}
public void destroy() {
normalView = null;
maximizedView = null;
helpView = null;
super.destroy();
}
} | File | Line |
---|
org/apache/geronimo/console/infomanager/ServerInfoPortlet.java | 84 | org/apache/geronimo/console/welcome/WelcomePortlet.java | 63 | if (WindowState.NORMAL.equals(renderRequest.getWindowState())) {
normalView.include(renderRequest, renderResponse);
} else {
maximizedView.include(renderRequest, renderResponse);
}
}
protected void doHelp(RenderRequest renderRequest,
RenderResponse renderResponse) throws PortletException, IOException {
helpView.include(renderRequest, renderResponse);
}
public void init(PortletConfig portletConfig) throws PortletException {
super.init(portletConfig);
normalView = portletConfig.getPortletContext().getRequestDispatcher(
NORMALVIEW_JSP);
maximizedView = portletConfig.getPortletContext().getRequestDispatcher(
MAXIMIZEDVIEW_JSP);
helpView = portletConfig.getPortletContext().getRequestDispatcher(
HELPVIEW_JSP);
}
public void destroy() {
normalView = null;
maximizedView = null;
helpView = null;
super.destroy();
}
} | File | Line |
---|
org/apache/geronimo/console/keystores/ConfigureNewKeyHandler.java | 47 | org/apache/geronimo/console/keystores/ConfirmKeyHandler.java | 79 | request.setAttribute("certC", certC);
}
public String actionAfterView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
String keystore = request.getParameter("keystore");
String alias = request.getParameter("alias");
String password = request.getParameter("password");
String keySize = request.getParameter("keySize");
String algorithm = request.getParameter("algorithm");
String valid = request.getParameter("valid");
String certCN = request.getParameter("certCN");
String certOU = request.getParameter("certOU");
String certO = request.getParameter("certO");
String certL = request.getParameter("certL");
String certST = request.getParameter("certST");
String certC = request.getParameter("certC"); | File | Line |
---|
org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java | 876 | org/apache/geronimo/console/jmsmanager/wizard/AbstractHandler.java | 469 | File rarFile = PortletManager.getRepositoryEntry(request, data.getRarURI());
ConnectorDeployable deployable = new ConnectorDeployable(rarFile.toURL());
DeploymentConfiguration config = mgr.createConfiguration(deployable);
final DDBeanRoot ddBeanRoot = deployable.getDDBeanRoot();
Connector15DCBRoot root = (Connector15DCBRoot) config.getDConfigBeanRoot(ddBeanRoot);
ConnectorDCB connector = (ConnectorDCB) root.getDConfigBean(ddBeanRoot.getChildBean(root.getXpaths()[0])[0]);
EnvironmentData environment = new EnvironmentData();
connector.setEnvironment(environment);
org.apache.geronimo.deployment.service.jsr88.Artifact configId = new org.apache.geronimo.deployment.service.jsr88.Artifact();
environment.setConfigId(configId);
configId.setGroupId("console.jms"); | File | Line |
---|
org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java | 964 | org/apache/geronimo/console/jmsmanager/wizard/AbstractHandler.java | 614 | log.debug("Writing JMS Resource deployment plan to "+tempFile.getAbsolutePath());
BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(tempFile));
config.save(out);
out.flush();
out.close();
Target[] targets = mgr.getTargets();
ProgressObject po = mgr.distribute(targets, rarFile, tempFile);
waitForProgress(po);
if(po.getDeploymentStatus().isCompleted()) {
TargetModuleID[] ids = po.getResultTargetModuleIDs();
po = mgr.start(ids);
waitForProgress(po);
if(po.getDeploymentStatus().isCompleted()) {
ids = po.getResultTargetModuleIDs(); | File | Line |
---|
org/apache/geronimo/console/keystores/GenerateCSRHandler.java | 36 | org/apache/geronimo/console/keystores/ImportCAReplyHandler.java | 36 | super(IMPORT_CA_REPLY, "/WEB-INF/view/keystore/importCAReply.jsp");
}
public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
String id = request.getParameter("id");
String alias = request.getParameter("alias");
response.setRenderParameter("id", id);
response.setRenderParameter("alias", alias);
return getMode();
}
public void renderView(RenderRequest request, RenderResponse response, MultiPageModel model) throws PortletException, IOException {
String id = request.getParameter("id");
String alias = request.getParameter("alias");
request.setAttribute("id", id);
request.setAttribute("alias", alias); | File | Line |
---|
org/apache/geronimo/console/keystores/ConfigureNewKeyHandler.java | 51 | org/apache/geronimo/console/keystores/ConfirmKeyHandler.java | 52 | String keystore = request.getParameter("keystore");
String alias = request.getParameter("alias");
String password = request.getParameter("password");
String keySize = request.getParameter("keySize");
String algorithm = request.getParameter("algorithm");
String valid = request.getParameter("valid");
String certCN = request.getParameter("certCN");
String certOU = request.getParameter("certOU");
String certO = request.getParameter("certO");
String certL = request.getParameter("certL");
String certST = request.getParameter("certST");
String certC = request.getParameter("certC"); | File | Line |
---|
org/apache/geronimo/console/infomanager/JavaSystemInfoPortlet.java | 122 | org/apache/geronimo/console/welcome/WelcomePortlet.java | 68 | }
protected void doHelp(RenderRequest renderRequest,
RenderResponse renderResponse) throws PortletException, IOException {
helpView.include(renderRequest, renderResponse);
}
public void init(PortletConfig portletConfig) throws PortletException {
super.init(portletConfig);
normalView = portletConfig.getPortletContext().getRequestDispatcher(
NORMALVIEW_JSP);
maximizedView = portletConfig.getPortletContext().getRequestDispatcher(
MAXIMIZEDVIEW_JSP);
helpView = portletConfig.getPortletContext().getRequestDispatcher(
HELPVIEW_JSP);
}
public void destroy() {
normalView = null;
maximizedView = null;
helpView = null;
super.destroy();
}
} |
|