Class RemoteCookie
- java.lang.Object
-
- org.forgerock.openam.authentication.service.protocol.RemoteCookie
-
- All Implemented Interfaces:
Serializable
public class RemoteCookie extends Object implements Serializable
Encapsulates a Cookie making it Serializable.- Author:
- Steve Ferris steve.ferris@forgerock.com
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description RemoteCookie()RemoteCookie(jakarta.servlet.http.Cookie cookie)Creates a RemoteCookie based on the contents of the supplied Cookie.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetComment()Retrieves the cookie commentjakarta.servlet.http.CookiegetCookie()Returns a Cookie representing the state of this serialized cookieStringgetDomain()Retrieves the domain of the cookieintgetMaxAge()Retrieves the cookies maximum ageStringgetName()Retrieves the name of the cookieStringgetPath()Retrieves the path of the cookie, if setbooleangetSecure()Is this cookie secure?StringgetValue()Retrieves the value of the cookieintgetVersion()Retrieves the version of the cookievoidsetComment(String comment)Sets the cookies comment to supplied value.voidsetDomain(String domain)Set the cookie domain to the supplied value.voidsetMaxAge(int expiry)Sets the cookies maximum age (in seconds since the epoch).voidsetPath(String uri)Sets the path of the cookie.voidsetSecure(boolean secure)Sets the secure flag of the cookie updating the underlying cookie representation if present.voidsetValue(String newValue)Set the cookie to have a new value, updating the underlying cookie representatio if present.voidsetVersion(int version)Set the version of the cookie, updating the underlying representation if present.
-
-
-
Field Detail
-
serialVersionUID
public static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Method Detail
-
getCookie
public jakarta.servlet.http.Cookie getCookie()
Returns a Cookie representing the state of this serialized cookie- Returns:
- Cookie representing original state of the Cookie
-
getComment
public String getComment()
Retrieves the cookie comment- Returns:
- The comment of the cookie or null
-
getDomain
public String getDomain()
Retrieves the domain of the cookie- Returns:
- The cookie domain if set
-
getMaxAge
public int getMaxAge()
Retrieves the cookies maximum age- Returns:
- The cookies expiry or -1 if not set
-
getName
public String getName()
Retrieves the name of the cookie- Returns:
- String representing the cookie name
-
getPath
public String getPath()
Retrieves the path of the cookie, if set- Returns:
- The cookie path or null
-
getSecure
public boolean getSecure()
Is this cookie secure?- Returns:
- true if the cookie is secure, false (default) otherwise
-
getValue
public String getValue()
Retrieves the value of the cookie- Returns:
- A String representing the cookies value
-
getVersion
public int getVersion()
Retrieves the version of the cookie- Returns:
- The version of the cookie, -1 if not set
-
setComment
public void setComment(String comment)
Sets the cookies comment to supplied value. Updates underlying cookie implementation if present.- Parameters:
comment- The cookies new comment
-
setDomain
public void setDomain(String domain)
Set the cookie domain to the supplied value. Updates the underlying cookie value if present.- Parameters:
domain- The cookie domain
-
setMaxAge
public void setMaxAge(int expiry)
Sets the cookies maximum age (in seconds since the epoch). Updates the underlying cookie if present.- Parameters:
expiry- The cookies expiry
-
setPath
public void setPath(String uri)
Sets the path of the cookie. Updates the underlying cookie if present.- Parameters:
uri- The new uri path of the cookie
-
setSecure
public void setSecure(boolean secure)
Sets the secure flag of the cookie updating the underlying cookie representation if present.- Parameters:
secure- The new secure flag setting of the cookie
-
setValue
public void setValue(String newValue)
Set the cookie to have a new value, updating the underlying cookie representatio if present.- Parameters:
newValue- The new value of the cookie
-
setVersion
public void setVersion(int version)
Set the version of the cookie, updating the underlying representation if present.- Parameters:
version- the cookie version to set
-
-