org.ccnx.ccn.io.content.LinkAuthenticator Class Reference

A specifier for the information that can be used to authenticate the target of a Link. More...

List of all members.

Public Member Functions

 LinkAuthenticator (PublisherID publisher, Integer nameComponentCount, CCNTime timestamp, SignedInfo.ContentType type, byte[] contentDigest)
 LinkAuthenticator (PublisherID publisher)
 LinkAuthenticator (PublisherPublicKeyDigest publisher)
boolean empty ()
boolean emptyPublisher ()
boolean emptyNameComponentCount ()
boolean emptyContentDigest ()
boolean emptyContentType ()
boolean emptyTimestamp ()
byte[] contentDigest ()
void contentDigest (byte[] hash)
PublisherPublicKeyDigest publisher ()
PublisherID.PublisherType publisherType ()
PublisherID publisherID ()
void publisher (byte[] publisher, PublisherID.PublisherType publisherType)
int nameComponentCount ()
void nameComponentCount (int nameComponentCount)
void clearNameComponentCount ()
CCNTime timestamp ()
void timestamp (CCNTime timestamp)
SignedInfo.ContentType type ()
void type (SignedInfo.ContentType type)
void decode (XMLDecoder decoder) throws ContentDecodingException
 Decode this object as the top-level item in a new XML document, reading it from a network buffer.
void encode (XMLEncoder encoder) throws ContentEncodingException
 Encode this object during an ongoing encoding pass; this is what subclasses generally need to know how to implement.
long getElementLabel ()
 Allow the encoder/decoder to retrieve the top-level element name programmatically.
boolean validate ()
 Make sure all of the necessary fields are filled in prior to attempting to encode.
int hashCode ()
boolean approximates (LinkAuthenticator target)
 Approximately equals -- matches on each field of target that is non-null.
boolean equals (Object obj)
int compareTo (LinkAuthenticator other)
String toString ()
 Default toString() implementation simply prints the text encoding of the object.

Protected Attributes

PublisherID _publisher = null
Integer _nameComponentCount = null
CCNTime _timestamp = null
SignedInfo.ContentType _type = null
byte[] _contentDigest = null

Detailed Description

A specifier for the information that can be used to authenticate the target of a Link.


Member Function Documentation

void org.ccnx.ccn.io.content.LinkAuthenticator.decode ( XMLDecoder  decoder  )  throws ContentDecodingException [virtual]

Decode this object as the top-level item in a new XML document, reading it from a network buffer.

Reads document start and end. Assumes default encoding.

Parameters:
buf input stream to read from
Exceptions:
ContentDecodingException if there is an error decoding the content Decode this object as the top-level item in a new XML document, reading it from a network buffer. Reads document start and end.
Parameters:
buf input stream to read from
codec the codec to use; must be recognized by XMLCodecFactory
Exceptions:
ContentDecodingException if there is an error decoding the content
See also:
XMLCodecFactory Decode this object during an ongoing decoding pass; this is what subclasses generally need to know how to implement. Reads just the object itself, higher-level processes have handled start and end document if need be. Allows object to be read using the same code whether it is a top-level element written alone, or nested inside another element.
Parameters:
decoder the decoder being used; encapsulates state including the codec being used as well as the input source and current offset

Implements org.ccnx.ccn.impl.encoding.GenericXMLEncodable.

void org.ccnx.ccn.io.content.LinkAuthenticator.encode ( XMLEncoder  encoder  )  throws ContentEncodingException [virtual]

Encode this object during an ongoing encoding pass; this is what subclasses generally need to know how to implement.

Writes just the object itself, higher-level processes have handled start and end document if need be. Allows object to be written using the same code whether it is a top-level element written alone, or nested inside another element.

Parameters:
encoder the encoder being used; encapsulates state including the codec being used as well as the output destination and current offset

Implements org.ccnx.ccn.impl.encoding.GenericXMLEncodable.

long org.ccnx.ccn.io.content.LinkAuthenticator.getElementLabel (  )  [virtual]

Allow the encoder/decoder to retrieve the top-level element name programmatically.

This allows subclasses to rename elements without changing their encoder/decoders.

Returns:
the element label to use, as a key in a loaded encoding dictionary

Implements org.ccnx.ccn.impl.encoding.GenericXMLEncodable.

String org.ccnx.ccn.io.content.LinkAuthenticator.toString (  ) 

Default toString() implementation simply prints the text encoding of the object.

This demonstrates how to force use of the text encoding.

Reimplemented from org.ccnx.ccn.impl.encoding.GenericXMLEncodable.

boolean org.ccnx.ccn.io.content.LinkAuthenticator.validate (  )  [virtual]

Make sure all of the necessary fields are filled in prior to attempting to encode.

All implementations of encode(XMLEncoder) should call this for their classes prior to encoding.

Returns:
true if object is valid and can be encoded, false if there is a problem; for example mandatory fields are uninitialized

Implements org.ccnx.ccn.impl.encoding.GenericXMLEncodable.


The documentation for this class was generated from the following file:
Generated on Fri May 13 16:27:46 2011 for Content-Centric Networking in Java by  doxygen 1.6.3