ch.uzh.ifi.attempto.acewiki.core
Class UserBase

java.lang.Object
  extended by ch.uzh.ifi.attempto.acewiki.core.UserBase

public class UserBase
extends java.lang.Object

This class stands for the set of registered users for a particular AceWiki instance.

Author:
Tobias Kuhn

Method Summary
 User autoLogin(java.lang.String name, java.lang.String clientToken)
          Tries to do an auto-login.
 boolean containsUser(java.lang.String name)
          Checks whether a user with the respective name exists.
 Ontology getOntology()
          Returns the ontology object.
 AceWikiStorage getStorage()
          Returns the storage object.
 User getUser(long id)
          Returns the user with the given id, or null if no user with this id exists.
 int getUserCount()
          Returns the number of registered users.
 User login(java.lang.String name, java.lang.String password)
          Tries to login a user.
 User register(java.lang.String name, java.lang.String email, java.lang.String password)
          Registers a new user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

containsUser

public boolean containsUser(java.lang.String name)
Checks whether a user with the respective name exists.

Parameters:
name - The user name.
Returns:
true if the user exists.

getUser

public User getUser(long id)
Returns the user with the given id, or null if no user with this id exists.

Parameters:
id - The user id.
Returns:
The user object.

getUserCount

public int getUserCount()
Returns the number of registered users.

Returns:
The number of users.

login

public User login(java.lang.String name,
                  java.lang.String password)
Tries to login a user. The user object is returned if the login was successful. Null is returned otherwise.

Parameters:
name - The name of the user.
password - The password in plain text.
Returns:
The user object.

autoLogin

public User autoLogin(java.lang.String name,
                      java.lang.String clientToken)
Tries to do an auto-login. The user object is returned if the login was successful. Null is returned otherwise.

Parameters:
name - The name of the user.
clientToken - The auto-login-token from the client browser.
Returns:
The user object.

register

public User register(java.lang.String name,
                     java.lang.String email,
                     java.lang.String password)
Registers a new user. The new user object is returned if the registration was successful. Null is returned otherwise.

Parameters:
name - The name of the new user.
email - The email address of the new user.
password - The password for the new user.
Returns:
The new user object.

getOntology

public Ontology getOntology()
Returns the ontology object.

Returns:
The ontology.

getStorage

public AceWikiStorage getStorage()
Returns the storage object.

Returns:
The storage.


Copyright 2008-2012, AceWiki developers