cvmfs/cvmfs — pull request #644 by reneme (2014-12-18 12:34:39+00:00)
Title: Refactor: Extract and Generalize the ObjectFetcher<> from CatalogTraversal<>

This decouples the `ObjectFetcher<>` strategy classes from the `CatalogTraversal<>` and generalises it. This way it can be reused in various places throughout the swissknife code. Now the `CatalogTraversal<>` does take an `ObjectFetcher<>` type as template parameter and acts accordingly.

The `ObjectFetcher<>` is a CRTP implemented in `AbstractObjectFetcher<>` which has various implementations inheriting from it (currently `LocalObjectFetcher<>`, `HttpObjectFetcher<>` and `MockObjectFetcher`). Both `LocalObjectFetcher<>` and `HttpObjectFetcher<>` can be configured to emit different `Catalog` and `History` objects. Furthermore all `ObjectFetchers<>` encapsulate the loading of the `Manifest` object of a given repository.

In conclusion, `CatalogTraversals<>` can be configured to retrieve repository objects from different locations and traverse different catalog types (i.e. `Catalog`, `SimpleCatalog`, `WritableCatalog`) with the (hopefully) maximal amount of code reuse. While the `ObjectFetcher<>` can be used standalone (ie. to facilitate loading manifest or history objects) in other places of the code.

TODO: Unit tests for the `ObjectFetcher<>`. I'll append this pull request.