|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface BasicUserService
Service class with user services. A thorough client example using the service is found in sesat-kernel/war/src/main/java/no/sesat/search/http/filters/UserFilter.java
| Field Summary | |
|---|---|
static String |
LOGIN_KEY_SEPARATOR
The separator used in login keys. |
| Method Summary | |
|---|---|
BasicUser |
authenticateByLogin(String login,
int type,
String password)
Authenticates a user by the given username and password. |
BasicUser |
authenticateByLoginKey(String loginKey)
Authenticates a user by the given cookie value. |
void |
deleteUser(BasicUser user)
Method that deletes a user from the database. |
void |
invalidateAllLogins(BasicUser user)
Method that invalidate all login cookies for the given user. |
void |
invalidateAllLogins(String loginKey)
Method that invalidate all logins for the user belonging to the given login cookie. |
void |
invalidateLogin(String loginKey)
Method that invalidate the given login cookie. |
boolean |
isLegalLoginKey(String loginKey)
Returns if the given login key has correct login key syntax. |
BasicUser |
refreshUser(BasicUser user)
Method that takes a user object and refreshes it from the database. |
BasicUser |
removeUserProperty(BasicUser user,
String propertyKey)
Removes a property for the given user. |
BasicUser |
setUserProperty(BasicUser user,
String propertyKey,
String propertyValue)
Sets a property for the user. |
| Field Detail |
|---|
static final String LOGIN_KEY_SEPARATOR
| Method Detail |
|---|
BasicUser authenticateByLoginKey(String loginKey)
throws InvalidTokenException
null if the wanted user is not found.
If the token part of the cookie value is illegal, an exception is thrown to
signal a cookie theft.
After a successful authentication, the login cookie value is updated in the database
and the new valid login cookie is injected into the user object that is returned.
loginKey - the login key to use for authentication
null if not found
InvalidTokenException - thrown if an illegal token part is used (stacktrace is blanked out)
BasicUser authenticateByLogin(String login,
int type,
String password)
null if the wanted user is not found.
After a successful authentication, a legal login cookie value is created in the database
and the new valid login cookie is injected into the user object that is returned.
username - the username to use for authenticationpassword - the password to use for authentication
null if not foundBasicUser refreshUser(BasicUser user)
user - the user object to refresh
void invalidateLogin(String loginKey)
loginKey - the login cookie to invalidatevoid invalidateAllLogins(String loginKey)
loginKey - the login cookie to invalidate all user loginsvoid invalidateAllLogins(BasicUser user)
user - the user to invalidate all logins forvoid deleteUser(BasicUser user)
user - the user to delete.
BasicUser setUserProperty(BasicUser user,
String propertyKey,
String propertyValue)
user - the user to set the property topropertyKey - the propertyKey to addpropertyValue - the propertyValue to add
BasicUser removeUserProperty(BasicUser user,
String propertyKey)
user - the user to remove the property frompropertyKey - the propertyKey to removeboolean isLegalLoginKey(String loginKey)
loginKey - the login key to check
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||