Class ETag

java.lang.Object
org.forgerock.am.cts.api.ETag

public class ETag extends Object
Describes an ETag for a given Token.

ETag instances are used to perform coarse grained optimistic concurrency checks when making changes to tokens stored in the CTS backing implementation.

The ETag is generated based on the contents of the entire token and can be used to assert that no part of the token has been changed between requests.

See Also:
  • Method Details

    • emptyAssertion

      public static ETag emptyAssertion()
      An ETag which does not contain an assertion.

      Use this when you are requesting the ETag value be read by the backing implementation.

      Returns:
      Non null ETag.
    • assertEtag

      public static ETag assertEtag(String token)
      Create an ETag that asserts the given value.
      Parameters:
      token - Non null string representation of the ETag
      Returns:
      Non null ETag which asserts this value
    • getValue

      public String getValue()
      Returns:
      Non null string representation of this ETag.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object