Package com.sun.enterprise.cli.framework

Examples of com.sun.enterprise.cli.framework.CLILogger


    /** Saves the login information to the login store. Usually this is the file
     * ".asadminpass" in user's home directory.
    */
    private void saveLogin(final int port, final String user, final String password, final String dn)
    {
        final CLILogger logger = CLILogger.getInstance();
        try {
            //by definition, the host name will default to "localhost" and entry is overwritten
            final LoginInfoStore store = LoginInfoStoreFactory.getStore(null);
            final LoginInfo login      = new LoginInfo("localhost", port, user, password);
            if (store.exists(login.getHost(), login.getPort())) {
                //just let the user know that the user has chosen to overwrite the login information. This is non-interactive, on purpose
                final Object[] params = new Object[] {login.getHost(), ""+login.getPort()};
                final String msg = getLocalizedString("OverwriteLoginMsgCreateDomain", params);
                logger.printMessage(msg);
            }
            store.store(login, true);
            final Object[] params = new String[] {user, dn, store.getName()};
            final String msg = getLocalizedString("LoginInfoStoredCreateDomain", params);
            logger.printMessage(msg);
        }
        catch(final Exception e) {
            final Object[] params = new String[] {user, dn};
            final String msg = getLocalizedString("LoginInfoNotStoredCreateDomain", params);
            logger.printWarning(msg);
            if (logger.isDebug())
                logger.printExceptionStackTrace(e);
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.cli.framework.CLILogger

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.