Class MultiArtifactHandler

java.lang.Object
i5.las2peer.persistency.helper.MultiArtifactHandler
All Implemented Interfaces:
StorageArtifactHandler, StorageExceptionHandler

public class MultiArtifactHandler
extends java.lang.Object
implements StorageArtifactHandler, StorageExceptionHandler
This class is used to handle the lookup and retrieve process for a bunch of NetworkArtifacts. It gathers all parts till it received the necessary amount specified by the first part given. After that it calls the respective handlers given, same for exceptions.
  • Constructor Summary

    Constructors 
    Constructor Description
    MultiArtifactHandler​(int numberOfParts, StoragePartsHandler partsHandler, StorageExceptionHandler exceptionHandler)
    Initiates this lookup result collection with the given first part.
  • Method Summary

    Modifier and Type Method Description
    void onException​(java.lang.Exception e)
    This method is called in its own thread to handle the given exception.
    void onReceive​(AbstractArtifact artifact)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MultiArtifactHandler

      public MultiArtifactHandler​(int numberOfParts, StoragePartsHandler partsHandler, StorageExceptionHandler exceptionHandler)
      Initiates this lookup result collection with the given first part. The number of parts is retrieved from the given first part.
      Parameters:
      numberOfParts - The number of artifacts that must be retrieved to consider a full set.
      partsHandler - The result handler that gets all retrieved parts as a list.
      exceptionHandler - The exception handler that should be called, if an exception occurs.
  • Method Details