Package org.mycore.pi.urn.rest
Class MCRDNBURNRestClient
java.lang.Object
org.mycore.pi.urn.rest.MCRDNBURNRestClient
Class for registering and updating urn managed by the DNB.
- Author:
- Huu Chi Vu, shermann
- See Also:
-
- URN-Service API Created by chi on 25.01.17.
-
Constructor Summary
ConstructorDescriptionMCRDNBURNRestClient
(Function<MCRPIRegistrationInfo, MCRURNJsonBundle> bundleProvider) Creates a new operator with the given configuration.MCRDNBURNRestClient
(Function<MCRPIRegistrationInfo, MCRURNJsonBundle> bundleProvider, Optional<org.apache.http.auth.UsernamePasswordCredentials> credentials) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
Returns the base url for checking the existence of a given urn.protected String
Returns the base url of the urn registration service.protected String
Deprecated.protected String
Returns the url for updating the urls assigned to a given urn.Please see list of status codes and their meaning:
-
Constructor Details
-
MCRDNBURNRestClient
Creates a new operator with the given configuration.- Parameters:
bundleProvider
-
-
MCRDNBURNRestClient
public MCRDNBURNRestClient(Function<MCRPIRegistrationInfo, MCRURNJsonBundle> bundleProvider, Optional<org.apache.http.auth.UsernamePasswordCredentials> credentials) - Parameters:
bundleProvider
- the provider creating the required jsoncredentials
- the credentials needed for authentication
-
-
Method Details
-
getBaseServiceURL
Deprecated.Returns the base url of the urn registration service. -
getBaseServiceURL
Returns the base url of the urn registration service.- Returns:
- the base url as set in mycore property MCR.PI.URNGranular.API.BaseURL
-
getBaseServiceCheckExistsURL
Returns the base url for checking the existence of a given urn.- Parameters:
urn
- theMCRPIRegistrationInfo
to test- Returns:
- the request url
-
getUpdateURL
Returns the url for updating the urls assigned to a given urn.- Parameters:
urn
- the urn- Returns:
- the url for updating the urls
-
register
Please see list of status codes and their meaning:
204 No Content: URN is in database. No further information asked.
301 Moved Permanently: The given URN is replaced with a newer version. This newer version should be used instead.
404 Not Found: The given URN is not registered in system.
410 Gone: The given URN is registered in system but marked inactive.
- Returns:
- the registration/update date
-
getBaseServiceURL()