org.granite.client.tide.javafx
Class BaseIdentity
java.lang.Object
org.granite.client.tide.impl.ComponentImpl
org.granite.client.tide.javafx.BaseIdentity
- All Implemented Interfaces:
- InvocationHandler, ContextAware, Identity, NameAware, Component, ExceptionHandler
- Direct Known Subclasses:
- Identity, Identity
public abstract class BaseIdentity
- extends ComponentImpl
- implements Identity, ExceptionHandler
- Author:
- William DRAI
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BaseIdentity
protected BaseIdentity()
BaseIdentity
public BaseIdentity(ServerSession serverSession)
loggedInProperty
public javafx.beans.property.BooleanProperty loggedInProperty()
isLoggedIn
public boolean isLoggedIn()
- Specified by:
isLoggedIn in interface Identity
setLoggedIn
public void setLoggedIn(boolean loggedIn)
usernameProperty
public javafx.beans.property.StringProperty usernameProperty()
getUsername
public String getUsername()
- Specified by:
getUsername in interface Identity
checkLoggedIn
public Future<String> checkLoggedIn(TideResponder<String> tideResponder)
- Triggers a remote call to check is user is currently logged in
Can be used at application startup to handle browser refresh cases
- Specified by:
checkLoggedIn in interface Identity
- Parameters:
resultHandler - optional result handlerfaultHandler - optional fault handler
login
public void login(String username,
String password,
TideResponder<String> tideResponder)
- Specified by:
login in interface Identity
logout
public void logout(TideResponder<Void> tideResponder)
- Specified by:
logout in interface Identity
hasRole
public abstract ObservableRole hasRole(String roleName)
initSecurityCache
protected abstract void initSecurityCache()
clearSecurityCache
public abstract void clearSecurityCache()
- Clear the security cache
accepts
public boolean accepts(FaultMessage emsg)
- Description copied from interface:
ExceptionHandler
- Should return true if this handler is able to manage the specified ErrorMessage
- Specified by:
accepts in interface ExceptionHandler
- Parameters:
emsg - an error message
- Returns:
- true if ErrorMessage accepted
handle
public void handle(Context context,
FaultMessage emsg,
TideFaultEvent faultEvent)
- Description copied from interface:
ExceptionHandler
- Handle the error
- Specified by:
handle in interface ExceptionHandler
- Parameters:
context - the context in which the error occuredemsg - the error message