|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.system.server.profileservice.repository.clustered.sync.AbstractSynchronizationPolicy
public abstract class AbstractSynchronizationPolicy
Abstract base class to support implementations of SynchronizationPolicy
.
Implements the various RepositorySynchronizationPolicy acceptXXX methods by checking if a Boolean property has been set dictating the response; if not delegates the call to one of the abstract protected methods that subclasses implement.
Field Summary | |
---|---|
static long |
DEFAULT_REMOVAL_TRACKING_TIME
Default value for getRemovalTrackingTime() , equal to 30 days. |
Constructor Summary | |
---|---|
AbstractSynchronizationPolicy()
|
Method Summary | |
---|---|
protected abstract boolean |
acceptAddition(RepositoryItemMetadata toAdd,
RepositoryItemMetadata joinersPrevious,
boolean merge)
|
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 toRemove that 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. |
protected abstract boolean |
acceptReincarnation(RepositoryItemMetadata reincarnation,
RepositoryItemMetadata current,
boolean merge)
|
protected abstract boolean |
acceptRemoval(RepositoryItemMetadata current,
RepositoryItemMetadata sendersView,
boolean merge)
|
protected abstract boolean |
acceptUpdate(RepositoryItemMetadata update,
RepositoryItemMetadata current,
boolean merge)
|
Boolean |
getAllowJoinAdditions()
Gets any fixed response to acceptJoinAddition(RepositoryItemMetadata, RepositoryItemMetadata) . |
Boolean |
getAllowJoinReincarnations()
Gets any fixed response to acceptJoinReincarnation(RepositoryItemMetadata, RepositoryItemMetadata) . |
Boolean |
getAllowJoinRemovals()
Gets any fixed response to acceptJoinRemoval(RepositoryItemMetadata, RepositoryItemMetadata) . |
Boolean |
getAllowJoinUpdates()
Gets any fixed response to acceptJoinUpdate(RepositoryItemMetadata, RepositoryItemMetadata) . |
Boolean |
getAllowMergeAdditions()
Gets any fixed response to acceptMergeAddition(RepositoryItemMetadata) . |
Boolean |
getAllowMergeReincarnations()
Gets any fixed response to acceptMergeReincarnation(RepositoryItemMetadata, RepositoryItemMetadata) . |
Boolean |
getAllowMergeRemovals()
Gets any fixed response to acceptMergeRemoval(RepositoryItemMetadata, RepositoryItemMetadata) . |
Boolean |
getAllowMergeUpdates()
Gets any fixed response to acceptMergeUpdate(RepositoryItemMetadata, RepositoryItemMetadata) . |
long |
getRemovalTrackingTime()
Gets how long in ms this policy should remembered removed items for use in detecting reincarnations. |
boolean |
isDeveloperMode()
Gets whether this policy is in a very lenient "developer mode" in which case it will return true to all acceptXXX calls. |
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. |
void |
setAllowJoinAdditions(Boolean allow)
Sets any fixed response to acceptJoinAddition(RepositoryItemMetadata, RepositoryItemMetadata) . |
void |
setAllowJoinReincarnations(Boolean allow)
Sets any fixed response to acceptJoinReincarnation(RepositoryItemMetadata, RepositoryItemMetadata) . |
void |
setAllowJoinRemovals(Boolean allow)
Sets any fixed response to acceptJoinRemoval(RepositoryItemMetadata, RepositoryItemMetadata) . |
void |
setAllowJoinUpdates(Boolean allow)
Sets any fixed response to acceptJoinUpdate(RepositoryItemMetadata, RepositoryItemMetadata) . |
void |
setAllowMergeAdditions(Boolean allow)
Sets any fixed response to acceptMergeAddition(RepositoryItemMetadata) . |
void |
setAllowMergeReincarnations(Boolean allow)
Sets any fixed response to acceptMergeReincarnation(RepositoryItemMetadata, RepositoryItemMetadata) . |
void |
setAllowMergeRemovals(Boolean allow)
Sets any fixed response to acceptMergeRemoval(RepositoryItemMetadata, RepositoryItemMetadata) . |
void |
setAllowMergeUpdates(Boolean allow)
Sets any fixed response to acceptMergeUpdate(RepositoryItemMetadata, RepositoryItemMetadata) . |
void |
setDeveloperMode(boolean developerMode)
Sets whether this policy is in a very lenient "developer mode" in which case it will return true to all acceptXXX calls. |
void |
setRemovalTrackingTime(long removalTrackingTime)
Sets how long in ms this policy should remembered removed items for use in detecting reincarnations. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long DEFAULT_REMOVAL_TRACKING_TIME
getRemovalTrackingTime()
, equal to 30 days.
Constructor Detail |
---|
public AbstractSynchronizationPolicy()
Method Detail |
---|
public Boolean getAllowJoinAdditions()
acceptJoinAddition(RepositoryItemMetadata, RepositoryItemMetadata)
.
null
if there is no fixed
response and the call should be delegated to
acceptAddition(RepositoryItemMetadata, RepositoryItemMetadata, boolean)
public void setAllowJoinAdditions(Boolean allow)
acceptJoinAddition(RepositoryItemMetadata, RepositoryItemMetadata)
.
allow
- the fixed response, or null
if there is no fixed
response and the call should be delegated to
acceptAddition(RepositoryItemMetadata, RepositoryItemMetadata, boolean)
public Boolean getAllowJoinReincarnations()
acceptJoinReincarnation(RepositoryItemMetadata, RepositoryItemMetadata)
.
null
if there is no fixed
response and the call should be delegated to
acceptReincarnation(RepositoryItemMetadata, RepositoryItemMetadata, boolean)
public void setAllowJoinReincarnations(Boolean allow)
acceptJoinReincarnation(RepositoryItemMetadata, RepositoryItemMetadata)
.
allow
- the fixed response, or null
if there is no fixed
response and the call should be delegated to
acceptReincarnation(RepositoryItemMetadata, RepositoryItemMetadata, boolean)
public Boolean getAllowJoinUpdates()
acceptJoinUpdate(RepositoryItemMetadata, RepositoryItemMetadata)
.
null
if there is no fixed
response and the call should be delegated to
acceptUpdate(RepositoryItemMetadata, RepositoryItemMetadata, boolean)
public void setAllowJoinUpdates(Boolean allow)
acceptJoinUpdate(RepositoryItemMetadata, RepositoryItemMetadata)
.
allow
- the fixed response, or null
if there is no fixed
response and the call should be delegated to
acceptUpdate(RepositoryItemMetadata, RepositoryItemMetadata, boolean)
public Boolean getAllowJoinRemovals()
acceptJoinRemoval(RepositoryItemMetadata, RepositoryItemMetadata)
.
null
if there is no fixed
response and the call should be delegated to
acceptRemoval(RepositoryItemMetadata, RepositoryItemMetadata, boolean)
public void setAllowJoinRemovals(Boolean allow)
acceptJoinRemoval(RepositoryItemMetadata, RepositoryItemMetadata)
.
allow
- the fixed response, or null
if there is no fixed
response and the call should be delegated to
acceptRemoval(RepositoryItemMetadata, RepositoryItemMetadata, boolean)
public Boolean getAllowMergeAdditions()
acceptMergeAddition(RepositoryItemMetadata)
.
null
if there is no fixed
response and the call should be delegated to
acceptAddition(RepositoryItemMetadata, RepositoryItemMetadata, boolean)
public void setAllowMergeAdditions(Boolean allow)
acceptMergeAddition(RepositoryItemMetadata)
.
allow
- the fixed response, or null
if there is no fixed
response and the call should be delegated to
acceptAddition(RepositoryItemMetadata, RepositoryItemMetadata, boolean)
public Boolean getAllowMergeReincarnations()
acceptMergeReincarnation(RepositoryItemMetadata, RepositoryItemMetadata)
.
null
if there is no fixed
response and the call should be delegated to
acceptReincarnation(RepositoryItemMetadata, RepositoryItemMetadata, boolean)
public void setAllowMergeReincarnations(Boolean allow)
acceptMergeReincarnation(RepositoryItemMetadata, RepositoryItemMetadata)
.
allow
- the fixed response, or null
if there is no fixed
response and the call should be delegated to
acceptReincarnation(RepositoryItemMetadata, RepositoryItemMetadata, boolean)
public Boolean getAllowMergeUpdates()
acceptMergeUpdate(RepositoryItemMetadata, RepositoryItemMetadata)
.
null
if there is no fixed
response and the call should be delegated to
acceptUpdate(RepositoryItemMetadata, RepositoryItemMetadata, boolean)
public void setAllowMergeUpdates(Boolean allow)
acceptMergeUpdate(RepositoryItemMetadata, RepositoryItemMetadata)
.
allow
- the fixed response, or null
if there is no fixed
response and the call should be delegated to
acceptUpdate(RepositoryItemMetadata, RepositoryItemMetadata, boolean)
public Boolean getAllowMergeRemovals()
acceptMergeRemoval(RepositoryItemMetadata, RepositoryItemMetadata)
.
null
if there is no fixed
response and the call should be delegated to
acceptRemoval(RepositoryItemMetadata, RepositoryItemMetadata, boolean)
public void setAllowMergeRemovals(Boolean allow)
acceptMergeRemoval(RepositoryItemMetadata, RepositoryItemMetadata)
.
allow
- the fixed response, or null
if there is no fixed
response and the call should be delegated to
acceptRemoval(RepositoryItemMetadata, RepositoryItemMetadata, boolean)
public boolean isDeveloperMode()
true
to all acceptXXX calls.
The purpose of this is to eliminate any need for development servers
to coordinate system timestamps.
true
if the policy is in developer mode.public void setDeveloperMode(boolean developerMode)
true
to all acceptXXX calls.
The purpose of this is to eliminate any need for development servers
to coordinate system timestamps.
developerMode
- true
if the policy should be in developer mode.public long getRemovalTrackingTime()
DEFAULT_REMOVAL_TRACKING_TIME
.
public void setRemovalTrackingTime(long removalTrackingTime)
DEFAULT_REMOVAL_TRACKING_TIME
.
removalTrackingTime
- the number of ms, or a number less than 1 to
indicate removed items should not be remembered.public boolean acceptJoinAddition(RepositoryItemMetadata toAdd, RepositoryItemMetadata joinersPrevious)
SynchronizationPolicy
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
.
acceptJoinAddition
in interface SynchronizationPolicy
toAdd
- the item to addjoinersPrevious
- 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.
true
if the addition should be acceptedpublic boolean acceptJoinReincarnation(RepositoryItemMetadata reincarnation, RepositoryItemMetadata current)
SynchronizationPolicy
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.
acceptJoinReincarnation
in interface SynchronizationPolicy
reincarnation
- the new version of the itemcurrent
- 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.
true
if the reincarnation should be acceptedpublic boolean acceptJoinRemoval(RepositoryItemMetadata current, RepositoryItemMetadata joinersItem)
SynchronizationPolicy
toRemove
that 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.
acceptJoinRemoval
in interface SynchronizationPolicy
current
- the cluster's current version of the itemjoinersItem
- 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.
true
if the removal should be acceptedpublic boolean acceptJoinUpdate(RepositoryItemMetadata update, RepositoryItemMetadata current)
SynchronizationPolicy
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.
acceptJoinUpdate
in interface SynchronizationPolicy
update
- the new version of the itemcurrent
- the cluster's current version of the item
true
if the update should be acceptedpublic boolean acceptMergeAddition(RepositoryItemMetadata toAdd)
SynchronizationPolicy
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
.
acceptMergeAddition
in interface SynchronizationPolicy
toAdd
- the item to add
true
if the addition should be acceptedpublic boolean acceptMergeReincarnation(RepositoryItemMetadata reincarnation, RepositoryItemMetadata current)
SynchronizationPolicy
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.
acceptMergeReincarnation
in interface SynchronizationPolicy
reincarnation
- the new version of the itemcurrent
- the cluster's current version of the item, showing when
it was removed and by whom
true
if the reincarnation should be acceptedpublic boolean acceptMergeRemoval(RepositoryItemMetadata current, RepositoryItemMetadata mergersView)
SynchronizationPolicy
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.
acceptMergeRemoval
in interface SynchronizationPolicy
current
- the cluster's current version of the itemmergersView
- 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.
true
if the removal should be acceptedpublic boolean acceptMergeUpdate(RepositoryItemMetadata update, RepositoryItemMetadata current)
SynchronizationPolicy
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.
acceptMergeUpdate
in interface SynchronizationPolicy
update
- the new version of the itemcurrent
- the cluster's current version of the item
true
if the update should be acceptedpublic boolean purgeRemovedItems(RepositoryContentMetadata content)
SynchronizationPolicy
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.
purgeRemovedItems
in interface SynchronizationPolicy
content
- the content. Cannot be null
.
true
if any items were purged, false
if notprotected abstract boolean acceptAddition(RepositoryItemMetadata toAdd, RepositoryItemMetadata joinersPrevious, boolean merge)
protected abstract boolean acceptReincarnation(RepositoryItemMetadata reincarnation, RepositoryItemMetadata current, boolean merge)
protected abstract boolean acceptRemoval(RepositoryItemMetadata current, RepositoryItemMetadata sendersView, boolean merge)
protected abstract boolean acceptUpdate(RepositoryItemMetadata update, RepositoryItemMetadata current, boolean merge)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |