java.lang.Object
net.i2p.router.crypto.TransientSessionKeyManager.TagSet
All Implemented Interfaces:
TagSetHandle
Enclosing class:
TransientSessionKeyManager

private static class TransientSessionKeyManager.TagSetextends Object implements TagSetHandle
One set of session tags sent to a peer.
  • Field Details

    • _sessionTags

      private final Set<SessionTag> _sessionTags
      The tags in this set.
    • _key

      private final SessionKey _key
      Key the tags were encrypted with.
    • _date

      private final long _date
      When the set was created.
    • _id

      private final int _id
      Id identifying the set among those sent.
    • _origSize

      private final int _origSize
      Tag count when the set was created.
    • _acked

      private boolean _acked
      Did we get an ack for this tagset? Only for outbound tagsets.
  • Constructor Details

    • TagSet

      public TagSet(Set<SessionTag> tags, SessionKey key, long date, int id)
      Creates a tag set with its key and expiry.
      Parameters:
      tags - the session tags in the set
      key - the session key the tags belong to
      date - For inbound: when the TagSet will expire; for outbound: creation time
      id - identifies the set among those sent
  • Method Details

    • getDate

      public long getDate()
      For inbound: when the TagSet will expire; for outbound: creation time.
      Returns:
      that timestamp in milliseconds since the epoch, as passed to the constructor
    • getOriginalSize

      public int getOriginalSize()
      Original number of tags in this set before any were consumed.
      Returns:
      the original size
    • getTags

      public Set<SessionTag> getTags()
      The tags still available.
      Returns:
      the unconsumed tags of the set
    • getAssociatedKey

      public SessionKey getAssociatedKey()
      The session key the set belongs to.
      Returns:
      the key for the tags
    • consume

      public void consume(SessionTag tag)
      Marks the tag as used. Caller must synch.
      Parameters:
      tag - the tag to remove from the set
    • consumeNext

      public SessionTag consumeNext()
      For outbound only. Caller must synch.
      Returns:
      a tag or null
    • setAcked

      public void setAcked()
      For outbound only.
    • getAcked

      public boolean getAcked()
      For outbound only.
      Returns:
      true if setAcked() has been called, meaning the peer has acknowledged using these tags
    • getID

      public int getID()
      Unique identifier for this tag set.
      Returns:
      the i d
    • toString

      public String toString()
      Debug string with ID, size, ack status, and key.
      Overrides:
      toString in class Object
      Returns:
      the formatted text