Package com.adito.properties.impl.realms

Examples of com.adito.properties.impl.realms.RealmKey


     *
     * @see com.adito.wizard.forms.AbstractWizardForm#init(com.adito.wizard.AbstractWizardSequence)
     */
    public void init(AbstractWizardSequence sequence, HttpServletRequest request) throws Exception {
        userDatabase = (String)sequence.getAttribute(ATTR_USER_DATABASE,
          Property.getProperty(new RealmKey("security.userDatabase", UserDatabaseManager.getInstance().getDefaultRealm())));
        oldUserDatabase = userDatabase;
    }
View Full Code Here


        /* The properties have to be persisted now so the
         * user database uses the next settings.
         */
        PropertyItem[] items = getPropertyItems();
        for(int i = 0 ; i < items.length; i++) {
          Property.setProperty(new RealmKey(items[i].getDefinition().getName(), realm), items[i].getPropertyValue().toString(), null);           
        }
       
        // Now try and open the database to make sure the configuration is correct
        if(currentUdb.isOpen()) {
          currentUdb.close();
View Full Code Here

            // we need to disassociate all users and roles from the system.
            PolicyDatabaseFactory.getInstance().revokeAllPoliciesFromPrincipals(r);
            // close the old database.
            defaultUserDatabase.close();
        }
        Property.setProperty(new RealmKey("security.userDatabase", r), newDatabase, seq.getSession());
        return new WizardActionStatus(WizardActionStatus.COMPLETED_OK, "installation.install.status.userDatabaseConfigured");
    }
View Full Code Here

                    user = udb.getAccount(superUser);
                    resetUser(request, user);
                }
            }

            Property.setProperty(new RealmKey("security.administrators", user.getRealm().getResourceId()), superUser, seq
                            .getSession());

            /*
             * Set the super user password
             */
 
View Full Code Here

    /* (non-Javadoc)
     * @see com.adito.wizard.actions.AbstractWizardPropertiesAction#createKey(com.adito.boot.PropertyDefinition, com.adito.properties.forms.PropertiesForm)
     */
    public AbstractPropertyKey createKey(PropertyDefinition definition, PropertiesForm propertiesForm) throws Exception {
        return new RealmKey(definition.getName(), UserDatabaseManager.getInstance().getDefaultRealm());
    }
View Full Code Here

        return Property.getPropertyList(getRealmKey(key, propertyNames));
    }
   
    private RealmKey getRealmKey(String key, Properties propertyNames) {
        String propertyOrDefault = propertyNames.getProperty(key, key);
        return new RealmKey(propertyOrDefault, realm);
    }
View Full Code Here

    }
    request.getSession().removeAttribute("setPassword.user");
    ActionMessages messages = new ActionMessages();
    messages.add(Globals.MESSAGE_KEY,
      new ActionMessage("setPassword.message.passwordPolicy",
              Property.getProperty(new RealmKey("security.password.pattern.description", user.getRealm()
                      .getResourceId()))));
    saveMessages(request, messages);
    CoreUtil.addRequiredFieldMessage(this, request);
    return mapping.findForward("display");
  }
View Full Code Here

    private static void createSuperUser() throws Exception {
        UserDatabase userDatabase = getUserService().createUserDatabase(DATABASE_TYPE, UserDatabaseManager.DEFAULT_REALM_NAME, UserDatabaseManager.DEFAULT_REALM_DESCRIPTION, true);
        User user = userDatabase.createAccount(USERNAME, "", "", "", new Role[] {});
        userDatabase.changePassword(user.getPrincipalName(), "", PASSWORD, false);

        Property.setProperty(new RealmKey("security.userDatabase", userDatabase.getRealm()), DATABASE_TYPE, getSessionInfo());
        Property.setProperty(new RealmKey("security.administrators", userDatabase.getRealm()), USERNAME, getSessionInfo());
    }
View Full Code Here

    private User createSuperUser() throws Exception {
        UserDatabase userDatabase = getUserService().createUserDatabase(DATABASE_TYPE, UserDatabaseManager.DEFAULT_REALM_NAME, UserDatabaseManager.DEFAULT_REALM_DESCRIPTION, true);
        User user = userDatabase.createAccount(USERNAME, "", "", "", new Role[] {});
        userDatabase.changePassword(user.getPrincipalName(), "", PASSWORD, false);
        Property.setProperty(new RealmKey("security.userDatabase", userDatabase.getRealm()), DATABASE_TYPE, getSessionInfo());
        Property.setProperty(new RealmKey("security.administrators", userDatabase.getRealm()), USERNAME, getSessionInfo());
        return user;
    }
View Full Code Here

                Constants.PASSWORD_CHANGE_REASON_MESSAGE));
        }
        try {
            messages.add(Globals.MESSAGE_KEY, new ActionMessage("changePassword.message.passwordPolicy",
              Property
                            .getProperty(new RealmKey("security.password.pattern.description", getSessionInfo(request).getUser()
                                            .getRealm().getResourceId()))));
        } catch (Exception e) {
            log.error("Failed to get password policy text.", e);
        }
        f.setReferer(getReferer(request));
View Full Code Here

TOP

Related Classes of com.adito.properties.impl.realms.RealmKey

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.