Interface RemoteBHive

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
JerseyRemoteBHive, LocalBHiveAdapter

public interface RemoteBHive extends AutoCloseable
Represents a possibly remote (might also be "remote" in the sense of another directory on disc) BHive. This interface is *not* ment to be used for direct remote interface implementation, but rather is a logical representation of a BHive which is not the currently operated-on BHive.
See Also:
  • Method Details

    • getMissingObjects

      Set<ObjectId> getMissingObjects(Set<ObjectId> all)
      From the given set, filter all remotely known ObjectIds and return only ObjectId which are not yet present on the remote.
    • getManifestInventory

      SortedMap<Manifest.Key,ObjectId> getManifestInventory(String... names)
      Retrieve all Manifest.Keys along with the root tree ObjectId available to the remote repository.
      Parameters:
      names - a possibly empty list of named to restrict to. Each can be any number of full (!) name segments (/-separated).
    • removeManifest

      void removeManifest(Manifest.Key key)
      Parameters:
      key - the manifest to delete
    • prune

      void prune()
      Perform a prune operation on the remote BHive, removing any unreferenced objects.
    • getRequiredObjects

      Set<ObjectId> getRequiredObjects(Set<ObjectId> trees, Set<ObjectId> excludeTrees)
      Retrieve the ObjectIds required to satisfy a given tree.
    • getRequiredTrees

      Set<ObjectId> getRequiredTrees(ObjectId tree)
      Retrieve the ObjectIds of all required Tree objects recursively in the given tree. The returned set is ordered so that child-trees are first followed by their parents.
    • push

      void push(Path zipedHive)
      Transfer the ZIPed BHive to the remote and apply all top-level Manifests referenced within.
    • pushAsStream

      TransferStatistics pushAsStream(InputStream in)
      Streams objects directly into the given remote hive.
    • fetch

      Path fetch(Set<ObjectId> objects, Set<Manifest.Key> manifests)
      Fetch manifests from the remote as ZIPed BHive. Only objects in the given requiredObjects are included.
    • fetchAsStream

      InputStream fetchAsStream(Set<ObjectId> objects, Set<Manifest.Key> manifests)
      Streams the given objects one after each other to the given output stream.
    • forService

      static RemoteBHive forService(RemoteService svc, String name, ActivityReporter reporter)
      Figures out the type of RemoteBHive required for the given RemoteService and returns an instance.

      The returned RemoteBHive is not guaranteed to be remote in the sense of network. It might be an adapter to another local BHive in the filesystem.

      In case the hive is remote, the name is used to identify the hive on the server, as the server might serve multiple hives.

    • close

      void close()
      Specified by:
      close in interface AutoCloseable