public interface CatalogueFetcher
<catalogue> HTTP response, as specified in the
Registry API.
Classes implementing this interface are able to acquire the catalogue response from the Registry
Service. We provide a default implementation of this interface called
DefaultCatalogueFetcher, but sometimes you might want to provide your own implementation,
for example when running unit tests.
DefaultCatalogueFetcher,
ClientImplOptions.setCatalogueFetcher(CatalogueFetcher)| Modifier and Type | Interface and Description |
|---|---|
static class |
CatalogueFetcher.Http200RegistryResponse
Represents a HTTP 200 Registry catalogue response.
|
static class |
CatalogueFetcher.Http304RegistryResponse
Represents a HTTP 304 Registry catalogue response.
|
static class |
CatalogueFetcher.RegistryResponse
A common base for both Registry catalogue responses.
|
| Modifier and Type | Method and Description |
|---|---|
CatalogueFetcher.RegistryResponse |
fetchCatalogue(String etag)
Fetch the catalogue from the Registry Service, or confirm that it didn't change.
|
CatalogueFetcher.RegistryResponse fetchCatalogue(String etag) throws IOException
Implementations are strongly advised to include the attached ETag value in their
If-None-Match HTTP header when making the request to the Registry API.
ClientImpl is interested in just two types of Registry API responses:
CatalogueFetcher.Http200RegistryResponse
object.CatalogueFetcher.Http304RegistryResponse
object.IOException.etag - String or null. If not null, then it should contain the ETag value to
be used in the If-None-Match request header (the ETag representing the
version of the catalogue which we currently possess). If null, then this method
will not use the If-None-Match header (and will therefore be expected to
return an CatalogueFetcher.Http200RegistryResponse).CatalogueFetcher.Http200RegistryResponse or CatalogueFetcher.Http304RegistryResponse object.IOException - if Registry API could not be contacted, or it has responded with a HTTP
status different than 200 and 304.Copyright © 2017. All rights reserved.