Class SetCookie2Header


@Deprecated(forRemoval=true, since="26.2.0") public class SetCookie2Header extends AbstractSetCookieHeader
Deprecated, for removal: This API element is subject to removal in a future version.
This header is no longer supported by browsers. Use SetCookieHeader instead.
Processes the Set-Cookie2 request message header, defined in RFC 2965. Note thatSet-Cookie2 is obsolete by RFC 6265. Although it may still work in some browsers, its use is discouraged. Use Set-Cookie instead.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Deprecated, for removal: This API element is subject to removal in a future version.
    The name of this header.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructs a new Set-Cookie2 with the provided cookies.
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the unmodifiable list of cookies.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the name of the header, as it would canonically appear within an HTTP message.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the header as a list of strings.
    valueOf(String value)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructs a new header, initialized from the specified string value.
    valueOf(List<String> values)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructs a new header, initialized from the specified list of Set-Cookie2 values.
    valueOf(Response response)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructs a new header, initialized from the specified response message.

    Methods inherited from class org.forgerock.http.protocol.Header

    equals, getFirstValue, hashCode, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • NAME

      public static final String NAME
      Deprecated, for removal: This API element is subject to removal in a future version.
      The name of this header.
      See Also:
  • Constructor Details

    • SetCookie2Header

      public SetCookie2Header(List<Cookie> cookies)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructs a new Set-Cookie2 with the provided cookies.
      Parameters:
      cookies - The cookies.
  • Method Details

    • valueOf

      public static SetCookie2Header valueOf(String value) throws MalformedHeaderException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructs a new header, initialized from the specified string value. Note that multiple cookies could be set in a string.
      Parameters:
      value - The value to initialize the header from.
      Returns:
      The parsed header.
      Throws:
      MalformedHeaderException - If the header is malformed.
    • valueOf

      public static SetCookie2Header valueOf(Response response) throws MalformedHeaderException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructs a new header, initialized from the specified response message.
      Parameters:
      response - The response message to initialize the header from.
      Returns:
      The parsed header.
      Throws:
      MalformedHeaderException - If the header is malformed.
    • valueOf

      public static SetCookie2Header valueOf(List<String> values) throws MalformedHeaderException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructs a new header, initialized from the specified list of Set-Cookie2 values. Note that the values could contain multiple cookies in a string.
      Parameters:
      values - The values to initialize the header from.
      Returns:
      The parsed header.
      Throws:
      MalformedHeaderException - If the header is malformed.
    • getName

      public String getName()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: Header
      Returns the name of the header, as it would canonically appear within an HTTP message.
      Specified by:
      getName in class Header
      Returns:
      The name of the header, as it would canonically appear within an HTTP message.
    • getValues

      public List<String> getValues()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: Header
      Returns the header as a list of strings. If the header has no values then it must return an empty list, never null. Each String should represent the value component of the key-value pair that makes up the HTTP header - as such, for some Header implementations each String in this List may contain multiple token-separated values.

      The List returned from this method should not be expected to be mutable. However, some subclasses of Header may choose to implement it as such.

      Specified by:
      getValues in class Header
      Returns:
      The header as a non-null list of string values. Can be an empty list.
    • getCookies

      public List<Cookie> getCookies()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the unmodifiable list of cookies.
      Specified by:
      getCookies in class AbstractSetCookieHeader
      Returns:
      The unmodifiable list of cookies.