net.named_data.jndn
public class Interest extends Object implements ChangeCountable
Modifier and Type | Field and Description |
---|---|
static int |
CHILD_SELECTOR_LEFT |
static int |
CHILD_SELECTOR_RIGHT |
Constructor and Description |
---|
Interest()
Create a new Interest with an empty name and "none" for all values.
|
Interest(Interest interest)
Create a new interest as a deep copy of the given interest.
|
Interest(Name name)
Create a new Interest with the given name and "none" for other values.
|
Interest(Name name,
double interestLifetimeMilliseconds)
Create a new Interest with the given name and interest lifetime and "none"
for other values.
|
Modifier and Type | Method and Description |
---|---|
long |
getChangeCount()
Get the change count, which is incremented each time this object
(or a child object) is changed.
|
int |
getChildSelector() |
SignedBlob |
getDefaultWireEncoding()
Return a pointer to the defaultWireEncoding, which was encoded with
getDefaultWireEncodingFormat().
|
Exclude |
getExclude() |
long |
getIncomingFaceId()
Get the incoming face ID according to the incoming packet header.
|
double |
getInterestLifetimeMilliseconds() |
KeyLocator |
getKeyLocator() |
Link |
getLink()
Get the link object.
|
Blob |
getLinkWireEncoding()
Get the wire encoding of the link object.
|
Blob |
getLinkWireEncoding(WireFormat wireFormat)
Get the wire encoding of the link object.
|
int |
getMaxSuffixComponents() |
int |
getMinSuffixComponents() |
boolean |
getMustBeFresh()
Get the must be fresh flag.
|
Name |
getName() |
Blob |
getNonce()
Return the nonce value from the incoming interest.
|
int |
getSelectedDelegationIndex()
Get the selected delegation index.
|
boolean |
hasLink()
Check if this interest has a link object (or a link wire encoding which
can be decoded to make the link object).
|
boolean |
matchesName(Name name)
Check if this Interest's name matches the given name (using Name.match)
and the given name also conforms to the interest selectors.
|
void |
refreshNonce()
Update the bytes of the nonce with new random values.
|
Interest |
setChildSelector(int childSelector)
Set the child selector.
|
Interest |
setExclude(Exclude exclude)
Set this interest to use a copy of the given Exclude object.
|
Interest |
setInterestLifetimeMilliseconds(double interestLifetimeMilliseconds)
Set the interest lifetime.
|
Interest |
setKeyLocator(KeyLocator keyLocator)
Set this interest to use a copy of the given KeyLocator object.
|
Interest |
setLinkWireEncoding(Blob encoding)
Set the link wire encoding bytes, without decoding them.
|
Interest |
setLinkWireEncoding(Blob encoding,
WireFormat wireFormat)
Set the link wire encoding bytes, without decoding them.
|
Interest |
setMaxSuffixComponents(int maxSuffixComponents)
Set the max suffix components count.
|
Interest |
setMinSuffixComponents(int minSuffixComponents)
Set the min suffix components count.
|
Interest |
setMustBeFresh(boolean mustBeFresh)
Set the MustBeFresh flag.
|
Interest |
setName(Name name)
Set the interest name.
|
Interest |
setNonce(Blob nonce)
Deprecated.
You should let the wire encoder generate a random nonce
internally before sending the interest.
|
Interest |
setSelectedDelegationIndex(int selectedDelegationIndex)
Set the selected delegation index.
|
String |
toUri()
Encode the name according to the "NDN URI Scheme".
|
Interest |
unsetLink()
Clear the link wire encoding and link object so that getLink() returns null.
|
void |
wireDecode(Blob input)
Decode the input using the default wire format
WireFormat.getDefaultWireFormat() and update this Interest.
|
void |
wireDecode(Blob input,
WireFormat wireFormat)
Decode the input using a particular wire format and update this Interest.
|
void |
wireDecode(ByteBuffer input)
Decode the input using the default wire format
WireFormat.getDefaultWireFormat() and update this Interest.
|
void |
wireDecode(ByteBuffer input,
WireFormat wireFormat)
Decode the input using a particular wire format and update this Interest.
|
SignedBlob |
wireEncode()
Encode this Interest for the default wire format
WireFormat.getDefaultWireFormat().
|
SignedBlob |
wireEncode(WireFormat wireFormat)
Encode this Interest for a particular wire format.
|
public static final int CHILD_SELECTOR_LEFT
public static final int CHILD_SELECTOR_RIGHT
public Interest(Name name, double interestLifetimeMilliseconds)
name
- The name for the interest.interestLifetimeMilliseconds
- The interest lifetime in milliseconds,
or -1 for none.public Interest(Name name)
name
- The name for the interest.public Interest(Interest interest)
interest
- The interest to copy.public Interest()
public final SignedBlob wireEncode(WireFormat wireFormat)
wireFormat
- A WireFormat object used to encode this Interest.public final SignedBlob wireEncode()
public final void wireDecode(ByteBuffer input, WireFormat wireFormat) throws EncodingException
input
- The input buffer to decode. This reads from position() to
limit(), but does not change the position.wireFormat
- A WireFormat object used to decode the input.EncodingException
- For invalid encoding.public final void wireDecode(ByteBuffer input) throws EncodingException
input
- The input buffer to decode. This reads from position() to
limit(), but does not change the position.EncodingException
- For invalid encoding.public final void wireDecode(Blob input, WireFormat wireFormat) throws EncodingException
input
- The input blob to decode.wireFormat
- A WireFormat object used to decode the input.EncodingException
- For invalid encoding.public final void wireDecode(Blob input) throws EncodingException
input
- The input blob to decode.EncodingException
- For invalid encoding.public final String toUri()
public final Name getName()
public final int getMinSuffixComponents()
public final int getMaxSuffixComponents()
public final KeyLocator getKeyLocator()
public final Exclude getExclude()
public final int getChildSelector()
public final boolean getMustBeFresh()
public final double getInterestLifetimeMilliseconds()
public final Blob getNonce()
public final boolean hasLink()
public final Link getLink() throws EncodingException
EncodingException
- For error decoding the link wire encoding (if
necessary).public final Blob getLinkWireEncoding(WireFormat wireFormat) throws EncodingException
wireFormat
- The desired wire format for the encoding.EncodingException
- for error encoding the link object.public final Blob getLinkWireEncoding() throws EncodingException
EncodingException
- for error encoding the link object.public final int getSelectedDelegationIndex()
public final long getIncomingFaceId()
public final Interest setName(Name name)
name
- The interest name. This makes a copy of the name.public final Interest setMinSuffixComponents(int minSuffixComponents)
minSuffixComponents
- The min suffix components count. If not
specified, set to -1.public final Interest setMaxSuffixComponents(int maxSuffixComponents)
maxSuffixComponents
- The max suffix components count. If not
specified, set to -1.public final Interest setChildSelector(int childSelector)
childSelector
- The child selector. If not specified, set to -1.public final Interest setMustBeFresh(boolean mustBeFresh)
mustBeFresh
- True if the content must be fresh, otherwise false. If
you do not set this flag, the default value is true.public final Interest setInterestLifetimeMilliseconds(double interestLifetimeMilliseconds)
interestLifetimeMilliseconds
- The interest lifetime in milliseconds.
If not specified, set to -1.public final Interest setNonce(Blob nonce)
public final Interest setKeyLocator(KeyLocator keyLocator)
keyLocator
- The KeyLocator object. This makes a copy of the object.
If no key locator is specified, set to a new default KeyLocator(), or to a
KeyLocator with an unspecified type.public final Interest setExclude(Exclude exclude)
exclude
- The Exclude object. This makes a copy of the object. If no
exclude is specified, set to a new default Exclude(), or to an Exclude with
size() 0.public final Interest setLinkWireEncoding(Blob encoding, WireFormat wireFormat)
encoding
- The buffer with the bytes of the link wire encoding.
If no link is specified, set to an empty Blob() or call unsetLink().wireFormat
- The wire format of the encoding, to be used later if
necessary to decode.public final Interest setLinkWireEncoding(Blob encoding)
encoding
- The buffer with the bytes of the link wire encoding.
If no link is specified, set to an empty Blob().public final Interest unsetLink()
public final Interest setSelectedDelegationIndex(int selectedDelegationIndex)
selectedDelegationIndex
- The selected delegation index. If not
specified, set to -1.public final void refreshNonce()
public final boolean matchesName(Name name)
name
- The name to check.public final SignedBlob getDefaultWireEncoding()
public final long getChangeCount()
getChangeCount
in interface ChangeCountable
Copyright © 2016. All rights reserved.