Class JESpace.Ref

java.lang.Object
org.jpos.space.JESpace.Ref
Enclosing class:
JESpace<K,V>

@Entity public static class JESpace.Ref extends Object
Persistent entity representing a single space entry (key/value with optional expiration).
Since:
1.6.5
  • Constructor Summary

    Constructors
    Constructor
    Description
    Ref()
    Default constructor required by BerkeleyDB JE.
    Ref(String key, Object value, long timeout)
    Constructs a Ref for the given key, value and timeout.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Returns the expiration timestamp in epoch milliseconds.
    long
    Returns the primary key id of this Ref.
    Returns the space key of this Ref.
    Returns the deserialized value of this Ref.
    boolean
    Returns true if this Ref has an expiration set.
    boolean
    Returns true if this Ref has not yet expired.
    boolean
    Returns true if this Ref has passed its expiration time.
    void
    Negates the id to push this entry to the front of an ordered scan (push semantics).

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Ref

      public Ref()
      Default constructor required by BerkeleyDB JE.
    • Ref

      public Ref(String key, Object value, long timeout)
      Constructs a Ref for the given key, value and timeout.
      Parameters:
      key - the space key
      value - the value to store
      timeout - timeout in milliseconds, or 0 for no expiration
  • Method Details

    • getId

      public long getId()
      Returns the primary key id of this Ref.
      Returns:
      the primary key
    • reverseId

      public void reverseId()
      Negates the id to push this entry to the front of an ordered scan (push semantics).
    • isExpired

      public boolean isExpired()
      Returns true if this Ref has passed its expiration time.
      Returns:
      true if expired
    • isActive

      public boolean isActive()
      Returns true if this Ref has not yet expired.
      Returns:
      true if still active
    • getKey

      public Object getKey()
      Returns the space key of this Ref.
      Returns:
      the key string
    • getValue

      public Object getValue()
      Returns the deserialized value of this Ref.
      Returns:
      the stored value
    • getExpiration

      public long getExpiration()
      Returns the expiration timestamp in epoch milliseconds.
      Returns:
      expiration time, or 0 if no expiration is set
    • hasExpiration

      public boolean hasExpiration()
      Returns true if this Ref has an expiration set.
      Returns:
      true if an expiration time is set