Package org.wildfly.security.http.util
Class SimpleHttpServerCookie
- java.lang.Object
-
- org.wildfly.security.http.util.SimpleHttpServerCookie
-
- All Implemented Interfaces:
HttpServerCookie
public class SimpleHttpServerCookie extends Object implements HttpServerCookie
A simple implementation ofHttpServerCookie
.- Author:
- Darran Lofthouse
-
-
Constructor Summary
Constructors Constructor Description SimpleHttpServerCookie(String name, String value, String domain, int maxAge, String path, boolean secure, int version, boolean httpOnly)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDomain()
Gets the domain name of this cookie.int
getMaxAge()
Gets the maximum age in seconds of this Cookie.String
getName()
Returns the name of the cookie.String
getPath()
Returns the path on the server to which the browser returns this cookie.String
getValue()
Returns the current value of this cookie.int
getVersion()
Returns the version of the protocol this cookie complies with.boolean
isHttpOnly()
Checks whether this cookie has been marked as HttpOnly.boolean
isSecure()
Returnstrue
if the browser is sending cookies only over a secure protocol, orfalse
if the browser can send cookies using any protocol.static HttpServerCookie
newInstance(String name, String value, String domain, int maxAge, String path, boolean secure, int version, boolean httpOnly)
-
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:HttpServerCookie
Returns the name of the cookie.- Specified by:
getName
in interfaceHttpServerCookie
- Returns:
- the name of the cookie
-
getValue
public String getValue()
Description copied from interface:HttpServerCookie
Returns the current value of this cookie.- Specified by:
getValue
in interfaceHttpServerCookie
- Returns:
- the current value of this cookie
-
getDomain
public String getDomain()
Description copied from interface:HttpServerCookie
Gets the domain name of this cookie.- Specified by:
getDomain
in interfaceHttpServerCookie
- Returns:
- the domain name of this cookie
-
getMaxAge
public int getMaxAge()
Description copied from interface:HttpServerCookie
Gets the maximum age in seconds of this Cookie.- Specified by:
getMaxAge
in interfaceHttpServerCookie
- Returns:
- an integer specifying the maximum age of the cookie in seconds
-
getPath
public String getPath()
Description copied from interface:HttpServerCookie
Returns the path on the server to which the browser returns this cookie.- Specified by:
getPath
in interfaceHttpServerCookie
- Returns:
- a
String
specifying a path on the server
-
isSecure
public boolean isSecure()
Description copied from interface:HttpServerCookie
Returnstrue
if the browser is sending cookies only over a secure protocol, orfalse
if the browser can send cookies using any protocol.- Specified by:
isSecure
in interfaceHttpServerCookie
- Returns:
true
if the browser uses a secure protocol,false
otherwise
-
getVersion
public int getVersion()
Description copied from interface:HttpServerCookie
Returns the version of the protocol this cookie complies with.- Specified by:
getVersion
in interfaceHttpServerCookie
- Returns:
- the version of the protocol this cookie complies with.
-
isHttpOnly
public boolean isHttpOnly()
Description copied from interface:HttpServerCookie
Checks whether this cookie has been marked as HttpOnly.- Specified by:
isHttpOnly
in interfaceHttpServerCookie
- Returns:
- true if this cookie has been marked as HttpOnly, false otherwise
-
newInstance
public static HttpServerCookie newInstance(String name, String value, String domain, int maxAge, String path, boolean secure, int version, boolean httpOnly)
-
-