com.ibm.commerce.component.contextservice

Class ActivityToken

  • java.lang.Object
    • com.ibm.commerce.component.contextservice.ActivityToken
  • All Implemented Interfaces:
    java.io.Serializable


    public class ActivityToken
    extends java.lang.Object
    implements java.io.Serializable
    An activity token is a crpytographically signed identifier for an activity. It consists of two parts: an activity GUID and a hashed signature of the GUID. It is passed around as a handle for an activity.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      IBM copyright notice field.
      static java.lang.String STR_CLASS_NAME
      The name of the class
    • Constructor Summary

      Constructors 
      Constructor and Description
      ActivityToken()
      The do-nothing zero-argument constructor.
      ActivityToken(com.ibm.commerce.component.contextservice.ActivityGUID guid, java.lang.String strSignature)
      Constructs an activity token from a given GUID and signature.
      ActivityToken(java.lang.String str)
      Constructs an activity token from a given string representation of an activity token.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean checkTransient()
      Checks whether this token is a transient cloned token.
      com.ibm.commerce.component.contextservice.ActivityGUID getActivityGUID()
      Gets this token's activity GUID.
      int getCloneCounter()
      Reserved for IBM internal use.
      java.lang.String getSignature()
      Gets this token's signature.
      boolean isTemporary()
      Checks whether this token is temporary.
      boolean isTemporaryLock()
      Checks whether subsequent requests can change this token's temporary status.
      void setActivityGUID(com.ibm.commerce.component.contextservice.ActivityGUID guid)
      Sets this token's activity GUID.
      void setCloneCounter(int count)
      Reserved for IBM internal use.
      void setSignature(java.lang.String strSignature)
      Sets this token's signaure.
      void setTemporary(boolean bool)
      Sets whether this token is temporary.
      void setTemporaryLock(boolean bool)
      Sets whether subsequent requests can change this token's temporary status.
      java.lang.String toString()
      Returns the string representation of this activity token, which is its activity GUID and signature separated by a colon (":").
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM copyright notice field.
        See Also:
        Constant Field Values
      • STR_CLASS_NAME

        public static final java.lang.String STR_CLASS_NAME
        The name of the class
        See Also:
        Constant Field Values
    • Constructor Detail

      • ActivityToken

        public ActivityToken()
        The do-nothing zero-argument constructor.
      • ActivityToken

        public ActivityToken(com.ibm.commerce.component.contextservice.ActivityGUID guid,
                             java.lang.String strSignature)
        Constructs an activity token from a given GUID and signature.
        Parameters:
        guid - the activity GUID
        strSignature - hashed signature of the GUID
      • ActivityToken

        public ActivityToken(java.lang.String str)
        Constructs an activity token from a given string representation of an activity token.
        Parameters:
        str - the string representation of an activity token
        See Also:
        toString()
    • Method Detail

      • getActivityGUID

        public com.ibm.commerce.component.contextservice.ActivityGUID getActivityGUID()
        Gets this token's activity GUID.
        Returns:
        this token's activity GUID
      • getSignature

        public java.lang.String getSignature()
        Gets this token's signature.
        Returns:
        this token's hashed signature of the GUID
      • setActivityGUID

        public void setActivityGUID(com.ibm.commerce.component.contextservice.ActivityGUID guid)
        Sets this token's activity GUID.
        Parameters:
        guid - the GUID value
      • setSignature

        public void setSignature(java.lang.String strSignature)
        Sets this token's signaure.
        Parameters:
        strSignature - the hashed signature value
      • toString

        public java.lang.String toString()
        Returns the string representation of this activity token, which is its activity GUID and signature separated by a colon (":"). Overrides the default implementation of toString().
        Overrides:
        toString in class java.lang.Object
        Returns:
        the string representation of this token
      • setTemporary

        public void setTemporary(boolean bool)
        Sets whether this token is temporary. If the token is marked as temporary, no record in the CTXMGMT table or any of its associated CTXDATA will be created.
        Parameters:
        bool - true for temporary; false otherwise
      • isTemporary

        public boolean isTemporary()
        Checks whether this token is temporary.
        Returns:
        true if the token is temporary; false otherwise
        See Also:
        setTemporary(boolean)
      • setTemporaryLock

        public void setTemporaryLock(boolean bool)
        Sets whether subsequent requests can change this token's temporary status.
        Parameters:
        bool - true if they can't (the status is locked); false otherwise
      • isTemporaryLock

        public boolean isTemporaryLock()
        Checks whether subsequent requests can change this token's temporary status.
        Returns:
        true if they can't (the status is locked); false otherwise
      • setCloneCounter

        public void setCloneCounter(int count)
        Reserved for IBM internal use.

        Sets the clone counter to the specified value.

        Parameters:
        count - The clone number.
      • getCloneCounter

        public int getCloneCounter()
        Reserved for IBM internal use.

        Returns the number of clones that exist for this activity.

        Returns:
        Returns the clone counter of this activity. If this is not a clone, returns 0.
      • checkTransient

        public boolean checkTransient()
        Checks whether this token is a transient cloned token.
        Returns:
        true if it is; false otherwise