java.lang.Object
net.i2p.router.crypto.TransientSessionKeyManager.TagSet
- All Implemented Interfaces:
TagSetHandle
- Enclosing class:
TransientSessionKeyManager
One set of session tags sent to a peer.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanDid we get an ack for this tagset? Only for outbound tagsets.private final longWhen the set was created.private final intId identifying the set among those sent.private final SessionKeyKey the tags were encrypted with.private final intTag count when the set was created.private final Set<SessionTag> The tags in this set.Constructor Summary
ConstructorsConstructorDescriptionTagSet(Set<SessionTag> tags, SessionKey key, long date, int id) Creates a tag set with its key and expiry.Method Summary
All MethodsModifier and TypeMethodDescriptionvoidconsume(SessionTag tag) Marks the tag as used.For outbound only.booleangetAcked()For outbound only.The session key the set belongs to.longgetDate()For inbound: when the TagSet will expire; for outbound: creation time.intgetID()Unique identifier for this tag set.intOriginal number of tags in this set before any were consumed.getTags()The tags still available.voidsetAcked()For outbound only.toString()Debug string with ID, size, ack status, and key.
Field Details
_sessionTags
The tags in this set._key
Key the tags were encrypted with._date
private final long _dateWhen the set was created._id
private final int _idId identifying the set among those sent._origSize
private final int _origSizeTag count when the set was created._acked
private boolean _ackedDid we get an ack for this tagset? Only for outbound tagsets.
Constructor Details
TagSet
Creates a tag set with its key and expiry.- Parameters:
tags- the session tags in the setkey- the session key the tags belong todate- For inbound: when the TagSet will expire; for outbound: creation timeid- 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
getAssociatedKey
consume
Marks the tag as used. Caller must synch.- Parameters:
tag- the tag to remove from the set
consumeNext
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