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 StringgetDomain()Gets the domain name of this cookie.intgetMaxAge()Gets the maximum age in seconds of this Cookie.StringgetName()Returns the name of the cookie.StringgetPath()Returns the path on the server to which the browser returns this cookie.StringgetValue()Returns the current value of this cookie.intgetVersion()Returns the version of the protocol this cookie complies with.booleanisHttpOnly()Checks whether this cookie has been marked as HttpOnly.booleanisSecure()Returnstrueif the browser is sending cookies only over a secure protocol, orfalseif the browser can send cookies using any protocol.static HttpServerCookienewInstance(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:HttpServerCookieReturns the name of the cookie.- Specified by:
getNamein interfaceHttpServerCookie- Returns:
- the name of the cookie
-
getValue
public String getValue()
Description copied from interface:HttpServerCookieReturns the current value of this cookie.- Specified by:
getValuein interfaceHttpServerCookie- Returns:
- the current value of this cookie
-
getDomain
public String getDomain()
Description copied from interface:HttpServerCookieGets the domain name of this cookie.- Specified by:
getDomainin interfaceHttpServerCookie- Returns:
- the domain name of this cookie
-
getMaxAge
public int getMaxAge()
Description copied from interface:HttpServerCookieGets the maximum age in seconds of this Cookie.- Specified by:
getMaxAgein interfaceHttpServerCookie- Returns:
- an integer specifying the maximum age of the cookie in seconds
-
getPath
public String getPath()
Description copied from interface:HttpServerCookieReturns the path on the server to which the browser returns this cookie.- Specified by:
getPathin interfaceHttpServerCookie- Returns:
- a
Stringspecifying a path on the server
-
isSecure
public boolean isSecure()
Description copied from interface:HttpServerCookieReturnstrueif the browser is sending cookies only over a secure protocol, orfalseif the browser can send cookies using any protocol.- Specified by:
isSecurein interfaceHttpServerCookie- Returns:
trueif the browser uses a secure protocol,falseotherwise
-
getVersion
public int getVersion()
Description copied from interface:HttpServerCookieReturns the version of the protocol this cookie complies with.- Specified by:
getVersionin interfaceHttpServerCookie- Returns:
- the version of the protocol this cookie complies with.
-
isHttpOnly
public boolean isHttpOnly()
Description copied from interface:HttpServerCookieChecks whether this cookie has been marked as HttpOnly.- Specified by:
isHttpOnlyin 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)
-
-