Venice 0.751beta

nz.org.venice.quote
Class DatabaseAccessManager

java.lang.Object
  extended bynz.org.venice.quote.DatabaseAccessManager

public class DatabaseAccessManager
extends java.lang.Object

Manages database settings where the data is session based (ie not stored on disk ) Where the database is stored locally, a simple mask is applied. While this is trivial to break, the purpose is to slow an attacker so they don't immediately gain access to the database. (If an attacker has access to the user account, not even a session password will help)

Author:
Mark Hummel
See Also:
DatabaseManager, PreferencesManager

Method Summary
static DatabaseAccessManager getInstance()
           
 java.lang.String getPassword()
          Return the database password.
 java.lang.String mask(java.lang.String unmasked)
          Return a string after the mask has been applied to a plain text string.
 void reset()
          Set the QuoteSource and AlertManager source to null, forcing the Factories to recreate their database objects.
 java.lang.String unMask(java.lang.String masked)
          Return a plaintext string with the mask removed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static DatabaseAccessManager getInstance()

reset

public void reset()
Set the QuoteSource and AlertManager source to null, forcing the Factories to recreate their database objects. This method has an effect only if the user chooses to a use a session password. This is used when the connection fails. So if the password is incorrect, the user has another chance to enter it correctly.


unMask

public java.lang.String unMask(java.lang.String masked)
Return a plaintext string with the mask removed.

Parameters:
masked - A string which has had a mask applied by the mask method
Returns:
A plaintext string.

mask

public java.lang.String mask(java.lang.String unmasked)
Return a string after the mask has been applied to a plain text string.

Parameters:
unmasked - A plaintext string
Returns:
an encrypted string

getPassword

public java.lang.String getPassword()
Return the database password. If the password has been stored locally a plaintext string is returned after having been unmasked. Otherwise, if the user chooses to supply the password per session, and if the user has not already entered the password, prompt the user to enter it.


Venice 0.751beta