public class DefaultCatalogueFetcher extends Object implements CatalogueFetcher
CatalogueFetcher which retrieves its <catalogue> response directly
from the Registry Service.
This default implementation will be used by the ClientImpl unless a custom implementation
will be set via ClientImplOptions.setCatalogueFetcher(CatalogueFetcher) method.
CatalogueFetcher.Http200RegistryResponse, CatalogueFetcher.Http304RegistryResponse, CatalogueFetcher.RegistryResponse| Constructor and Description |
|---|
DefaultCatalogueFetcher()
Initialize with the default (official) Registry Service (
registry.erasmuswithoutpaper.eu). |
DefaultCatalogueFetcher(String customRegistryDomain)
Allows you to use an alternate installation of the Registry Service.
|
| Modifier and Type | Method and Description |
|---|---|
CatalogueFetcher.RegistryResponse |
fetchCatalogue(String previousETag)
Fetch the catalogue from the Registry Service, or confirm that it didn't change.
|
public DefaultCatalogueFetcher()
registry.erasmuswithoutpaper.eu).public DefaultCatalogueFetcher(String customRegistryDomain)
In particular, during the development you might want to use
dev-registry.erasmuswithoutpaper.eu.
customRegistryDomain - domain name at which an alternate Registry Service installation has
been set up.public CatalogueFetcher.RegistryResponse fetchCatalogue(String previousETag) throws IOException
CatalogueFetcher
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.fetchCatalogue in interface CatalogueFetcherpreviousETag - 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.