ariba.util.core
Class MasterPasswordClient

java.lang.Object
  extended by ariba.util.core.MasterPasswordClient

public final class MasterPasswordClient
extends java.lang.Object

Manages master password. For security reasons, it may be required to pass in the master password via std in. Whether this is the case is specified by 1 of the 2 command line options: -readMasterPassword and -masterPasswordNoPrompt. When a commmand line tool is invoked, ArgumentParser will invoke methods from this class to read the master password from the stdin. Whether the user is prompted or not depends on which of the above options are present. If -masterPasswordNoPrompt is present, then the user will not be prompted (in such cases the 'user' is most likely some parent process executing the command line). Otherwise, if -readMasterPassword is present, then the user will be prompted. The master password is then stored and made available for the process via the call getMasterPassword().


Field Summary
static java.lang.String DashOptionMasterPassword
           
static java.lang.String DashOptionMasterPasswordNoPrompt
           
static java.lang.String OptionMasterPassword
           
static java.lang.String OptionMasterPasswordNoPrompt
           
 
Constructor Summary
MasterPasswordClient()
           
 
Method Summary
 java.lang.String getMasterPassword()
          Returns the master password.
static MasterPasswordClient getMasterPasswordClient()
          Get the master password client.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OptionMasterPassword

public static final java.lang.String OptionMasterPassword
See Also:
Constant Field Values

OptionMasterPasswordNoPrompt

public static final java.lang.String OptionMasterPasswordNoPrompt
See Also:
Constant Field Values

DashOptionMasterPassword

public static final java.lang.String DashOptionMasterPassword
See Also:
Constant Field Values

DashOptionMasterPasswordNoPrompt

public static final java.lang.String DashOptionMasterPasswordNoPrompt
See Also:
Constant Field Values
Constructor Detail

MasterPasswordClient

public MasterPasswordClient()
Method Detail

getMasterPasswordClient

public static MasterPasswordClient getMasterPasswordClient()
Get the master password client. Note that this is a singleton. Also this method is not synchronized. If multiple threads call this method, the last one wins, and previously instantiated instances of this class are simply garbage collected.

Returns:
the master password client.

getMasterPassword

public java.lang.String getMasterPassword()
Returns the master password. Should be called after processArguments. It is incorrect to call this method before prcoessArguments is called, in which case null will be returned.

Returns:
the master password, null if no masterPassword options are specified in the command line when processArguments(ariba.util.core.CommandLine, ariba.util.core.ArgumentParser) is called.


AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.