net.named_data.jndn
public class Interest extends Object implements ChangeCountable
| Modifier and Type | Field and Description |
|---|---|
static int |
ANSWER_CONTENT_STORE |
static int |
ANSWER_GENERATED |
static int |
ANSWER_NO_CONTENT_STORE |
static int |
ANSWER_STALE |
static int |
CHILD_SELECTOR_LEFT |
static int |
CHILD_SELECTOR_RIGHT |
static int |
DEFAULT_ANSWER_ORIGIN_KIND |
static int |
MARK_STALE |
| 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 |
|---|---|
int |
getAnswerOriginKind()
Deprecated.
Use getMustBeFresh.
|
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 of the local control header.
|
double |
getInterestLifetimeMilliseconds() |
KeyLocator |
getKeyLocator() |
int |
getMaxSuffixComponents() |
int |
getMinSuffixComponents() |
boolean |
getMustBeFresh()
Get the must be fresh flag.
|
Name |
getName() |
long |
getNextHopFaceId()
Get the next hop face ID.
|
Blob |
getNonce()
Return the nonce value from the incoming interest.
|
PublisherPublicKeyDigest |
getPublisherPublicKeyDigest()
Deprecated.
The Interest publisherPublicKeyDigest is deprecated. If you
need a publisher public key digest, set the keyLocator keyLocatorType to
KEY_LOCATOR_DIGEST and set its key data to the digest.
|
int |
getScope() |
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.
|
Interest |
setAnswerOriginKind(int answerOriginKind)
Deprecated.
Use setMustBeFresh.
|
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 |
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 |
setScope(int scope)
Set the interest scope.
|
String |
toUri()
Encode the name according to the "NDN URI Scheme".
|
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 static final int ANSWER_NO_CONTENT_STORE
public static final int ANSWER_CONTENT_STORE
public static final int ANSWER_GENERATED
public static final int ANSWER_STALE
public static final int MARK_STALE
public static final int DEFAULT_ANSWER_ORIGIN_KIND
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 PublisherPublicKeyDigest getPublisherPublicKeyDigest()
public final KeyLocator getKeyLocator()
public final Exclude getExclude()
public final int getChildSelector()
public final int getAnswerOriginKind()
public final boolean getMustBeFresh()
public final int getScope()
public final double getInterestLifetimeMilliseconds()
public final Blob getNonce()
public final long getIncomingFaceId()
public final long getNextHopFaceId()
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 setAnswerOriginKind(int answerOriginKind)
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 setScope(int scope)
scope - The interest scope. If not specified, set to -1.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 boolean matchesName(Name name)
name - The name to check.public final SignedBlob getDefaultWireEncoding()
public final long getChangeCount()
getChangeCount in interface ChangeCountableCopyright © 2015. All rights reserved.