A CCNNetworkObject wrapper around RepositoryInfo, used for easily saving and retrieving versioned RepositoryInfos to CCN. More...
Public Member Functions | |
RepositoryInfoObject (ContentName name, CCNHandle handle) throws ContentDecodingException, IOException | |
Read constructor. | |
RepositoryInfoObject (ContentName name, PublisherPublicKeyDigest publisher, CCNHandle handle) throws ContentDecodingException, IOException | |
Read constructor. | |
RepositoryInfoObject (ContentName name, PublisherPublicKeyDigest publisher, CCNFlowControl flowControl) throws ContentDecodingException, IOException | |
Read constructor. | |
RepositoryInfoObject (ContentObject firstBlock, CCNHandle handle) throws ContentDecodingException, IOException | |
Read constructor. | |
RepositoryInfoObject (ContentObject firstBlock, CCNFlowControl flowControl) throws ContentDecodingException, IOException | |
Read constructor. | |
RepositoryInfoObject (ContentName name, RepositoryInfo data, SaveType saveType, CCNHandle handle) throws IOException | |
Write constructor. | |
RepositoryInfoObject (ContentName name, RepositoryInfo data, SaveType saveType, PublisherPublicKeyDigest publisher, KeyLocator keyLocator, CCNHandle handle) throws IOException | |
Write constructor. | |
RepositoryInfoObject (ContentName name, RepositoryInfo data, PublisherPublicKeyDigest publisher, KeyLocator keyLocator, CCNFlowControl flowControl) throws IOException | |
Write constructor. | |
RepositoryInfo | repositoryInfo () throws ContentNotReadyException, ContentGoneException, ErrorStateException |
A CCNNetworkObject wrapper around RepositoryInfo, used for easily saving and retrieving versioned RepositoryInfos to CCN.
A typical pattern for using network objects to save objects that happen to be encodable or serializable is to incorporate such a static member wrapper class subclassing CCNEncodableObject, CCNSerializableObject, or CCNNetworkObject itself inside the main class definition.
org.ccnx.ccn.impl.repo.RepositoryInfo.RepositoryInfoObject.RepositoryInfoObject | ( | ContentName | name, | |
CCNHandle | handle | |||
) | throws ContentDecodingException, IOException |
Read constructor.
We have separated constructors into "write" and "read"; basically if you are only going to read with an object, use a read constructor unless you do not want update() to be called to read data in the constructor (for example, because you know no data has been written yet to this name). In this case, use a write constructor, set the data argument to null, and later call update or one of the forms of updateInBackground to read data into the object.
If the first thing you are going to do with an object is write data, use a write constructor, with a SaveType chosen to reflect where you are going to write data to (e.g. directly to the network or to a repository). The SaveType just controls the choice of flow controller used by the object, so constructors that explicitly specify a flow controller do not need a SaveType.
If you want to use an object to both read and write data, and you create it with a read constructor, you must call setupSave on the object prior to writing to set its SaveType, unless you specified a flow controller in the constructor.