org.ccnx.ccn.impl.repo.RepositoryInfo Class Reference

Object to return information associated with a Repository to a repository client. More...

List of all members.

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>()

Detailed Description

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.


Member Enumeration Documentation

The two possible types.

INFO is to return information, DATA is for the ACK protocol


Constructor & Destructor Documentation

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.

Parameters:
version 
globalPrefix 
localName 
Exceptions:
MalformedContentNameStringException 
org.ccnx.ccn.impl.repo.RepositoryInfo.RepositoryInfo ( String  version,
ContentName  globalPrefix,
String  localName,
String  info 
) throws MalformedContentNameStringException

Create String info to return.

Parameters:
version 
globalPrefix 
localName 
info - a string with info to return
Exceptions:
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.

Parameters:
version 
globalPrefix 
localName 
names 
Exceptions:
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.

Parameters:
version 
globalPrefix 
localName 
names 
Exceptions:
MalformedContentNameStringException 

Member Function Documentation

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.

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.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.

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.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.

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

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

ContentName org.ccnx.ccn.impl.repo.RepositoryInfo.getGlobalPrefix (  ) 

Gets the current global prefix as a ContentName.

Returns:
the prefix
String org.ccnx.ccn.impl.repo.RepositoryInfo.getInfo (  ) 

Gets String info returned by the repo.

Returns:
String org.ccnx.ccn.impl.repo.RepositoryInfo.getLocalName (  ) 

Gets the current local name as a slash separated String.

Returns:
the local name
synchronized ContentName org.ccnx.ccn.impl.repo.RepositoryInfo.getPolicyName (  ) 

Gets the ContentName that would be used to change policy for this repository.

Returns:
the name
String org.ccnx.ccn.impl.repo.RepositoryInfo.getRepositoryVersion (  ) 

Gets the repository store version as a String.

Returns:
the version
RepoInfoType org.ccnx.ccn.impl.repo.RepositoryInfo.getType (  ) 

Get the type of information encapsulated in this object (INFO or DATA).

Returns:
String org.ccnx.ccn.impl.repo.RepositoryInfo.getVersion (  ) 

Get the repository store version as a Double.

Returns:
the version
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.

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:40 2011 for Content-Centric Networking in Java by  doxygen 1.6.3