|
|
|
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.torweg.pulse.util.entity.AbstractBasicEntity
org.torweg.pulse.util.entity.AbstractNamedEntity
org.torweg.pulse.util.entity.AbstractNamableEntity
org.torweg.pulse.accesscontrol.AbstractAccessControlObject
org.torweg.pulse.accesscontrol.AbstractUserBase
public abstract class AbstractUserBase
abstract base for User containing all utility methods.
| Field Summary | |
|---|---|
static java.lang.String |
EVERYBODY
name of the everybody role. |
protected static java.lang.String |
PASSWORD_CHARACTERS
The characters for auto-generated passwords. |
| Constructor Summary | |
|---|---|
AbstractUserBase()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
generatePassword()
Returns a generated password of 12 characters. |
static java.lang.String |
generateToken()
generates a base-62 encoded 16 byte token using Lifecycle.getRandom(). |
protected java.util.Set<CommandMatcher> |
getCommandMatchers()
|
protected java.lang.Long |
getEveryBodyId()
returns the id of the ~Everybody role. |
static Role |
getEverybodyRole(org.hibernate.Session sess)
retrieves the Everybody role. |
static User |
getSuperUser(HibernateDataSource dataSrc)
Returns the superuser or creates one, if none exists. |
static User |
getUser(ServiceSession session)
creates a User, if a User id is found in the
ServiceSession. |
static User |
getUser(java.lang.String usrName)
Returns the User named usrName or the Everybody , if no
such user exists. |
static void |
initEverybodyRole(HibernateDataSource ds)
initialises the " ~EVERYBODY" Group. |
| Methods inherited from class org.torweg.pulse.accesscontrol.AbstractAccessControlObject |
|---|
getAssociatedAbstractAccessControlObjects, getLoadCriteriaForClassWithAlias, toJSON |
| Methods inherited from class org.torweg.pulse.util.entity.AbstractNamableEntity |
|---|
setName |
| Methods inherited from class org.torweg.pulse.util.entity.AbstractNamedEntity |
|---|
getName |
| Methods inherited from class org.torweg.pulse.util.entity.AbstractBasicEntity |
|---|
compareTo, equals, getFullQualifiedClassNameJAXB, getId, hashCode |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.torweg.pulse.bundle.JDOMable |
|---|
deserializeToJDOM |
| Methods inherited from interface org.torweg.pulse.util.INamed |
|---|
getName |
| Field Detail |
|---|
protected static final java.lang.String PASSWORD_CHARACTERS
public static final java.lang.String EVERYBODY
| Constructor Detail |
|---|
public AbstractUserBase()
| Method Detail |
|---|
protected final java.util.Set<CommandMatcher> getCommandMatchers()
protected final java.lang.Long getEveryBodyId()
public static final User getUser(ServiceSession session)
User, if a User id is found in the
ServiceSession. If not, the Everybody is returned.
session - the ServiceSession
Userpublic static final User getUser(java.lang.String usrName)
User named usrName or the Everybody , if no
such user exists.
usrName - the name of the User
User named usrName or Everybody, if no such
User exists.public static final User getSuperUser(HibernateDataSource dataSrc)
The superuser will get a random password, which will be logged at info level. Make sure to change the password after your first login!
dataSrc - the HibernateDataSource to be used
public static final Role getEverybodyRole(org.hibernate.Session sess)
sess - the session to load the role with
public static final void initEverybodyRole(HibernateDataSource ds)
~EVERYBODY" Group.
If the group does not exist already, it is created.
ds - the HibernateDataSource to be usedpublic static final java.lang.String generatePassword()
public static final java.lang.String generateToken()
Lifecycle.getRandom().
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||