public class FullPSync2017WithUsers extends Object implements FullPSync2017.OnNamesUpdate, FullPSync2017.CanAddToSyncData, FullPSync2017.CanAddReceivedName
| Modifier and Type | Class and Description |
|---|---|
static interface |
FullPSync2017WithUsers.OnUpdate |
| Constructor and Description |
|---|
FullPSync2017WithUsers(int expectedNEntries,
Face face,
Name syncPrefix,
Name userPrefix,
FullPSync2017WithUsers.OnUpdate onUpdate,
KeyChain keyChain)
Create a FullPSync2017WithUsers, where syncInterestLifetime is
FullPSync2017.DEFAULT_SYNC_INTEREST_LIFETIME, syncReplyFreshnessPeriod is
FullPSync2017.DEFAULT_SYNC_REPLY_FRESHNESS_PERIOD, and signingInfo is the
default SigningInfo().
|
FullPSync2017WithUsers(int expectedNEntries,
Face face,
Name syncPrefix,
Name userPrefix,
FullPSync2017WithUsers.OnUpdate onUpdate,
KeyChain keyChain,
double syncInterestLifetime,
double syncReplyFreshnessPeriod)
Create a FullPSync2017WithUsers, where signingInfo is the default
SigningInfo().
|
FullPSync2017WithUsers(int expectedNEntries,
Face face,
Name syncPrefix,
Name userPrefix,
FullPSync2017WithUsers.OnUpdate onUpdate,
KeyChain keyChain,
double syncInterestLifetime,
double syncReplyFreshnessPeriod,
SigningInfo signingInfo)
Create a FullPSync2017WithUsers.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addUserNode(Name prefix)
Add a user node for synchronization based on the prefix Name, and
initialize the sequence number to zero.
|
boolean |
canAddReceivedName(Name name)
This is called when new names are received to check if the name can be
added to the IBLT.
|
boolean |
canAddToSyncData(Name name,
HashSet<Long> negative)
Get the prefix from the name and check if hash(prefix + 1) is in the
negative set, i.e.
|
int |
getSequenceNo(Name prefix)
Return the current sequence number of the given user prefix.
|
void |
onNamesUpdate(ArrayList<Name> names)
This is called when new names are received.
|
void |
publishName(Name prefix)
Publish the sequence number for the prefix Name to inform the others, where
the existing sequence number is incremented by 1.
|
void |
publishName(Name prefix,
int sequenceNo)
Publish the sequence number for the prefix Name to inform the others.
|
void |
removeUserNode(Name prefix)
Remove the user node from the synchronization.
|
public FullPSync2017WithUsers(int expectedNEntries,
Face face,
Name syncPrefix,
Name userPrefix,
FullPSync2017WithUsers.OnUpdate onUpdate,
KeyChain keyChain,
double syncInterestLifetime,
double syncReplyFreshnessPeriod,
SigningInfo signingInfo)
throws IOException,
SecurityException
expectedNEntries - The expected number of entries in the IBLT.face - The application's Face.syncPrefix - The prefix Name of the sync group, which is copied.userPrefix - The prefix Name of the first user in the group, which is
copied. However, if this Name is empty, it is not added and you must call
addUserNode.onUpdate - When there is new data, this calls onUdate.onUdate(updates)
where updates is a list of PSyncMissingDataInfo.
NOTE: The library will log any exceptions thrown by this callback, but for
better error handling the callback should catch and properly handle any
exceptions.keyChain - The KeyChain for signing Data packets.syncInterestLifetime - The Interest lifetime for the sync Interests,
in milliseconds.syncReplyFreshnessPeriod - The freshness period of the sync Data
packet, in milliseconds.signingInfo - The SigningInfo for signing Data packets, which is
copied.IOExceptionSecurityExceptionpublic FullPSync2017WithUsers(int expectedNEntries,
Face face,
Name syncPrefix,
Name userPrefix,
FullPSync2017WithUsers.OnUpdate onUpdate,
KeyChain keyChain,
double syncInterestLifetime,
double syncReplyFreshnessPeriod)
throws IOException,
SecurityException
expectedNEntries - The expected number of entries in the IBLT.face - The application's Face.syncPrefix - The prefix Name of the sync group, which is copied.userPrefix - The prefix Name of the first user in the group, which is
copied. However, if this Name is empty, it is not added and you must call
addUserNode.onUpdate - When there is new data, this calls onUdate.onUdate(updates)
where updates is a list of PSyncMissingDataInfo.
NOTE: The library will log any exceptions thrown by this callback, but for
better error handling the callback should catch and properly handle any
exceptions.keyChain - The KeyChain for signing Data packets.syncInterestLifetime - The Interest lifetime for the sync Interests,
in milliseconds.syncReplyFreshnessPeriod - The freshness period of the sync Data
packet, in milliseconds.IOExceptionSecurityExceptionpublic FullPSync2017WithUsers(int expectedNEntries,
Face face,
Name syncPrefix,
Name userPrefix,
FullPSync2017WithUsers.OnUpdate onUpdate,
KeyChain keyChain)
throws IOException,
SecurityException
expectedNEntries - The expected number of entries in the IBLT.face - The application's Face.syncPrefix - The prefix Name of the sync group, which is copied.userPrefix - The prefix Name of the first user in the group, which is
copied. However, if this Name is empty, it is not added and you must call
addUserNode.onUpdate - When there is new data, this calls onUdate.onUdate(updates)
where updates is a list of PSyncMissingDataInfo.
NOTE: The library will log any exceptions thrown by this callback, but for
better error handling the callback should catch and properly handle any
exceptions.keyChain - The KeyChain for signing Data packets.IOExceptionSecurityExceptionpublic final int getSequenceNo(Name prefix)
prefix - The user prefix for the sequence number.public final boolean addUserNode(Name prefix)
prefix - The prefix Name of the user node to be added.public final void removeUserNode(Name prefix)
prefix - The prefix Name of the user node to be removed. If there is
no user node with this prefix, do nothing.public final void publishName(Name prefix, int sequenceNo)
prefix - the prefix Name to be updated.sequenceNo - The sequence number of the user prefix to be
set in the IBLT. However, if sequenceNo is -1, then the existing sequence
number is incremented by 1.public final void publishName(Name prefix)
prefix - the prefix Name to be updated.public final boolean canAddReceivedName(Name name)
canAddReceivedName in interface FullPSync2017.CanAddReceivedNamename - The Name to check.public final void onNamesUpdate(ArrayList<Name> names)
onNamesUpdate in interface FullPSync2017.OnNamesUpdatenames - The new received names.public final boolean canAddToSyncData(Name name, HashSet<Long> negative)
canAddToSyncData in interface FullPSync2017.CanAddToSyncDataCopyright © 2019. All rights reserved.