A listener for a network object that requests a local repository to hold a copy of the object whenever it is updated or saved. More...
Public Member Functions | |
void | newVersionAvailable (CCNNetworkObject<?> newVersion, boolean wasSave) |
Notification when a new version is available of a given object (the object's data and version information will already have been updated to reflect the new version). | |
Static Public Member Functions | |
static void | startBackup (CCNNetworkObject<?> objectToSyncToRepository) throws IOException |
Protected Member Functions | |
void | localCopy (CCNNetworkObject<?> newVersion) |
Static Protected Attributes | |
static LocalCopyListener | backupListener = new LocalCopyListener() |
A listener for a network object that requests a local repository to hold a copy of the object whenever it is updated or saved.
A local repository is one connected directly to the same ccnd as the application; it may have a distinguished role as the repository that is always available for local configuration data regardless of external connectivity. If there is more than one repository that is local, the behavior is undefined.
To add this functionality to an existing network object, add an instance of this class as a listener on the object.
void org.ccnx.ccn.io.content.LocalCopyListener.newVersionAvailable | ( | CCNNetworkObject<?> | newVersion, | |
boolean | wasSave | |||
) |
Notification when a new version is available of a given object (the object's data and version information will already have been updated to reflect the new version).
newVersion | The newly updated object. | |
wasSave | If true, someone called save() on this particular object, if false, the object received new data from the network. |
Implements org.ccnx.ccn.io.content.UpdateListener.