Package org.opencms.jsp.userdata
Class CmsUserDataRequestInfo
java.lang.Object
org.opencms.jsp.userdata.CmsUserDataRequestInfo
The stored information about a user data request.
This contains both the user data itself, as well as authentication information, for making sure the information can not just be automatically downloaded by someone intercepting the email sent to the user.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreates a new user data request object.CmsUserDataRequestInfo
(String data) Creates a new instance from the JSON data in a string. -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkAuthCode
(String auth) Checks that the given authorization code matches the one stored in this object.Gets the authorization code.getEmail()
Gets the email address.long
Gets the expiration date as a long.getId()
Gets the id of the user data request.Gets the user data HTML text.getType()
Gets the user data request type (single user or email).Gets the full user name.boolean
Returns true if the user data request has expired.void
Sets the authorization code.void
Sets the email address.void
setExpiration
(long expiration) Sets the expiration date.void
Sets the id.void
setInfoHtml
(String infoHtml) Sets the user data HTML.void
Sets the user data request type.void
Sets the full user name.toJson()
Formats this object as JSON text.toString()
-
Field Details
-
A_AUTH
JSON key.- See Also:
-
A_CONTENT
JSON key.- See Also:
-
A_EMAIL
JSON key.- See Also:
-
A_EXPIRATION
JSON key.- See Also:
-
A_ID
JSON key.- See Also:
-
A_TYPE
JSON key.- See Also:
-
A_USERIDS
JSON key.- See Also:
-
-
Constructor Details
-
CmsUserDataRequestInfo
public CmsUserDataRequestInfo()Creates a new user data request object. -
CmsUserDataRequestInfo
Creates a new instance from the JSON data in a string.- Parameters:
data
- the data as a string- Throws:
JSONException
- if parsing the JSON fails
-
-
Method Details
-
checkAuthCode
Checks that the given authorization code matches the one stored in this object.- Parameters:
auth
- the authorization code- Returns:
- true if the code matches
-
getAuthCode
Gets the authorization code.- Returns:
- the authorization code
-
getEmail
Gets the email address.- Returns:
- the email address
-
getExpiration
Gets the expiration date as a long.- Returns:
- the expiration date
-
getId
Gets the id of the user data request.- Returns:
- the id
-
getInfoHtml
Gets the user data HTML text.- Returns:
- the user data HTML text
-
getType
Gets the user data request type (single user or email).- Returns:
- the user data request type
-
getUserName
Gets the full user name.This is not set in case of email-only user data requests.
- Returns:
- the full user name
-
isExpired
Returns true if the user data request has expired.- Returns:
- true if the user data request has expired
-
setAuth
Sets the authorization code.- Parameters:
auth
- the authorization code.
-
setEmail
Sets the email address.- Parameters:
email
- the email address
-
setExpiration
Sets the expiration date.- Parameters:
expiration
- the expiration date
-
setId
Sets the id.- Parameters:
id
- the id
-
setInfoHtml
Sets the user data HTML.- Parameters:
infoHtml
- the user data HTML
-
setType
Sets the user data request type.- Parameters:
type
- the user data request type
-
setUser
Sets the full user name.- Parameters:
user
- the full user name
-
toJson
Formats this object as JSON text.- Returns:
- the JSON text
-
toString
-