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
HttpStatusExceptionwithHttpStatusException.isNotFound()— or returnnull— when this service simply has nothing for the entry. The chain moves on to the next source. - Throw
DensityMapTooLargeExceptionwhen 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
IOExceptionfor 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 Summary
Modifier and TypeMethodDescriptionfetch(DensityMapRequest request) Fetches a map, using the cache if the request's fetch behaviour allows.booleansupports(DensityMapKind kind) Whether this provider can serve a given kind of map at all.
-
Method Details
-
getSource
DensityMapSource getSource()- Returns:
- which service this provider talks to
-
getFormat
DensityFileFormat getFormat()- Returns:
- the format this provider delivers
-
supports
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:
trueif 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, neverDensityMapKind.AUTO.- Returns:
- the map, or
nullif this service has nothing for the entry - Throws:
DensityMapTooLargeException- if the map exceeds the request's size limitIOException- on transport failure; useHttpStatusExceptionso that a missing resource can be told apart from a broken connection
-