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.
|
Interest(String uri)
Create a new Interest with a Name from the given URI string, and "none" for
other values.
|
| Modifier and Type | Method and Description |
|---|---|
Interest |
appendParametersDigestToName()
Append the digest of the application parameters to the Name as a
ParametersSha256DigestComponent.
|
Blob |
getApplicationParameters()
Get the application parameters.
|
boolean |
getCanBePrefix()
Get the CanBePrefix flag.
|
long |
getChangeCount()
Get the change count, which is incremented each time this object
(or a child object) is changed.
|
int |
getChildSelector() |
static boolean |
getDefaultCanBePrefix()
Get the default value of the CanBePrefix flag used in the Interest
constructor.
|
SignedBlob |
getDefaultWireEncoding()
Return a pointer to the defaultWireEncoding, which was encoded with
getDefaultWireEncodingFormat().
|
boolean |
getDidSetCanBePrefix_()
This internal library method gets didSetCanBePrefix_ which is set true when
the application calls setCanBePrefix(), or if the application had already
called setDefaultCanBePrefix() before creating the Interest.
|
Exclude |
getExclude() |
DelegationSet |
getForwardingHint()
Get the forwarding hint object which you can modify to add or remove
forwarding hints.
|
long |
getIncomingFaceId()
Get the incoming face ID according to the incoming packet header.
|
double |
getInterestLifetimeMilliseconds() |
KeyLocator |
getKeyLocator() |
Link |
getLink()
Deprecated.
Use getForwardingHint.
|
Blob |
getLinkWireEncoding()
Deprecated.
Use getForwardingHint.
|
Blob |
getLinkWireEncoding(WireFormat wireFormat)
Deprecated.
Use getForwardingHint.
|
int |
getMaxSuffixComponents() |
int |
getMinSuffixComponents() |
boolean |
getMustBeFresh()
Get the must be fresh flag.
|
Name |
getName() |
Blob |
getNonce()
Return the nonce value from the incoming interest.
|
Blob |
getParameters()
Deprecated.
Use getApplicationParameters.
|
int |
getSelectedDelegationIndex()
Deprecated.
Use getForwardingHint.
|
boolean |
hasApplicationParameters()
Check if the application parameters are specified.
|
boolean |
hasLink()
Deprecated.
Use getForwardingHint.
|
boolean |
hasParameters()
Deprecated.
Use hasApplicationParameters.
|
boolean |
matchesData(Data data)
Check if the given Data packet can satisfy this Interest.
|
boolean |
matchesData(Data data,
WireFormat wireFormat)
Check if the given Data packet can satisfy this Interest.
|
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 |
setApplicationParameters(Blob applicationParameters)
Set the application parameters to the given value.
|
Interest |
setCanBePrefix(boolean canBePrefix)
Set the CanBePrefix flag.
|
Interest |
setChildSelector(int childSelector)
Set the child selector.
|
static void |
setDefaultCanBePrefix(boolean defaultCanBePrefix)
Set the default value of the CanBePrefix flag used in the Interest
constructor.
|
Interest |
setExclude(Exclude exclude)
Set this interest to use a copy of the given Exclude object.
|
Interest |
setForwardingHint(DelegationSet forwardingHint)
Set this interest to use a copy of the given DelegationSet object as the
forwarding hint.
|
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)
Deprecated.
Use setForwardingHint.
|
Interest |
setLinkWireEncoding(Blob encoding,
WireFormat wireFormat)
Deprecated.
Use setForwardingHint.
|
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 |
setParameters(Blob applicationParameters)
Deprecated.
Use setApplicationParameters.
|
Interest |
setSelectedDelegationIndex(int selectedDelegationIndex)
Deprecated.
Use setForwardingHint.
|
String |
toUri()
Encode the name according to the "NDN URI Scheme".
|
Interest |
unsetLink()
Deprecated.
Use setForwardingHint.
|
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(String uri)
uri - The URI string.public Interest(Interest interest)
interest - The interest to copy.public Interest()
public static boolean getDefaultCanBePrefix()
public static void setDefaultCanBePrefix(boolean defaultCanBePrefix)
defaultCanBePrefix - The default value of the CanBePrefix flag.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 boolean getCanBePrefix()
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 DelegationSet getForwardingHint()
public final boolean hasApplicationParameters()
public final boolean hasParameters()
public final Blob getApplicationParameters()
public final Blob getParameters()
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 setCanBePrefix(boolean canBePrefix)
canBePrefix - True if the Interest name can be a prefix.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 setForwardingHint(DelegationSet forwardingHint)
forwardingHint - The DelegationSet object to use as the forwarding
hint. This makes a copy of the object. If no forwarding hint is specified,
set to a new default DelegationSet() with no entries.public final Interest setApplicationParameters(Blob applicationParameters)
applicationParameters - The application parameters Blob.public final Interest setParameters(Blob applicationParameters)
public final Interest appendParametersDigestToName()
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 boolean matchesData(Data data, WireFormat wireFormat)
data - The Data packet to check.wireFormat - A WireFormat object used to encode the Data packet to
get its full Name.public final boolean matchesData(Data data)
data - The Data packet to check.public final SignedBlob getDefaultWireEncoding()
public final long getChangeCount()
getChangeCount in interface ChangeCountablepublic boolean getDidSetCanBePrefix_()
Copyright © 2019. All rights reserved.