Class User
- java.lang.Object
-
- org.springframework.extensions.webscripts.connector.User
-
- All Implemented Interfaces:
java.io.Serializable,java.security.Principal
public class User extends java.lang.Object implements java.security.Principal, java.io.SerializableDefault user profile object.- Author:
- muzquiano, kevinr
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,java.lang.Boolean>capabilitiesstatic java.lang.StringCAPABILITY_ADMINstatic java.lang.StringCAPABILITY_GUESTstatic java.lang.StringCAPABILITY_MUTABLEprotected java.lang.StringfullNameprotected java.util.Map<java.lang.String,java.io.Serializable>mapstatic java.lang.StringPROP_BIOGRAPHYstatic java.lang.StringPROP_COMPANY_ADDRESS1static java.lang.StringPROP_COMPANY_ADDRESS2static java.lang.StringPROP_COMPANY_ADDRESS3static java.lang.StringPROP_COMPANY_EMAILstatic java.lang.StringPROP_COMPANY_FAXstatic java.lang.StringPROP_COMPANY_POSTCODEstatic java.lang.StringPROP_COMPANY_TELEPHONEstatic java.lang.StringPROP_EMAILstatic java.lang.StringPROP_FIRST_NAMEstatic java.lang.StringPROP_GOOGLEUSERNAMEstatic java.lang.StringPROP_IDstatic java.lang.StringPROP_INSTANTMSGstatic java.lang.StringPROP_JOB_TITLEstatic java.lang.StringPROP_LAST_NAMEstatic java.lang.StringPROP_LOCATIONstatic java.lang.StringPROP_MIDDLE_NAMEstatic java.lang.StringPROP_MOBILE_PHONEstatic java.lang.StringPROP_ORGANIZATIONstatic java.lang.StringPROP_SKYPEstatic java.lang.StringPROP_TELEPHONE
-
Constructor Summary
Constructors Constructor Description User(java.lang.String id, java.util.Map<java.lang.String,java.lang.Boolean> capabilities)Instantiates a new user.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetBiography()Get the biographyjava.util.Map<java.lang.String,java.lang.Boolean>getCapabilities()Gets a map of capabilities (boolean assertions) for the user.java.lang.StringgetCompanyAddress1()Gets Company Address1java.lang.StringgetCompanyAddress2()Gets Company Address2java.lang.StringgetCompanyAddress3()Gets Company Address3java.lang.StringgetCompanyEmail()Gets Company Emailjava.lang.StringgetCompanyFax()Gets Company Faxjava.lang.StringgetCompanyPostcode()Gets Company Postcodejava.lang.StringgetCompanyTelephone()Gets Company Telephonejava.lang.StringgetEmail()Gets the email.java.lang.StringgetFirstName()Gets the first name.java.lang.StringgetFullName()Provides the full name for the user.java.lang.StringgetGoogleUsername()Gets the google user name.java.lang.StringgetId()Gets the id - this is usually the username.java.lang.StringgetInstantMsg()Gets the instant msg id.java.lang.StringgetJobTitle()Gets the job title.java.lang.StringgetLastName()Gets the last name.java.lang.StringgetLocation()Get the locationjava.lang.StringgetMiddleName()Gets the middle name.java.lang.StringgetMobilePhone()Gets the mobile phone.java.lang.StringgetName()java.lang.StringgetOrganization()Gets the organization.java.util.Map<java.lang.String,java.io.Serializable>getProperties()Gets the properties.java.lang.ObjectgetProperty(java.lang.String key)Gets the property.java.lang.StringgetSkype()Gets the skype id.java.lang.StringgetStringProperty(java.lang.String key)Gets the string property.java.lang.StringgetTelephone()Gets the home phone.booleanisAdmin()Checks if is admin.booleanisGuest()Returnstrueif this user is a guest uservoidsave()Persist this uservoidsetBiography(java.lang.String value)Set the biographyvoidsetCompanyAddress1(java.lang.String value)Sets the Company Address1voidsetCompanyAddress2(java.lang.String value)Sets the Company Address2voidsetCompanyAddress3(java.lang.String value)Sets the Company Address3voidsetCompanyEmail(java.lang.String value)Sets the Company EmailvoidsetCompanyFax(java.lang.String value)Sets the Company FaxvoidsetCompanyPostcode(java.lang.String value)Sets the Company PostcodevoidsetCompanyTelephone(java.lang.String value)Sets the Company TelephonevoidsetEmail(java.lang.String value)Sets the email.voidsetFirstName(java.lang.String value)Sets the first name.voidsetGoogleUsername(java.lang.String value)Sets the google user namevoidsetInstantMsg(java.lang.String value)Sets the instant msg idvoidsetJobTitle(java.lang.String value)Sets the job title.voidsetLastName(java.lang.String value)Sets the last name.voidsetLocation(java.lang.String value)Set the locationvoidsetMiddleName(java.lang.String value)Sets the middle name.voidsetMobilePhone(java.lang.String value)Sets the mobile phone.voidsetOrganization(java.lang.String value)Sets the organization.voidsetProperty(java.lang.String key, java.io.Serializable value)Sets the property.voidsetSkype(java.lang.String value)Sets the skype idvoidsetTelephone(java.lang.String value)Sets the home phone.java.lang.StringtoString()
-
-
-
Field Detail
-
PROP_ID
public static java.lang.String PROP_ID
-
PROP_FIRST_NAME
public static java.lang.String PROP_FIRST_NAME
-
PROP_MIDDLE_NAME
public static java.lang.String PROP_MIDDLE_NAME
-
PROP_LAST_NAME
public static java.lang.String PROP_LAST_NAME
-
PROP_EMAIL
public static java.lang.String PROP_EMAIL
-
PROP_ORGANIZATION
public static java.lang.String PROP_ORGANIZATION
-
PROP_JOB_TITLE
public static java.lang.String PROP_JOB_TITLE
-
PROP_LOCATION
public static java.lang.String PROP_LOCATION
-
PROP_BIOGRAPHY
public static java.lang.String PROP_BIOGRAPHY
-
PROP_TELEPHONE
public static java.lang.String PROP_TELEPHONE
-
PROP_MOBILE_PHONE
public static java.lang.String PROP_MOBILE_PHONE
-
PROP_SKYPE
public static java.lang.String PROP_SKYPE
-
PROP_INSTANTMSG
public static java.lang.String PROP_INSTANTMSG
-
PROP_GOOGLEUSERNAME
public static java.lang.String PROP_GOOGLEUSERNAME
-
PROP_COMPANY_ADDRESS1
public static java.lang.String PROP_COMPANY_ADDRESS1
-
PROP_COMPANY_ADDRESS2
public static java.lang.String PROP_COMPANY_ADDRESS2
-
PROP_COMPANY_ADDRESS3
public static java.lang.String PROP_COMPANY_ADDRESS3
-
PROP_COMPANY_POSTCODE
public static java.lang.String PROP_COMPANY_POSTCODE
-
PROP_COMPANY_TELEPHONE
public static java.lang.String PROP_COMPANY_TELEPHONE
-
PROP_COMPANY_FAX
public static java.lang.String PROP_COMPANY_FAX
-
PROP_COMPANY_EMAIL
public static java.lang.String PROP_COMPANY_EMAIL
-
CAPABILITY_ADMIN
public static final java.lang.String CAPABILITY_ADMIN
- See Also:
- Constant Field Values
-
CAPABILITY_GUEST
public static final java.lang.String CAPABILITY_GUEST
- See Also:
- Constant Field Values
-
CAPABILITY_MUTABLE
public static final java.lang.String CAPABILITY_MUTABLE
- See Also:
- Constant Field Values
-
fullName
protected java.lang.String fullName
-
capabilities
protected final java.util.Map<java.lang.String,java.lang.Boolean> capabilities
-
map
protected final java.util.Map<java.lang.String,java.io.Serializable> map
-
-
Method Detail
-
getName
public java.lang.String getName()
- Specified by:
getNamein interfacejava.security.Principal
-
getId
public java.lang.String getId()
Gets the id - this is usually the username.- Returns:
- the id
-
getFirstName
public java.lang.String getFirstName()
Gets the first name.- Returns:
- the first name
-
setFirstName
public void setFirstName(java.lang.String value)
Sets the first name.- Parameters:
value- the new first name
-
getLastName
public java.lang.String getLastName()
Gets the last name.- Returns:
- the last name
-
setLastName
public void setLastName(java.lang.String value)
Sets the last name.- Parameters:
value- the new last name
-
getMiddleName
public java.lang.String getMiddleName()
Gets the middle name.- Returns:
- the middle name
-
setMiddleName
public void setMiddleName(java.lang.String value)
Sets the middle name.- Parameters:
value- the new middle name
-
getEmail
public java.lang.String getEmail()
Gets the email.- Returns:
- the email
-
setEmail
public void setEmail(java.lang.String value)
Sets the email.- Parameters:
value- the new email
-
getOrganization
public java.lang.String getOrganization()
Gets the organization.- Returns:
- the organization
-
setOrganization
public void setOrganization(java.lang.String value)
Sets the organization.- Parameters:
value- the new organization
-
getJobTitle
public java.lang.String getJobTitle()
Gets the job title.- Returns:
- the job title
-
setJobTitle
public void setJobTitle(java.lang.String value)
Sets the job title.- Parameters:
value- the new job title
-
getLocation
public java.lang.String getLocation()
Get the location- Returns:
- the location
-
setLocation
public void setLocation(java.lang.String value)
Set the location- Parameters:
value- the new location
-
getBiography
public java.lang.String getBiography()
Get the biography- Returns:
- the biography
-
setBiography
public void setBiography(java.lang.String value)
Set the biography- Parameters:
value- the new biography
-
getTelephone
public java.lang.String getTelephone()
Gets the home phone.- Returns:
- the home phone
-
setTelephone
public void setTelephone(java.lang.String value)
Sets the home phone.- Parameters:
value- the new home phone
-
getMobilePhone
public java.lang.String getMobilePhone()
Gets the mobile phone.- Returns:
- the mobile phone
-
setMobilePhone
public void setMobilePhone(java.lang.String value)
Sets the mobile phone.- Parameters:
value- the new mobile phone
-
getSkype
public java.lang.String getSkype()
Gets the skype id.- Returns:
- the skype id
-
setSkype
public void setSkype(java.lang.String value)
Sets the skype id- Parameters:
value- the new skype id
-
getInstantMsg
public java.lang.String getInstantMsg()
Gets the instant msg id.- Returns:
- the instant msg id
-
setInstantMsg
public void setInstantMsg(java.lang.String value)
Sets the instant msg id- Parameters:
value- the new instant msg id
-
getGoogleUsername
public java.lang.String getGoogleUsername()
Gets the google user name.- Returns:
- the google user name
-
setGoogleUsername
public void setGoogleUsername(java.lang.String value)
Sets the google user name- Parameters:
value- the new google user name
-
getCompanyAddress1
public java.lang.String getCompanyAddress1()
Gets Company Address1- Returns:
- the Company Address1
-
setCompanyAddress1
public void setCompanyAddress1(java.lang.String value)
Sets the Company Address1- Parameters:
value- the new Company Address1
-
getCompanyAddress2
public java.lang.String getCompanyAddress2()
Gets Company Address2- Returns:
- the Company Address2
-
setCompanyAddress2
public void setCompanyAddress2(java.lang.String value)
Sets the Company Address2- Parameters:
value- the new Company Address2
-
getCompanyAddress3
public java.lang.String getCompanyAddress3()
Gets Company Address3- Returns:
- the Company Address3
-
setCompanyAddress3
public void setCompanyAddress3(java.lang.String value)
Sets the Company Address3- Parameters:
value- the new Company Address3
-
getCompanyPostcode
public java.lang.String getCompanyPostcode()
Gets Company Postcode- Returns:
- the Company Postcode
-
setCompanyPostcode
public void setCompanyPostcode(java.lang.String value)
Sets the Company Postcode- Parameters:
value- the new Company Postcode
-
getCompanyTelephone
public java.lang.String getCompanyTelephone()
Gets Company Telephone- Returns:
- the Company Telephone
-
setCompanyTelephone
public void setCompanyTelephone(java.lang.String value)
Sets the Company Telephone- Parameters:
value- the new Company Telephone
-
getCompanyFax
public java.lang.String getCompanyFax()
Gets Company Fax- Returns:
- the Company Fax
-
setCompanyFax
public void setCompanyFax(java.lang.String value)
Sets the Company Fax- Parameters:
value- the new Company Fax
-
getCompanyEmail
public java.lang.String getCompanyEmail()
Gets Company Email- Returns:
- the Company Email
-
setCompanyEmail
public void setCompanyEmail(java.lang.String value)
Sets the Company Email- Parameters:
value- the new Company Email
-
getProperty
public java.lang.Object getProperty(java.lang.String key)
Gets the property.- Parameters:
key- the key- Returns:
- the property
-
getStringProperty
public java.lang.String getStringProperty(java.lang.String key)
Gets the string property.- Parameters:
key- the key- Returns:
- the string property
-
setProperty
public void setProperty(java.lang.String key, java.io.Serializable value)Sets the property.- Parameters:
key- the keyvalue- the value
-
getProperties
public java.util.Map<java.lang.String,java.io.Serializable> getProperties()
Gets the properties.- Returns:
- the properties
-
isAdmin
public boolean isAdmin()
Checks if is admin.- Returns:
- the isAdmin
-
isGuest
public boolean isGuest()
Returnstrueif this user is a guest user- Returns:
trueif this user is a guest user
-
getCapabilities
public java.util.Map<java.lang.String,java.lang.Boolean> getCapabilities()
Gets a map of capabilities (boolean assertions) for the user.- Returns:
- the capability map
-
toString
public java.lang.String toString()
- Specified by:
toStringin interfacejava.security.Principal- Overrides:
toStringin classjava.lang.Object
-
getFullName
public java.lang.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
-
-