org.weborganic.bastille.pageseeder
Class PSUser

java.lang.Object
  extended by org.weborganic.bastille.pageseeder.PSUser
All Implemented Interfaces:
XMLWritable, Serializable, User
Direct Known Subclasses:
PageSeederUser

public class PSUser
extends Object
implements User, Serializable

Represents a PageSeeder User.

Since:
0.8.1
See Also:
Serialized Form

Constructor Summary
PSUser(Long id)
          Creates a new PageSeeder User.
 
Method Summary
 String getEmail()
           
 String getFirstname()
           
 String getJSessionId()
           
 String getName()
           
 PSSession getSession()
          Return the PageSeeder session for this user.
 String getSurname()
           
 String getUsername()
           
 Long id()
           
 boolean isMemberOf(String group)
          Indicates whether the user is a member of the specified group.
 List<String> memberOf()
           
 void toXML(XMLWriter xml)
          A PageSeeder User as XML.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PSUser

public PSUser(Long id)
Creates a new PageSeeder User.

Parameters:
id - the ID of the user in PageSeeder.
Method Detail

id

public final Long id()
Returns:
The PageSeeder Member ID of this user.

getUsername

public final String getUsername()
Returns:
the PageSeeder username for this user.

getJSessionId

public final String getJSessionId()
Returns:
the ID of this user session in PageSeeder (changes after each login)

getSession

public final PSSession getSession()
Return the PageSeeder session for this user.

Returns:
the last connected time stamp.

getFirstname

public final String getFirstname()
Returns:
the PageSeeder first name for this user.

getSurname

public final String getSurname()
Returns:
the PageSeeder surname for this user.

getEmail

public final String getEmail()
Returns:
the PageSeeder email for this user.

getName

public final String getName()
Specified by:
getName in interface User
Returns:
same as username.

memberOf

public final List<String> memberOf()
Returns:
the groups the user is a member of.

isMemberOf

public final boolean isMemberOf(String group)
Indicates whether the user is a member of the specified group.

Parameters:
group - The group to check membership of.
Returns:
the group the user is a member of.

toXML

public void toXML(XMLWriter xml)
           throws IOException
A PageSeeder User as XML.

Note: The password is never included.

<user type="pageseeder">
    <id>[member_id]</id>
    <username>[member_username]</username>
    <firstname>[member_firstname]</firstname>
    <surname>[member_surname]</surname>
    <email>[member_email]</email>
    <member-of groups="[group0],[group1]"/>
  </user>
 

Specified by:
toXML in interface XMLWritable
Throws:
IOException