Package com.adito.boot

Examples of com.adito.boot.PropertyList


            log.info("Configuring outgoing web connections to use a HTTP proxy server.");
            System.setProperty("http.proxyHost", (String)sequence.getAttribute(ConfigureProxiesForm.ATTR_HTTP_PROXY_HOSTNAME, ""));
            System.setProperty("com.maverick.ssl.https.HTTPProxyHostname", (String)sequence.getAttribute(ConfigureProxiesForm.ATTR_HTTP_PROXY_HOSTNAME, ""));
            System.setProperty("http.proxyPort", (String)sequence.getAttribute(ConfigureProxiesForm.ATTR_HTTP_PROXY_PORT, "3128"));
            System.setProperty("com.maverick.ssl.https.HTTPProxyPort", (String)sequence.getAttribute(ConfigureProxiesForm.ATTR_HTTP_PROXY_PORT, "3128"));
            PropertyList list =(PropertyList)sequence.getAttribute(ConfigureProxiesForm.ATTR_HTTP_NON_PROXY_HOSTS, null);           
            StringBuffer hosts = new StringBuffer();
            for (Iterator i = list.iterator(); i.hasNext();) {
                if (hosts.length() != 0) {
                    hosts.append("|");
                }
                hosts.append(i.next());
            }
View Full Code Here


            String validExternalHostnamesAsTextFieldText = (String) sequence.getAttribute(ATTR_VALID_EXTERNAL_HOSTS, Property
                            .getProperty(new SystemConfigKey("webServer.validExternalHostnames")));
            validExternalHostnames.setAsPropertyText(validExternalHostnamesAsTextFieldText);
            invalidHostnameAction = (String) sequence.getAttribute(ATTR_INVALID_HOSTNAME_ACTION, Property
                            .getProperty(new SystemConfigKey("webServer.invalidHostnameAction")));
            PropertyList pl = PropertyList.createFromTextFieldText(listeningInterfaces);
            SessionInfo session = LogonControllerFactory.getInstance().getSessionInfo(request);
            model = new MultiSelectSelectionModel(session, new InterfacesMultiSelectListDataSource(), pl);
        } catch (Exception e) {
            log.error("Failed to initialise form.");
        }
View Full Code Here

            if (!isPortValid(port)) {
                errs.add(Globals.ERROR_KEY, new ActionMessage("installation.webServer.error.invalidPortNumber", getPort()));
                return;
            }

            PropertyList listeningInterfaces = PropertyList.createFromTextFieldText(getListeningInterfaces().equals("") ? "0.0.0.0"
                            : getListeningInterfaces());
            boolean containsRootAddress = false;
            for (String address : listeningInterfaces) {

                if (!isHostAndPortValid(address, port)) {
                    if (port < 1024) {
                        errs.add(Globals.ERROR_KEY, new ActionMessage("installation.webServer.error.portConflictLess1024",
                                        getPort(), address));
                    } else {
                        errs.add(Globals.ERROR_KEY, new ActionMessage("installation.webServer.error.portConflict", getPort(),
                                        address));
                    }
                }

                if (address.equals("0.0.0.0")) {
                    containsRootAddress = true;
                }
            }

            if (containsRootAddress && listeningInterfaces.size() > 1) {
                errs.add(Globals.ERROR_KEY, new ActionMessage("installation.webServer.invalidSelectedInterfaces"));
            }
        } catch (NumberFormatException nfe) {
            errs.add(Globals.ERROR_KEY, new ActionMessage("installation.webServer.error.invalidPortNumber", getPort()));
        }
View Full Code Here

            }
        }
    }

    private void validateExternalHostnames(ActionErrors errs) {
        PropertyList listeningInterfaces = PropertyList.createFromTextFieldText(getValidExternalHostnames());
        for (String address : listeningInterfaces) {
            if (!isValidIpAddress(address)) {
                errs.add(Globals.ERROR_KEY, new ActionMessage("installation.webServer.error.invalidExeternalHostname", address));
            }
        }
View Full Code Here

        int type = ((Integer) seq.getAttribute(WebForwardTypeSelectionForm.ATTR_TYPE, new Integer(0))).intValue();
        String category = (String) seq.getAttribute(WebForwardSpecificDetailsForm.ATTR_CATEGORY, null);
        String destinationURL = (String) seq.getAttribute(WebForwardSpecificDetailsForm.ATTR_DESTINATION_URL, null);

        PropertyList restrictToHosts = ((PropertyList) seq.getAttribute(WebForwardSpecificDetailsForm.ATTR_RESTRICT_TO_HOSTS, null));
        String encodeing = (String) seq.getAttribute(WebForwardSpecificDetailsForm.ATTR_ENCODEING, "");

        String authenticationUsername = (String) seq.getAttribute(WebForwardAuthenticationDetailsForm.ATTR_AUTHENTICATION_USERNAME,
            null);
        String authenticationPassword = (String) seq.getAttribute(WebForwardAuthenticationDetailsForm.ATTR_AUTHENTICATION_PASSWORD,
View Full Code Here

    WizardActionStatus webServer(AbstractWizardSequence seq) {
        Property.setProperty(new ContextKey("webServer.port"),
            (String) seq.getAttribute(WebServerForm.ATTR_WEB_SERVER_PORT, "443"), seq.getSession());
        Property.setProperty(new ContextKey("webServer.protocol"), (String) seq.getAttribute(
            WebServerForm.ATTR_WEB_SERVER_PROTOCOL, "https"), seq.getSession());
        PropertyList l = PropertyList.createFromTextFieldText((String) seq
                        .getAttribute(WebServerForm.ATTR_LISTENING_INTERFACES, ""));
        Property.setProperty(new ContextKey("webServer.bindAddress"), l, seq.getSession());
        l = PropertyList.createFromTextFieldText((String) seq.getAttribute(WebServerForm.ATTR_VALID_EXTERNAL_HOSTS, ""));
        Property.setProperty(new SystemConfigKey("webServer.validExternalHostnames"), l, seq.getSession());
        Property.setProperty(new SystemConfigKey("webServer.invalidHostnameAction"), (String) seq.getAttribute(
View Full Code Here

     *
     * @see com.adito.wizard.forms.AbstractWizardForm#init(com.adito.wizard.AbstractWizardSequence)
     */
    public void init(AbstractWizardSequence sequence, HttpServletRequest request) throws Exception {
        resourceName = (String) sequence.getAttribute(WebForwardSpecificDetailsForm.ATTR_RESOURCE_NAME, null);
        PropertyList l = (PropertyList) sequence.getAttribute(WebForwardPolicySelectionForm.ATTR_SELECTED_POLICIES, null);
        selectedPolicies = new ArrayList<String>();
        if (SessionInfo.USER_CONSOLE_CONTEXT == LogonControllerFactory.getInstance().getSessionInfo(request).getNavigationContext()) {
            for(Iterator i = l.iterator(); i.hasNext(); ) {
                selectedPolicies.add(i.next().toString());
            }
        } else {
            for(Iterator i = l.iterator(); i.hasNext(); ) {
                selectedPolicies.add(PolicyDatabaseFactory.getInstance().getPolicy(Integer.parseInt(i.next().toString())).getResourceName());
            }
        }
        user = (User) sequence.getAttribute(WebForwardSpecificDetailsAction.ATTR_USER, null);
    }
View Full Code Here

     * @see com.adito.wizard.forms.AbstractWizardForm#init(com.adito.wizard.AbstractWizardSequence,
     *      javax.servlet.http.HttpServletRequest)
     */
    public void init(AbstractWizardSequence sequence, HttpServletRequest request) throws Exception {
        super.init(sequence, request);
        this.restrictToHosts = (PropertyList)sequence.getAttribute(ATTR_RESTRICT_TO_HOSTS, new PropertyList());
        this.destinationURL = (String) sequence.getAttribute(ATTR_DESTINATION_URL, "");
        this.category = (String) sequence.getAttribute(ATTR_CATEGORY, "General");
        type = ((Integer) sequence.getAttribute(WebForwardTypeSelectionForm.ATTR_TYPE, new Integer(0))).intValue();
        this.encoding = (String) sequence.getAttribute(ATTR_ENCODEING, WebForwardTypes.DEFAULT_ENCODING);

View Full Code Here

    @Test
    public void attachAndDetachResourceFromPolicy() throws Exception {
        Realm realm = getDefaultRealm();
        Policy policy = createPolicy(realm);
        T resource = createResource();
        PropertyList selectedPolicies = PropertyList.createFromArray(new int[] {policy.getResourceId()});
        PolicyDatabaseFactory.getInstance().attachResourceToPolicyList(resource, selectedPolicies, getSessionInfo());
        assertTrue("The resource should be attached to the policy", getPolicyService().isResourceAttachedToPolicy(resource, policy, realm));
        assertTrue("The resource type must match the resource type of the type created.", getResourceType().equals(resource.getResourceType()));
       
        PolicyDatabaseFactory.getInstance().detachResourceFromPolicyList(resource, getSessionInfo());
View Full Code Here

        Realm realm = getDefaultRealm();
        Policy policy = createPolicy(realm);
        AccessRights accessRights = createAllAccessRights(getResourceType().getPermissionClass());
       
        assertFalse("The resource should not be attached", getPolicyService().isResourceAttachedToPolicy(accessRights, policy, realm));
        PropertyList selectedPolicies = PropertyList.createFromArray(new int[] {policy.getResourceId()});
        PolicyDatabaseFactory.getInstance().attachResourceToPolicyList(accessRights, selectedPolicies, getSessionInfo());
        assertTrue("The resource should be attached", getPolicyService().isResourceAttachedToPolicy(accessRights, policy, realm));
        PolicyDatabaseFactory.getInstance().detachResourceFromPolicyList(accessRights, getSessionInfo());
        assertFalse("The resource should not be attached", getPolicyService().isResourceAttachedToPolicy(accessRights, policy, realm));
       
View Full Code Here

TOP

Related Classes of com.adito.boot.PropertyList

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.