org.springframework.extensions.webscripts.connector
Class User

java.lang.Object
  extended by org.springframework.extensions.webscripts.connector.User
All Implemented Interfaces:
Serializable, Principal
Direct Known Subclasses:
AlfrescoUser

public class User
extends Object
implements Principal, Serializable

Default user profile object.

Author:
muzquiano, kevinr
See Also:
Serialized Form

Field Summary
protected  String fullName
           
protected  boolean isAdmin
           
protected  boolean isGuest
           
protected  Map<String,Serializable> map
           
static String PROP_BIOGRAPHY
           
static String PROP_COMPANY_ADDRESS1
           
static String PROP_COMPANY_ADDRESS2
           
static String PROP_COMPANY_ADDRESS3
           
static String PROP_COMPANY_EMAIL
           
static String PROP_COMPANY_FAX
           
static String PROP_COMPANY_POSTCODE
           
static String PROP_COMPANY_TELEPHONE
           
static String PROP_EMAIL
           
static String PROP_FIRST_NAME
           
static String PROP_ID
           
static String PROP_INSTANTMSG
           
static String PROP_JOB_TITLE
           
static String PROP_LAST_NAME
           
static String PROP_LOCATION
           
static String PROP_MIDDLE_NAME
           
static String PROP_MOBILE_PHONE
           
static String PROP_ORGANIZATION
           
static String PROP_SKYPE
           
static String PROP_TELEPHONE
           
 
Constructor Summary
User(String id)
          Instantiates a new user.
User(String id, boolean isAdmin, boolean isGuest)
          Instantiates a new user.
 
Method Summary
 String getBiography()
          Get the biography
 String getCompanyAddress1()
          Gets Company Address1
 String getCompanyAddress2()
          Gets Company Address2
 String getCompanyAddress3()
          Gets Company Address3
 String getCompanyEmail()
          Gets Company Email
 String getCompanyFax()
          Gets Company Fax
 String getCompanyPostcode()
          Gets Company Postcode
 String getCompanyTelephone()
          Gets Company Telephone
 String getEmail()
          Gets the email.
 String getFirstName()
          Gets the first name.
 String getFullName()
          Provides the full name for the user.
 String getId()
          Gets the id - this is usually the username.
 String getInstantMsg()
          Gets the instant msg id.
 String getJobTitle()
          Gets the job title.
 String getLastName()
          Gets the last name.
 String getLocation()
          Get the location
 String getMiddleName()
          Gets the middle name.
 String getMobilePhone()
          Gets the mobile phone.
 String getName()
           
 String getOrganization()
          Gets the organization.
 Map<String,Serializable> getProperties()
          Gets the properties.
 Object getProperty(String key)
          Gets the property.
 String getSkype()
          Gets the skype id.
 String getStringProperty(String key)
          Gets the string property.
 String getTelephone()
          Gets the home phone.
 boolean isAdmin()
          Checks if is admin.
 boolean isGuest()
          Returns true if this user is a guest user
 void save()
          Persist this user
 void setBiography(String value)
          Set the biography
 void setCompanyAddress1(String value)
          Sets the Company Address1
 void setCompanyAddress2(String value)
          Sets the Company Address2
 void setCompanyAddress3(String value)
          Sets the Company Address3
 void setCompanyEmail(String value)
          Sets the Company Email
 void setCompanyFax(String value)
          Sets the Company Fax
 void setCompanyPostcode(String value)
          Sets the Company Postcode
 void setCompanyTelephone(String value)
          Sets the Company Telephone
 void setEmail(String value)
          Sets the email.
 void setFirstName(String value)
          Sets the first name.
 void setInstantMsg(String value)
          Sets the instant msg id
 void setJobTitle(String value)
          Sets the job title.
 void setLastName(String value)
          Sets the last name.
 void setLocation(String value)
          Set the location
 void setMiddleName(String value)
          Sets the middle name.
 void setMobilePhone(String value)
          Sets the mobile phone.
 void setOrganization(String value)
          Sets the organization.
 void setProperty(String key, Serializable value)
          Sets the property.
 void setSkype(String value)
          Sets the skype id
 void setTelephone(String value)
          Sets the home phone.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.security.Principal
equals, hashCode
 

Field Detail

PROP_ID

public static String PROP_ID

PROP_FIRST_NAME

public static String PROP_FIRST_NAME

PROP_MIDDLE_NAME

public static String PROP_MIDDLE_NAME

PROP_LAST_NAME

public static String PROP_LAST_NAME

PROP_EMAIL

public static String PROP_EMAIL

PROP_ORGANIZATION

public static String PROP_ORGANIZATION

PROP_JOB_TITLE

public static String PROP_JOB_TITLE

PROP_LOCATION

public static String PROP_LOCATION

PROP_BIOGRAPHY

public static String PROP_BIOGRAPHY

PROP_TELEPHONE

public static String PROP_TELEPHONE

PROP_MOBILE_PHONE

public static String PROP_MOBILE_PHONE

PROP_SKYPE

public static String PROP_SKYPE

PROP_INSTANTMSG

public static String PROP_INSTANTMSG

PROP_COMPANY_ADDRESS1

public static String PROP_COMPANY_ADDRESS1

PROP_COMPANY_ADDRESS2

public static String PROP_COMPANY_ADDRESS2

PROP_COMPANY_ADDRESS3

public static String PROP_COMPANY_ADDRESS3

PROP_COMPANY_POSTCODE

public static String PROP_COMPANY_POSTCODE

PROP_COMPANY_TELEPHONE

public static String PROP_COMPANY_TELEPHONE

PROP_COMPANY_FAX

public static String PROP_COMPANY_FAX

PROP_COMPANY_EMAIL

public static String PROP_COMPANY_EMAIL

fullName

protected String fullName

isAdmin

protected boolean isAdmin

isGuest

protected boolean isGuest

map

protected Map<String,Serializable> map
Constructor Detail

User

public User(String id)
Instantiates a new user.

Parameters:
id - the id

User

public User(String id,
            boolean isAdmin,
            boolean isGuest)
Instantiates a new user.

Parameters:
id - the id
isAdmin - the is admin
Method Detail

getName

public String getName()
Specified by:
getName in interface Principal

getId

public String getId()
Gets the id - this is usually the username.

Returns:
the id

getFirstName

public String getFirstName()
Gets the first name.

Returns:
the first name

setFirstName

public void setFirstName(String value)
Sets the first name.

Parameters:
value - the new first name

getLastName

public String getLastName()
Gets the last name.

Returns:
the last name

setLastName

public void setLastName(String value)
Sets the last name.

Parameters:
value - the new last name

getMiddleName

public String getMiddleName()
Gets the middle name.

Returns:
the middle name

setMiddleName

public void setMiddleName(String value)
Sets the middle name.

Parameters:
value - the new middle name

getEmail

public String getEmail()
Gets the email.

Returns:
the email

setEmail

public void setEmail(String value)
Sets the email.

Parameters:
value - the new email

getOrganization

public String getOrganization()
Gets the organization.

Returns:
the organization

setOrganization

public void setOrganization(String value)
Sets the organization.

Parameters:
value - the new organization

getJobTitle

public String getJobTitle()
Gets the job title.

Returns:
the job title

setJobTitle

public void setJobTitle(String value)
Sets the job title.

Parameters:
value - the new job title

getLocation

public String getLocation()
Get the location

Returns:
the location

setLocation

public void setLocation(String value)
Set the location

Parameters:
value - the new location

getBiography

public String getBiography()
Get the biography

Returns:
the biography

setBiography

public void setBiography(String value)
Set the biography

Parameters:
value - the new biography

getTelephone

public String getTelephone()
Gets the home phone.

Returns:
the home phone

setTelephone

public void setTelephone(String value)
Sets the home phone.

Parameters:
value - the new home phone

getMobilePhone

public String getMobilePhone()
Gets the mobile phone.

Returns:
the mobile phone

setMobilePhone

public void setMobilePhone(String value)
Sets the mobile phone.

Parameters:
value - the new mobile phone

getSkype

public String getSkype()
Gets the skype id.

Returns:
the skype id

setSkype

public void setSkype(String value)
Sets the skype id

Parameters:
value - the new skype id

getInstantMsg

public String getInstantMsg()
Gets the instant msg id.

Returns:
the instant msg id

setInstantMsg

public void setInstantMsg(String value)
Sets the instant msg id

Parameters:
value - the new instant msg id

getCompanyAddress1

public String getCompanyAddress1()
Gets Company Address1

Returns:
the Company Address1

setCompanyAddress1

public void setCompanyAddress1(String value)
Sets the Company Address1

Parameters:
value - the new Company Address1

getCompanyAddress2

public String getCompanyAddress2()
Gets Company Address2

Returns:
the Company Address2

setCompanyAddress2

public void setCompanyAddress2(String value)
Sets the Company Address2

Parameters:
value - the new Company Address2

getCompanyAddress3

public String getCompanyAddress3()
Gets Company Address3

Returns:
the Company Address3

setCompanyAddress3

public void setCompanyAddress3(String value)
Sets the Company Address3

Parameters:
value - the new Company Address3

getCompanyPostcode

public String getCompanyPostcode()
Gets Company Postcode

Returns:
the Company Postcode

setCompanyPostcode

public void setCompanyPostcode(String value)
Sets the Company Postcode

Parameters:
value - the new Company Postcode

getCompanyTelephone

public String getCompanyTelephone()
Gets Company Telephone

Returns:
the Company Telephone

setCompanyTelephone

public void setCompanyTelephone(String value)
Sets the Company Telephone

Parameters:
value - the new Company Telephone

getCompanyFax

public String getCompanyFax()
Gets Company Fax

Returns:
the Company Fax

setCompanyFax

public void setCompanyFax(String value)
Sets the Company Fax

Parameters:
value - the new Company Fax

getCompanyEmail

public String getCompanyEmail()
Gets Company Email

Returns:
the Company Email

setCompanyEmail

public void setCompanyEmail(String value)
Sets the Company Email

Parameters:
value - the new Company Email

getProperty

public Object getProperty(String key)
Gets the property.

Parameters:
key - the key
Returns:
the property

getStringProperty

public String getStringProperty(String key)
Gets the string property.

Parameters:
key - the key
Returns:
the string property

setProperty

public void setProperty(String key,
                        Serializable value)
Sets the property.

Parameters:
key - the key
value - the value

getProperties

public Map<String,Serializable> getProperties()
Gets the properties.

Returns:
the properties

isAdmin

public boolean isAdmin()
Checks if is admin.

Returns:
the isAdmin

isGuest

public boolean isGuest()
Returns true if this user is a guest user

Returns:
true if this user is a guest user

toString

public String toString()
Specified by:
toString in interface Principal
Overrides:
toString in class Object

getFullName

public String getFullName()
Provides the full name for the user. This makes a best attempt at building the full name based on what it knows about the user. If a first name is not known, the returned name will be the user id of the user. If a first name is known, then the first name will be returned. If a first and middle name are known, then the first and middle name will be returned. Valid full names are therefore: jsmith Joe Joe D Joe Smith Joe D Smith

Returns:
A valid full name

save

public void save()
Persist this user



Copyright © 2009 SpringSource, Inc. All Rights Reserved.