Public Member Functions | |
byte[] | getHash () |
ConfigSlice () | |
Used by NetworkObject read constructor. | |
ConfigSlice (ContentName topo, ContentName prefix, Collection< Filter > new_filters) | |
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. | |
Static Public Member Functions | |
static void | checkAndCreate (ContentName topo, ContentName prefix, Collection< Filter > filters, CCNHandle handle) throws ContentDecodingException, IOException |
Check that a sync ConfigSlice exists in the local repository, and if not create one. | |
Public Attributes | |
int | version = SLICE_VERSION |
ContentName | topo |
ContentName | prefix |
Protected Attributes | |
LinkedList< Filter > | filters = new LinkedList<Filter>() |
Classes | |
class | Filter |
Config slice lists require a ConfigSliceOp written before the ContentName, although it does nothing. More... | |
class | NetworkObject |
A ConfigSlice is always saved in the local repository under /localhost/CS.s.cs, so the full name does not need to be passed to the constructors here. More... |
It is always saved to the local repository under the localhost namespace. They are named by the hash of the contents. This leads to slightly different NetworkObject semantics than usual.
void org.ccnx.ccn.io.content.ConfigSlice.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.
buf | input stream to read from |
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. |
buf | input stream to read from | |
codec | the codec to use; must be recognized by XMLCodecFactory |
ContentDecodingException | if there is an error decoding the content |
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.ConfigSlice.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.
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.ConfigSlice.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.
Implements org.ccnx.ccn.impl.encoding.GenericXMLEncodable.
boolean org.ccnx.ccn.io.content.ConfigSlice.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.
Implements org.ccnx.ccn.impl.encoding.GenericXMLEncodable.
static void org.ccnx.ccn.io.content.ConfigSlice.checkAndCreate | ( | ContentName | topo, | |
ContentName | prefix, | |||
Collection< Filter > | filters, | |||
CCNHandle | handle | |||
) | throws ContentDecodingException, IOException [static] |
Check that a sync ConfigSlice exists in the local repository, and if not create one.
handle | ||
topo | from ConfigSlice | |
prefix | from ConfigSlice | |
filters | from ConfigSlice |
IOException |