Class ServerDatasetResolver
- All Implemented Interfaces:
DatasetResolver
dataset://<name>@<version> against a Dokimos server.
Pinned versions (numeric) are fetched network-first with a local fallback cached under
~/.dokimos/datasets-cache/<name>@<version>/items.json. The latest alias always
goes to the network so newly published versions are picked up; once it resolves to a concrete
version a pinned cache entry is written.
Discovered via ServiceLoader; the no-arg constructor reads
DOKIMOS_SERVER_URL and DOKIMOS_API_KEY from the environment at
supports(String) time, so a JVM that never sets the variable keeps the resolver inert
and lets the next resolver in the chain handle the URI.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a resolver wired toDOKIMOS_SERVER_URL/DOKIMOS_API_KEY. -
Method Summary
Modifier and TypeMethodDescriptionFetches the dataset at the URI from the server, applying retries on 5xx responses and falling back to the offline cache when a pinned version is unreachable.booleanIndicates whether this resolver will attempt the given URI.
-
Field Details
-
SCHEME
URI scheme handled by this resolver.- See Also:
-
LATEST
Version path alias that resolves to the newest version on the server.- See Also:
-
PAGE_SIZE
public static final int PAGE_SIZEPage size used when listing dataset items.- See Also:
-
-
Constructor Details
-
ServerDatasetResolver
public ServerDatasetResolver()Creates a resolver wired toDOKIMOS_SERVER_URL/DOKIMOS_API_KEY. Used byServiceLoaderwhen discovering resolvers on the classpath.
-
-
Method Details
-
supports
Indicates whether this resolver will attempt the given URI.Returns
falsefor nondataset://URIs and when no server URL is configured, so the registry can fall through to file/classpath resolvers. Malformed URIs are accepted here and rejected inresolve(String)with a precise error message.- Specified by:
supportsin interfaceDatasetResolver- Parameters:
uri- the dataset URI- Returns:
- true if this resolver can handle the given URI
-
resolve
Fetches the dataset at the URI from the server, applying retries on 5xx responses and falling back to the offline cache when a pinned version is unreachable.- Specified by:
resolvein interfaceDatasetResolver- Parameters:
uri- the dataset's URI- Returns:
- the loaded Dataset
- Throws:
DatasetResolutionException- if the URI is malformed, the server returns a 4xx, or all retries fail with no usable cache entry
-