Interface DensityMapProvider

All Known Implementing Classes:
AbstractDensityMapProvider, EmdbMapProvider, PdbeCcp4MapProvider, VolumeServerProvider, WwpdbMapCoefficientsProvider

public interface DensityMapProvider
Fetches density maps from one particular service.

Implementations are combined into an ordered chain by DensityMapCache, which tries each in turn until one produces a map. The contract around exceptions is what makes that chain safe:

  • Throw HttpStatusException with HttpStatusException.isNotFound() — or return null — when this service simply has nothing for the entry. The chain moves on to the next source.
  • Throw DensityMapTooLargeException when the map exists but exceeds the caller's size limit. The chain also moves on, so a smaller representation from another source can be used instead.
  • Throw any other IOException for a genuine transport failure. The chain stops, so that a network outage is never mistaken for "this entry has no density".
Since:
7.3.0
Author:
Amr ALHOSSARY
  • Method Details

    • getSource

      DensityMapSource getSource()
      Returns:
      which service this provider talks to
    • getFormat

      DensityFileFormat getFormat()
      Returns:
      the format this provider delivers
    • supports

      boolean supports(DensityMapKind kind)
      Whether this provider can serve a given kind of map at all. Used to skip requests that could not possibly succeed, such as asking an X-ray map service for a cryo-EM map.
      Parameters:
      kind - the kind of map wanted
      Returns:
      true if it is worth trying
    • fetch

      Fetches a map, using the cache if the request's fetch behaviour allows.
      Parameters:
      request - what is wanted. Its kind is always concrete, never DensityMapKind.AUTO.
      Returns:
      the map, or null if this service has nothing for the entry
      Throws:
      DensityMapTooLargeException - if the map exceeds the request's size limit
      IOException - on transport failure; use HttpStatusException so that a missing resource can be told apart from a broken connection