Package i5.las2peer.persistency
Interface StorageCollisionHandler
- All Known Implementing Classes:
StoreProcessHelper
public interface StorageCollisionHandler
This interface can be used to implement a handler that is called if a collision occurs during a store operation.
-
Method Summary
Modifier and TypeMethodDescriptionmergeGroups
(Set<String> toStoreGroups, Set<String> inNetworkGroups) mergeReaders
(Set<PublicKey> toStoreReaders, Set<PublicKey> inNetworkReaders) onCollision
(EnvelopeVersion toStore, EnvelopeVersion inNetwork, long numberOfCollisions) This method is called if an envelope is already known for the given identifier and version.
-
Method Details
-
onCollision
Serializable onCollision(EnvelopeVersion toStore, EnvelopeVersion inNetwork, long numberOfCollisions) throws StopMergingException This method is called if an envelope is already known for the given identifier and version.- Parameters:
toStore
- This is the envelope that was requested to be stored in the network.inNetwork
- This is the colliding envelope that was fetched from the network.numberOfCollisions
- This is an increasing counter on how often this method was called. It should be a hint to the developer to reconsider his storage structure if this value reaches often high values.- Returns:
- Returns the merged content from both envelopes, which is automatically wrapped in a new store operation.
- Throws:
StopMergingException
- If there should be made no further merging attempt.
-
mergeReaders
-
mergeGroups
-