Object to return information associated with a Repository to a repository client. More...
Classes | |
class | GlobalPrefix |
class | RepositoryInfoObject |
A CCNNetworkObject wrapper around RepositoryInfo, used for easily saving and retrieving versioned RepositoryInfos to CCN. More... | |
Public Types | |
enum | RepoInfoType { INFO = ("INFO"), DATA = ("DATA") } |
The two possible types. More... | |
Public Member Functions | |
RepositoryInfo (String version, String globalPrefix, String localName) throws MalformedContentNameStringException | |
The main constructor used to create the information returned by a repository during initialization. | |
RepositoryInfo (String version, ContentName globalPrefix, String localName, String info) throws MalformedContentNameStringException | |
Create String info to return. | |
RepositoryInfo (String version, String globalPrefix, String localName, ArrayList< ContentName > names) throws MalformedContentNameStringException | |
Currently used only to test decoding/encoding. | |
RepositoryInfo (String version, ContentName globalPrefix, String localName, ArrayList< ContentName > names) throws MalformedContentNameStringException | |
This would be used only for the ACK protocol. | |
String | getLocalName () |
Gets the current local name as a slash separated String. | |
ContentName | getGlobalPrefix () |
Gets the current global prefix as a ContentName. | |
synchronized ContentName | getPolicyName () |
Gets the ContentName that would be used to change policy for this repository. | |
String | getInfo () |
Gets String info returned by the repo. | |
RepoInfoType | getType () |
Get the type of information encapsulated in this object (INFO or DATA). | |
String | getRepositoryVersion () |
Gets the repository store version as a String. | |
String | getVersion () |
Get the repository store version as a Double. | |
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 | equals (Object obj) |
Protected Attributes | |
String | _repoVersion = null |
String | _localName = null |
GlobalPrefix | _globalPrefix = null |
ArrayList< ContentName > | _names = new ArrayList<ContentName>() |
ContentName | _policyName |
String | _infoString = null |
RepoInfoType | _type = RepoInfoType.INFO |
Static Protected Attributes | |
static double | _version = 1.1 |
static final HashMap < RepoInfoType, String > | _InfoTypeNames = new HashMap<RepoInfoType, String>() |
Object to return information associated with a Repository to a repository client.
TODO This object was once intended to be used for the currently unimplemented repo ACK protocol also. If we decide to implement the ACK protocol in a different way, the dual use aspects of this object should be removed.
The two possible types.
INFO is to return information, DATA is for the ACK protocol
org.ccnx.ccn.impl.repo.RepositoryInfo.RepositoryInfo | ( | String | version, | |
String | globalPrefix, | |||
String | localName | |||
) | throws MalformedContentNameStringException |
The main constructor used to create the information returned by a repository during initialization.
version | ||
globalPrefix | ||
localName |
MalformedContentNameStringException |
org.ccnx.ccn.impl.repo.RepositoryInfo.RepositoryInfo | ( | String | version, | |
ContentName | globalPrefix, | |||
String | localName, | |||
String | info | |||
) | throws MalformedContentNameStringException |
Create String info to return.
version | ||
globalPrefix | ||
localName | ||
info | - a string with info to return |
MalformedContentNameStringException |
org.ccnx.ccn.impl.repo.RepositoryInfo.RepositoryInfo | ( | String | version, | |
String | globalPrefix, | |||
String | localName, | |||
ArrayList< ContentName > | names | |||
) | throws MalformedContentNameStringException |
Currently used only to test decoding/encoding.
version | ||
globalPrefix | ||
localName | ||
names |
MalformedContentNameStringException |
org.ccnx.ccn.impl.repo.RepositoryInfo.RepositoryInfo | ( | String | version, | |
ContentName | globalPrefix, | |||
String | localName, | |||
ArrayList< ContentName > | names | |||
) | throws MalformedContentNameStringException |
This would be used only for the ACK protocol.
version | ||
globalPrefix | ||
localName | ||
names |
MalformedContentNameStringException |
void org.ccnx.ccn.impl.repo.RepositoryInfo.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.impl.repo.RepositoryInfo.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.impl.repo.RepositoryInfo.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.
ContentName org.ccnx.ccn.impl.repo.RepositoryInfo.getGlobalPrefix | ( | ) |
Gets the current global prefix as a ContentName.
String org.ccnx.ccn.impl.repo.RepositoryInfo.getInfo | ( | ) |
Gets String info returned by the repo.
String org.ccnx.ccn.impl.repo.RepositoryInfo.getLocalName | ( | ) |
Gets the current local name as a slash separated String.
synchronized ContentName org.ccnx.ccn.impl.repo.RepositoryInfo.getPolicyName | ( | ) |
Gets the ContentName that would be used to change policy for this repository.
String org.ccnx.ccn.impl.repo.RepositoryInfo.getRepositoryVersion | ( | ) |
Gets the repository store version as a String.
RepoInfoType org.ccnx.ccn.impl.repo.RepositoryInfo.getType | ( | ) |
Get the type of information encapsulated in this object (INFO or DATA).
String org.ccnx.ccn.impl.repo.RepositoryInfo.getVersion | ( | ) |
Get the repository store version as a Double.
boolean org.ccnx.ccn.impl.repo.RepositoryInfo.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.