org.jboss.system.server.profileservice.repository.clustered.sync
Interface SynchronizationPolicy

All Known Implementing Classes:
AbstractSynchronizationPolicy, ImmutableSynchronizationPolicy

public interface SynchronizationPolicy

Policy to decide how to handle content updates from nodes attempting to join the cluster or from cluster merges. The policy is consulted on the "authoritative" node, i.e. the master node for the service on the cluster.

Version:
$Revision: $
Author:
Brian Stansberry

Method Summary
 boolean acceptJoinAddition(RepositoryItemMetadata toAdd, RepositoryItemMetadata joinersPrevious)
          Should the item represented by toAdd that is available on a newly joining node be accepted for use around the cluster when the cluster's records show no record of an item with the same path? Such a case potentially could mean newly joining node was unaware of an earlier removal that occurred while it was offline and that the cluster has also purged from its records.
 boolean acceptJoinReincarnation(RepositoryItemMetadata reincarnation, RepositoryItemMetadata current)
          Should the item represented by reincarnation that is available on a newly joining node be accepted for use around the cluster when the cluster's records show an item with the same path was previously removed? Such a case potentially could mean the newly joining node was unaware of a removal that occurred while it was offline.
 boolean acceptJoinRemoval(RepositoryItemMetadata current, RepositoryItemMetadata joinersItem)
          Should the item represented by toRemovethat is unavailable on a merging set of nodes be removed from around the cluster when the cluster's records show an item with the same path? Such a case potentially could mean the newly joining node was unaware of a new deployment of the item that occurred while it was offline.
 boolean acceptJoinUpdate(RepositoryItemMetadata update, RepositoryItemMetadata current)
          Should the item represented by update that is available on a newly joining node be accepted for use around the cluster when the cluster's records show an item with the same path with a different version? Such a case potentially could mean the newly joining node was unaware of changes that occurred while it was offline.
 boolean acceptMergeAddition(RepositoryItemMetadata toAdd)
          Should the item represented by toAdd that is available on a merging set of nodes be accepted for use around the cluster when the cluster's records show no record of an item with the same path? Such a case potentially could mean the merging nodes were unaware of an earlier removal that occurred while the cluster was split and that the cluster has also purged from its records.
 boolean acceptMergeReincarnation(RepositoryItemMetadata reincarnation, RepositoryItemMetadata current)
          Should the item represented by reincarnation that is available on a merging set of nodes be accepted for use around the cluster when the cluster's records show an item with the same path was previously removed? Such a case potentially could mean the merging nodes were unaware of a removal that occurred while the cluster was split.
 boolean acceptMergeRemoval(RepositoryItemMetadata current, RepositoryItemMetadata mergersView)
          Should the item represented by toRemove that is unavailable on a newly joining node be removed from around the cluster when the cluster's records show an item with the same path? Such a case potentially could mean the newly joining node was unaware of a new deployment of the item that occurred while the cluster was split.
 boolean acceptMergeUpdate(RepositoryItemMetadata update, RepositoryItemMetadata current)
          Should the item represented by update that is available on a merging set of nodes be accepted for use around the cluster when the cluster's records show an item with the same path with a different version? Such a case potentially could mean the merging nodes were unaware of changes that occurred while the cluster was split.
 boolean purgeRemovedItems(RepositoryContentMetadata content)
          Request that the policy remove any RepositoryItemMetadata objects that are listed as removed if the policy no longer wishes to consider them in its decision making.
 

Method Detail

acceptJoinAddition

boolean acceptJoinAddition(RepositoryItemMetadata toAdd,
                           RepositoryItemMetadata joinersPrevious)
Should the item represented by toAdd that is available on a newly joining node be accepted for use around the cluster when the cluster's records show no record of an item with the same path? Such a case potentially could mean newly joining node was unaware of an earlier removal that occurred while it was offline and that the cluster has also purged from its records.

Parameters:
toAdd - the item to add
joinersPrevious - information, if available, on the timestamp of the item that was present on the joining node when it stopped. May be null, indicating the joining node was unaware of the item when stopped.
Returns:
true if the addition should be accepted

acceptJoinReincarnation

boolean acceptJoinReincarnation(RepositoryItemMetadata reincarnation,
                                RepositoryItemMetadata current)
Should the item represented by reincarnation that is available on a newly joining node be accepted for use around the cluster when the cluster's records show an item with the same path was previously removed? Such a case potentially could mean the newly joining node was unaware of a removal that occurred while it was offline.

Parameters:
reincarnation - the new version of the item
current - the cluster's current version of the item, showing when it was removed and by whom. The "when" should reflect this node's time of removal, not the time on the node that originated the removal.
Returns:
true if the reincarnation should be accepted

acceptJoinRemoval

boolean acceptJoinRemoval(RepositoryItemMetadata current,
                          RepositoryItemMetadata joinersItem)
Should the item represented by toRemovethat is unavailable on a merging set of nodes be removed from around the cluster when the cluster's records show an item with the same path? Such a case potentially could mean the newly joining node was unaware of a new deployment of the item that occurred while it was offline.

Parameters:
current - the cluster's current version of the item
joinersItem - the joining node's view of item to remove. May be null, indicating the sender is unaware of the item. If not null, the timestamp of this item should reflect when the item was removed, if known. If the time the item was removed is not known, the timestamp should reflect the last known timestamp of the item that was removed.
Returns:
true if the removal should be accepted

acceptJoinUpdate

boolean acceptJoinUpdate(RepositoryItemMetadata update,
                         RepositoryItemMetadata current)
Should the item represented by update that is available on a newly joining node be accepted for use around the cluster when the cluster's records show an item with the same path with a different version? Such a case potentially could mean the newly joining node was unaware of changes that occurred while it was offline.

Parameters:
update - the new version of the item
current - the cluster's current version of the item
Returns:
true if the update should be accepted

acceptMergeAddition

boolean acceptMergeAddition(RepositoryItemMetadata toAdd)
Should the item represented by toAdd that is available on a merging set of nodes be accepted for use around the cluster when the cluster's records show no record of an item with the same path? Such a case potentially could mean the merging nodes were unaware of an earlier removal that occurred while the cluster was split and that the cluster has also purged from its records.

Parameters:
toAdd - the item to add
Returns:
true if the addition should be accepted

acceptMergeReincarnation

boolean acceptMergeReincarnation(RepositoryItemMetadata reincarnation,
                                 RepositoryItemMetadata current)
Should the item represented by reincarnation that is available on a merging set of nodes be accepted for use around the cluster when the cluster's records show an item with the same path was previously removed? Such a case potentially could mean the merging nodes were unaware of a removal that occurred while the cluster was split.

Parameters:
reincarnation - the new version of the item
current - the cluster's current version of the item, showing when it was removed and by whom
Returns:
true if the reincarnation should be accepted

acceptMergeRemoval

boolean acceptMergeRemoval(RepositoryItemMetadata current,
                           RepositoryItemMetadata mergersView)
Should the item represented by toRemove that is unavailable on a newly joining node be removed from around the cluster when the cluster's records show an item with the same path? Such a case potentially could mean the newly joining node was unaware of a new deployment of the item that occurred while the cluster was split.

Parameters:
current - the cluster's current version of the item
mergersView - the merging node's view of item to remove. May be null, indicating the sender is unaware of the item. If not null, the timestamp of this item should reflect when the item was removed, if known. If the time the item was removed is not known, the timestamp should reflect the last known timestamp of the item that was removed.
Returns:
true if the removal should be accepted

acceptMergeUpdate

boolean acceptMergeUpdate(RepositoryItemMetadata update,
                          RepositoryItemMetadata current)
Should the item represented by update that is available on a merging set of nodes be accepted for use around the cluster when the cluster's records show an item with the same path with a different version? Such a case potentially could mean the merging nodes were unaware of changes that occurred while the cluster was split.

Parameters:
update - the new version of the item
current - the cluster's current version of the item
Returns:
true if the update should be accepted

purgeRemovedItems

boolean purgeRemovedItems(RepositoryContentMetadata content)
Request that the policy remove any RepositoryItemMetadata objects that are listed as removed if the policy no longer wishes to consider them in its decision making. Used to prevent perpetual growth in the size of the RepositoryContentMetadata by eventually purging records of removed items.

Parameters:
content - the content. Cannot be null.
Returns:
true if any items were purged, false if not


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.