Package org.apache.geronimo.management.geronimo

Examples of org.apache.geronimo.management.geronimo.KeystoreManager


        // provide the three possible values for secure algorithm - Default, SunX509, and IbmX509
        enumValues.put("algorithm", new String[] { "Default", "SunX509", "IbmX509" });
       
        // provide the possible values for the keystore name
        KeystoreManager mgr = PortletManager.getCurrentServer(request).getKeystoreManager();
        KeystoreInstance[] stores = mgr.getUnlockedKeyStores();
        String[] storeNames = new String[stores.length];
        for (int i = 0; i < storeNames.length; i++) {
            storeNames[i] = stores[i].getKeystoreName();
        }
        enumValues.put("keyStore", storeNames);
       
        // provide the possible values for the trust store name
        KeystoreInstance[] trusts = mgr.getUnlockedTrustStores();
        String[] trustNames = new String[trusts.length];
        for (int i = 0; i < trustNames.length; i++) {
            trustNames[i] = trusts[i].getKeystoreName();
        }
        enumValues.put("trustStore", trustNames);
View Full Code Here


        String[] params = {ERROR_MSG, INFO_MSG};
        for(int i = 0; i < params.length; ++i) {
            String value = request.getParameter(params[i]);
            if(value != null) request.setAttribute(params[i], value);
        }
        KeystoreManager manager = PortletManager.getCurrentServer(request).getKeystoreManager();
        KeystoreInstance[] keystores = manager.getKeystores();
        PortletSession session = request.getPortletSession(true);
        KeystoreData[] datas = new KeystoreData[keystores.length];
        Map keys = new HashMap();
        for (int i = 0; i < datas.length; i++) {
            AbstractName aName = PortletManager.getNameFor(request, keystores[i]);
View Full Code Here

        String[] params = {ERROR_MSG, INFO_MSG};
        for(int i = 0; i < params.length; ++i) {
            String value = request.getParameter(params[i]);
            if(value != null) request.setAttribute(params[i], value);
        }
        KeystoreManager manager = PortletManager.getCurrentServer(request).getKeystoreManager();
        KeystoreInstance[] keystores = manager.getKeystores();
        PortletSession session = request.getPortletSession(true);
        KeystoreData[] datas = new KeystoreData[keystores.length];
        Map keys = new HashMap();
        for (int i = 0; i < datas.length; i++) {
            AbstractName aName = PortletManager.getNameFor(request, keystores[i]);
View Full Code Here

                String protocol = renderRequest.getParameter("protocol");
                String containerDisplayName = renderRequest.getParameter("containerDisplayName");
                renderRequest.setAttribute("maxThreads", "50");
                if(server.equals(WEB_SERVER_JETTY)) {
                    renderRequest.setAttribute("minThreads", "10");
                    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(null));
                        } catch (KeystoreException e) {}
                    }
                    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("protocol", protocol);
                renderRequest.setAttribute("mode", "add");
                renderRequest.setAttribute("containerDisplayName", containerDisplayName);
                if(protocol.equals(WebManager.PROTOCOL_HTTPS)) {
                    editHttpsView.include(renderRequest, renderResponse);
                } else {
                    editHttpView.include(renderRequest, renderResponse);
                }

            } else if(mode.equals("edit")) {
                String connectorURI = renderRequest.getParameter("connectorURI");
                WebConnector connector = PortletManager.getWebConnector(renderRequest, new AbstractName(URI.create(connectorURI)));
                if(connector == null) {
                    doList(renderRequest, renderResponse);
                } else {
                  String displayName = new AbstractName(URI.create(connectorURI)).getName().get("name").toString();
                    renderRequest.setAttribute("displayName", displayName);
                    renderRequest.setAttribute("connectorURI", connectorURI);
                    renderRequest.setAttribute("port", new Integer(connector.getPort()));
                    renderRequest.setAttribute("host", connector.getHost());
                    int maxThreads = connector.getMaxThreads();
                    renderRequest.setAttribute("maxThreads", Integer.toString(maxThreads));
                    if(server.equals(WEB_SERVER_JETTY)) {
                        int minThreads = ((Number)getProperty(connector, "minThreads")).intValue();
                        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);
View Full Code Here

    public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
        return getMode();
    }

    public void renderView(RenderRequest request, RenderResponse response, MultiPageModel model) throws PortletException, IOException {
        KeystoreManager manager = PortletManager.getCurrentServer(request).getKeystoreManager();
        KeystoreInstance[] keystores = manager.getKeystores();
        PortletSession session = request.getPortletSession(true);
        KeystoreData[] datas = new KeystoreData[keystores.length];
        Map keys = new HashMap();
        for (int i = 0; i < datas.length; i++) {
            AbstractName aName = PortletManager.getNameFor(request, keystores[i]);
View Full Code Here

                String protocol = renderRequest.getParameter("protocol");
                String containerDisplayName = renderRequest.getParameter("containerDisplayName");
                renderRequest.setAttribute("maxThreads", "50");
                if(server.equals(WEB_SERVER_JETTY)) {
                    renderRequest.setAttribute("minThreads", "10");
                    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("protocol", protocol);
                renderRequest.setAttribute("mode", "add");
                renderRequest.setAttribute("containerDisplayName", containerDisplayName);
                if(protocol.equals(WebManager.PROTOCOL_HTTPS)) {
                    editHttpsView.include(renderRequest, renderResponse);
                } else {
                    editHttpView.include(renderRequest, renderResponse);
                }

            } else if(mode.equals("edit")) {
                String connectorURI = renderRequest.getParameter("connectorURI");
                WebConnector connector = PortletManager.getWebConnector(renderRequest, new AbstractName(URI.create(connectorURI)));
                if(connector == null) {
                    doList(renderRequest, renderResponse);
                } else {
                  String displayName = new AbstractName(URI.create(connectorURI)).getName().get("name").toString();
                    renderRequest.setAttribute("displayName", displayName);
                    renderRequest.setAttribute("connectorURI", connectorURI);
                    renderRequest.setAttribute("port", new Integer(connector.getPort()));
                    renderRequest.setAttribute("host", connector.getHost());
                    int maxThreads = connector.getMaxThreads();
                    renderRequest.setAttribute("maxThreads", Integer.toString(maxThreads));
                    if(server.equals(WEB_SERVER_JETTY)) {
                        int minThreads = ((Number)getProperty(connector, "minThreads")).intValue();
                        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);
View Full Code Here

        // provide the three possible values for secure algorithm - Default, SunX509, and IbmX509
        enumValues.put("algorithm", new String[] { "Default", "SunX509", "IbmX509" });
       
        // provide the possible values for the keystore name
        KeystoreManager mgr = PortletManager.getCurrentServer(request).getKeystoreManager();
        KeystoreInstance[] stores = mgr.getUnlockedKeyStores();
        String[] storeNames = new String[stores.length];
        for (int i = 0; i < storeNames.length; i++) {
            storeNames[i] = stores[i].getKeystoreName();
        }
        enumValues.put("keyStore", storeNames);
       
        // provide the possible values for the trust store name
        KeystoreInstance[] trusts = mgr.getUnlockedTrustStores();
        String[] trustNames = new String[trusts.length];
        for (int i = 0; i < trustNames.length; i++) {
            trustNames[i] = trusts[i].getKeystoreName();
        }
        enumValues.put("trustStore", trustNames);
View Full Code Here

            if(mode.equals("new")) {
                String protocol = renderRequest.getParameter("protocol");
                String containerDisplayName = renderRequest.getParameter("containerDisplayName");
                renderRequest.setAttribute("maxThreads", "50");
                if(server.equals(WEB_SERVER_JETTY)) {
                    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(null));
                        } catch (KeystoreException e) {}
                    }
                    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("protocol", protocol);
                renderRequest.setAttribute("mode", "add");
                renderRequest.setAttribute("containerDisplayName", containerDisplayName);
                if(protocol.equals(WebManager.PROTOCOL_HTTPS)) {
                    editHttpsView.include(renderRequest, renderResponse);
                } else {
                    editHttpView.include(renderRequest, renderResponse);
                }

            } else if(mode.equals("edit")) {
                String connectorURI = renderRequest.getParameter("connectorURI");
                WebConnector connector = PortletManager.getWebConnector(renderRequest, new AbstractName(URI.create(connectorURI)));
                if(connector == null) {
                    doList(renderRequest, renderResponse);
                } else {
                  String displayName = new AbstractName(URI.create(connectorURI)).getName().get("name").toString();
                    renderRequest.setAttribute("displayName", displayName);
                    renderRequest.setAttribute("connectorURI", connectorURI);
                    renderRequest.setAttribute("port", new Integer(connector.getPort()));
                    renderRequest.setAttribute("host", connector.getHost());
                    int maxThreads = connector.getMaxThreads();
                    renderRequest.setAttribute("maxThreads", Integer.toString(maxThreads));
                    if(server.equals(WEB_SERVER_JETTY)) {
                        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);
View Full Code Here

    public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
        return getMode();
    }

    public void renderView(RenderRequest request, RenderResponse response, MultiPageModel model) throws PortletException, IOException {
        KeystoreManager manager = PortletManager.getCurrentServer(request).getKeystoreManager();
        KeystoreInstance[] keystores = manager.getKeystores();
        PortletSession session = request.getPortletSession(true);
        KeystoreData[] datas = new KeystoreData[keystores.length];
        Map keys = new HashMap();
        for (int i = 0; i < datas.length; i++) {
            AbstractName aName = PortletManager.getNameFor(request, keystores[i]);
View Full Code Here

        // provide the three possible values for secure algorithm - Default, SunX509, and IbmX509
        enumValues.put("algorithm", new String[] { "Default", "SunX509", "IbmX509" });
       
        // provide the possible values for the keystore name
        KeystoreManager mgr = PortletManager.getCurrentServer(request).getKeystoreManager();
        KeystoreInstance[] stores = mgr.getUnlockedKeyStores();
        String[] storeNames = new String[stores.length];
        for (int i = 0; i < storeNames.length; i++) {
            storeNames[i] = stores[i].getKeystoreName();
        }
        enumValues.put("keyStore", storeNames);
       
        // provide the possible values for the trust store name
        KeystoreInstance[] trusts = mgr.getUnlockedTrustStores();
        String[] trustNames = new String[trusts.length];
        for (int i = 0; i < trustNames.length; i++) {
            trustNames[i] = trusts[i].getKeystoreName();
        }
        enumValues.put("trustStore", trustNames);
View Full Code Here

TOP

Related Classes of org.apache.geronimo.management.geronimo.KeystoreManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.