Package org.glassfish.security.common

Examples of org.glassfish.security.common.FileRealmHelper.persist()


                String[] groups = helper.authenticate(programOpts.getUser(), password.toCharArray());
                if (groups == null) {
                    throw new CommandException(strings.get("InvalidCredentials", programOpts.getUser()));
                }
                helper.updateUser(programOpts.getUser(), programOpts.getUser(), newpassword.toCharArray(), null);
                helper.persist();
                return SUCCESS;

            } else {
                //Cannot change password locally for non file realms
                throw new CommandException(strings.get("NotFileRealmCannotChangeLocally"));
View Full Code Here


                    String npw = super.getPassword(npwo, null, true);
                    if (npw == null) {
                        throw new CommandException(strings.get("no.console"));
                    }
                    ar.updateUser(auser, auser, npw.toCharArray(), null);
                    ar.persist();
                }
            } catch (IOException ioe) {
                throw new CommandException(ioe);
            }
        }
View Full Code Here

        final String keyFilePath = keyFile.getAbsolutePath();
        final FileRealmHelper fileRealm = new FileRealmHelper(keyFilePath);
        final String[] group =
            new String[]{AdminConstants.DOMAIN_ADMIN_GROUP_NAME};
        fileRealm.addUser(user, password.toCharArray(), group);
        fileRealm.persist();
    }

  
    /**
     * Create the default server.policy file.
View Full Code Here

                    String npw = super.getPassword(npwo, null, true);
                    if (npw == null) {
                        throw new CommandException(strings.get("no.console"));
                    }
                    ar.updateUser(auser, auser, npw.toCharArray(), null);
                    ar.persist();
                }
            } catch (IOException ioe) {
                throw new CommandException(ioe);
            }
        }
View Full Code Here

                String[] groups = helper.authenticate(programOpts.getUser(), password.toCharArray());
                if (groups == null) {
                    throw new CommandException(strings.get("InvalidCredentials", programOpts.getUser()));
                }
                helper.updateUser(programOpts.getUser(), programOpts.getUser(), newpassword.toCharArray(), null);
                helper.persist();
                return SUCCESS;

            } else {
                //Cannot change password locally for non file realms
                throw new CommandException(strings.get("NotFileRealmCannotChangeLocally"));
View Full Code Here

        final String keyFilePath = keyFile.getAbsolutePath();
        final FileRealmHelper fileRealm = new FileRealmHelper(keyFilePath);
        final String[] group =
                new String[]{AdminConstants.DOMAIN_ADMIN_GROUP_NAME};
        fileRealm.addUser(user, password.toCharArray(), group);
        fileRealm.persist();
    }

    /**
     * Create the default server.policy file.
     */
 
View Full Code Here

            throws IOException {
        final String keyFilePath = keyFile.getAbsolutePath();
        final FileRealmHelper fileRealm = new FileRealmHelper(keyFilePath);
        final String[] group =   new String[]{AdminConstants.DOMAIN_ADMIN_GROUP_NAME};
        fileRealm.addUser(user, password.toCharArray(), group);
        fileRealm.persist();
    }

    /**
     * Create the password alias keystore (initially empty)
     *
 
View Full Code Here

                    if (groups == null) {
                        throw new CommandException(strings.get("InvalidCredentials", programOpts.getUser()));
                    }
                }
                helper.updateUser(programOpts.getUser(), programOpts.getUser(), ((String) passwords.get(newpwName)).toCharArray(), null);
                helper.persist();
                return SUCCESS;

            } else {
                //Cannot change password locally for non file realms
                throw new CommandException(strings.get("NotFileRealmCannotChangeLocally"));
View Full Code Here

                    String npw = super.getPassword(npwo, null, true);
                    if (npw == null) {
                        throw new CommandException(strings.get("no.console"));
                    }
                    ar.updateUser(auser, auser, npw.toCharArray(), null);
                    ar.persist();
                }
            } catch (IOException ioe) {
                throw new CommandException(ioe);
            }
        }
View Full Code Here

                    String npw = super.getPassword(npwo, null, true);
                    if (npw == null) {
                        throw new CommandException(strings.get("no.console"));
                    }
                    ar.updateUser(auser, auser, npw.toCharArray(), null);
                    ar.persist();
                }
            } catch (IOException ioe) {
                throw new CommandException(ioe);
            }
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.