Package com.adito.properties.impl.systemconfig

Examples of com.adito.properties.impl.systemconfig.SystemConfigKey


            protocol = (String) sequence.getAttribute(ATTR_WEB_SERVER_PROTOCOL, Property.getProperty(new ContextKey(
                            "webServer.protocol")));
            listeningInterfaces = (String) sequence.getAttribute(ATTR_LISTENING_INTERFACES, Property.getProperty(new ContextKey(
                            "webServer.bindAddress")));
            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


            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(
            WebServerForm.ATTR_INVALID_HOSTNAME_ACTION, "none"), seq.getSession());
        return new WizardActionStatus(WizardActionStatus.COMPLETED_OK, "installation.install.status.webServerConfigured");
    }
View Full Code Here

  }

  private boolean handleReplacementProxy(RequestHandlerRequest request, RequestHandlerResponse response,
                      LaunchSession launchSession) throws Exception {

    int maxAge = Property.getPropertyInt(new SystemConfigKey("webForwards.cache.maxUserAge")) * 1000 * 60;
    User user = launchSession.getSession().getUser();
    ContentCache cache = getCache(launchSession.getSession(), user);
    CookieMap cookieMap = getCookieMap(launchSession);

    final RequestProcessor requestProcessor = new RequestProcessor(cache, maxAge, request, launchSession);
View Full Code Here

  private ContentCache getCache(SessionInfo session, User user) throws Exception {

    ContentCache cache = (ContentCache) session.getHttpSession().getAttribute(Constants.ATTR_CACHE);
    if (cache == null) {
      int maxObjs = Property.getPropertyInt(new SystemConfigKey("webForwards.cache.maxUserObjects"));
      if (maxObjs != 0) {
        String dir = CoreUtil.replaceAllTokens(Property.getProperty(new SystemConfigKey("webForwards.cache.directory")),
          "%TMP%",
          ContextHolder.getContext().getTempDirectory().getAbsolutePath());
        File cacheDir = new File(dir);
        if (!cacheDir.exists()) {
          if (!cacheDir.mkdirs()) {
            throw new Exception("Could not create cache directory " + cacheDir.getAbsolutePath() + ".");
          }
        }
        cache = new ContentCache(user,
                cacheDir,
                Property.getPropertyInt(new SystemConfigKey("webForwards.cache.maxUserSize")),
                maxObjs);
        session.getHttpSession().setAttribute(Constants.ATTR_CACHE, cache);
      }
    }
    return cache;
View Full Code Here

    /* BPS - Can only do this if the users key is currently loaded */

    Properties confidentialAttributes = new Properties();
    UserAttributes userAttributes = (UserAttributes) PropertyClassManager.getInstance().getPropertyClass(UserAttributes.NAME);
    if ("automatic".equals(Property.getProperty(new SystemConfigKey("security.privateKeyMode")))
            && PublicKeyStore.getInstance().hasLoadedKey(user.getPrincipalName())) {
      for (PropertyDefinition def : userAttributes.getDefinitions()) {
        AttributeDefinition attrDef = (AttributeDefinition) def;
        if (attrDef.getVisibility() == AttributeDefinition.USER_CONFIDENTIAL_ATTRIBUTE) {
          String val = attrDef.getPropertyClass()
          .retrieveProperty(new UserAttributeKey(user, def.getName()));
          if(val == null) {
            val = def.getDefaultValue();
          }
          confidentialAttributes.setProperty(def.getName(), val);
        }
      }
    }

    try {

      char[] creds = LogonControllerFactory.getInstance()
              .getPasswordFromCredentials((AuthenticationScheme) request.getSession()
                      .getAttribute(Constants.AUTH_SESSION));

      if (creds == null) {
                HttpSession httpSession = getSessionInfo(request).getHttpSession();
                httpSession.setAttribute("newUser", user);
                // as the form will be reset, we need to store the current values to be used later
                httpSession.setAttribute(SetPasswordForm.SAVED_PASSWORD, setPasswordForm.getConfirmPassword());
                httpSession.setAttribute(SetPasswordForm.SAVED_FORCE_PASSWORD_CHANGE, setPasswordForm.getForceChangePasswordAtLogon());
                String forwardTo = Util.urlEncode(CoreUtil.addParameterToPath(request.getServletPath(), "action", "commit"));
                return new ActionForward("/promptForSessionPassword.do?forwardTo=" + forwardTo, false);
      }

      udb.setPassword(user.getPrincipalName(),
        setPasswordForm.getNewPassword(),
        setPasswordForm.getForceChangePasswordAtLogon(),
        LogonControllerFactory.getInstance().getUser(request),
        new String(creds));

      /* Only attempt to re-encrypt user attributes if users key is loaded */
      if ("automatic".equals(Property.getProperty(new SystemConfigKey("security.privateKeyMode")))) {
        if(PublicKeyStore.getInstance().hasLoadedKey(user.getPrincipalName())) {
          PublicKeyStore.getInstance().removeKeys(user.getPrincipalName());
          PublicKeyStore.getInstance().verifyPrivateKey(user.getPrincipalName(), setPasswordForm.getNewPassword().toCharArray());
          for(Iterator i = confidentialAttributes.keySet().iterator(); i.hasNext(); ) {
            String n = (String)i.next();
View Full Code Here

     * (non-Javadoc)
     *
     * @see javax.servlet.http.HttpSessionBindingListener#valueUnbound(javax.servlet.http.HttpSessionBindingEvent)
     */
    public void valueUnbound(HttpSessionBindingEvent arg0) {
        if (Property.getPropertyBoolean(new SystemConfigKey("webForwards.cache.clearOnLogout"))) {
            return;
        }

        if (LOG.isInfoEnabled()) {
            LOG.info("Clearing content cache for " + user.getPrincipalName());
View Full Code Here

      // Get the URL to redirect to
      if (wf.getActiveDNS()) {
        URL u = new URL(url);
        URL adu;
        if (Property.getPropertyInt(new SystemConfigKey("webforward.activeDNSFormat")) == 1) {
          adu = new URL("https", launchSession.getId() + "." + hostService.getHost(), hostService.getPort() == 0 ? -1
            : hostService.getPort(), u.getFile());
        } else {
          int idx = hostService.getHost().indexOf('.');
          adu = new URL("https",
View Full Code Here

            // Change the password

            udb.changePassword(user.getPrincipalName(), f.getOldPassword(), f.getNewPassword(), false);
           
            PublicKeyStore publicKeyStore = PublicKeyStore.getInstance();
            if ("automatic".equals(Property.getProperty(new SystemConfigKey("security.privateKeyMode")))) { 
                if (publicKeyStore.isPassphraseValid(user.getPrincipalName(), f.getOldPassword())) {
                    publicKeyStore.changePrivateKeyPassphrase(user.getPrincipalName(), f.getOldPassword(), f.getNewPassword());
                    publicKeyStore.removeCachedKeys(user.getPrincipalName());
                    publicKeyStore.verifyPrivateKey(user.getPrincipalName(), f.getNewPassword().toCharArray());
View Full Code Here

            setIfNotEmpty("jcifs.netbios.retryTimeout");
            setIfNotEmpty("jcifs.resolveOrder");
            setIfNotEmpty("jcifs.smb.client.responseTimeout");
            setIfNotEmpty("jcifs.smb.client.soTimeout");

            String guestUser = Property.getProperty(new SystemConfigKey("cifs.guestUser")).replace('\\', ';').replace('/', ';');
            String guestPassword = Property.getProperty(new SystemConfigKey("cifs.guestPassword"));
            if(!guestUser.equals("")) {
                Config.setProperty("cifs.guestUser", guestUser);               
            }
            if(!guestPassword.equals("")) {
                Config.setProperty("cifs.guestUser", guestPassword);               
View Full Code Here

    /**
     * @param name
     */
    static void setIfNotEmpty(String name) {
        String val =Property.getProperty(new SystemConfigKey(name)).trim();
        if (!val.equals("")) {
            Config.setProperty(name, val);
        }

    }
View Full Code Here

TOP

Related Classes of com.adito.properties.impl.systemconfig.SystemConfigKey

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.