se.datadosen.jalbum
Class SignInManager

java.lang.Object
  extended by se.datadosen.jalbum.SignInManager

public class SignInManager
extends java.lang.Object


Nested Class Summary
 class SignInManager.JSignInDialog
           
 
Field Summary
protected  javax.swing.Action closeAction
           
protected  boolean confirmedSignedIn
           
protected  JAlbumContext context
           
protected  javax.swing.JPasswordField password
           
protected  java.util.prefs.Preferences preferences
           
protected  boolean signedIn
           
protected  javax.swing.Action signInAction
           
protected  AccountManager.AccountStatus status
           
protected  SignInManager.JSignInDialog theDialog
           
protected  javax.swing.JTextField userName
           
 
Constructor Summary
protected SignInManager()
          Singelton
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
           
 void doSignOut()
           
protected  void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
          Support for reporting bound property changes for Object properties.
 AccountManager.AccountStatus getAccountStatus()
          Return the account status data as returned from signing in
static SignInManager getInstance()
           
static SignInManager getInstance(JAlbumFrame window)
          Deprecated. use getInstance() instead
 java.lang.String getLicenseCode()
          Returns a license hash code if the current username maps to a valid paid account Returns the empty string otherwise
 java.lang.String getPassword()
           
 java.lang.String getUserName()
           
protected  JAlbumFrame getWindow()
           
 boolean isConfirmedSignedIn()
           
 boolean isLicenseValid()
          Returns true if the current username maps to a valid paid account
 boolean isOldDonor()
          Has user donated before jAlbum 10?
 boolean isSignedIn()
           
 void onStart()
          Call on start.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes a PropertyChangeListener from the listener list.
 void setOnConfirmedSignIn(java.lang.Runnable r)
          Code to excecute upon a confirmed signin Automatically cleared upon a confirmed signin or cancelled signin
 void setPassword(java.lang.String password)
           
 void setUserName(java.lang.String userName)
           
 void showDialog()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

protected JAlbumContext context

theDialog

protected SignInManager.JSignInDialog theDialog

userName

protected javax.swing.JTextField userName

password

protected javax.swing.JPasswordField password

signedIn

protected boolean signedIn

confirmedSignedIn

protected boolean confirmedSignedIn

status

protected AccountManager.AccountStatus status

preferences

protected java.util.prefs.Preferences preferences

signInAction

protected javax.swing.Action signInAction

closeAction

protected javax.swing.Action closeAction
Constructor Detail

SignInManager

protected SignInManager()
Singelton

Method Detail

getInstance

public static SignInManager getInstance()

getInstance

public static SignInManager getInstance(JAlbumFrame window)
Deprecated. use getInstance() instead


getWindow

protected JAlbumFrame getWindow()

getLicenseCode

public java.lang.String getLicenseCode()
Returns a license hash code if the current username maps to a valid paid account Returns the empty string otherwise

Since:
9.6

isLicenseValid

public boolean isLicenseValid()
Returns true if the current username maps to a valid paid account

Since:
9.6

isOldDonor

public boolean isOldDonor()
Has user donated before jAlbum 10?


getAccountStatus

public AccountManager.AccountStatus getAccountStatus()
Return the account status data as returned from signing in

Since:
9.6

doSignOut

public void doSignOut()

onStart

public void onStart()
Call on start. Will sign in automatically if requested or pop up dialog


isSignedIn

public boolean isSignedIn()

isConfirmedSignedIn

public boolean isConfirmedSignedIn()

getUserName

public java.lang.String getUserName()

setUserName

public void setUserName(java.lang.String userName)

getPassword

public java.lang.String getPassword()

setPassword

public void setPassword(java.lang.String password)

showDialog

public void showDialog()

setOnConfirmedSignIn

public void setOnConfirmedSignIn(java.lang.Runnable r)
Code to excecute upon a confirmed signin Automatically cleared upon a confirmed signin or cancelled signin

Since:
8.14

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a PropertyChangeListener from the listener list. This method should be used to remove PropertyChangeListeners that were registered for all bound properties of this class.

If listener is null, no exception is thrown and no action is performed.

Parameters:
listener - the PropertyChangeListener to be removed
See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener), #getPropertyChangeListeners, #removePropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener)

addPropertyChangeListener

public void addPropertyChangeListener(java.lang.String propertyName,
                                      java.beans.PropertyChangeListener listener)

firePropertyChange

protected void firePropertyChange(java.lang.String propertyName,
                                  java.lang.Object oldValue,
                                  java.lang.Object newValue)
Support for reporting bound property changes for Object properties. This method can be called when a bound property has changed and it will send the appropriate PropertyChangeEvent to any registered PropertyChangeListeners.

Parameters:
propertyName - the property whose value has changed
oldValue - the property's previous value
newValue - the property's new value