Package org.mycore.pi.purl
Class MCRPURLManager
java.lang.Object
org.mycore.pi.purl.MCRPURLManager
PURL Manager to register Persistent URLs on a PURL server
for further documentation see PURLZ Wiki: https://code.google.com/archive/p/persistenturls/wikis
Hint: ----- Please check in your code that you do not register / override regular PURLs in test / development by checking: if (resolvingURL.contains("localhost")) { purl = "/test" + purl; }
- Author:
- Robert Stephan
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
deletePURL
(String purl) deletes an existing PURLboolean
existsPURL
(String purl) check if a PURL existsboolean
isPURLTargetURLUnchanged
(String purl, String targetURL) check if a purl has the given target urlvoid
sets the session cookie, if the login was successfulvoid
logout()
logout from PURL serverint
registerNewPURL
(String purl, String target, String type, String maintainers) register a new PURLretrievePURLMetadata
(String purl, String targetURL) return the PURL metadataint
updateExistingPURL
(String purl, String target, String type, String maintainers) updates an existing PURL
-
Constructor Details
-
MCRPURLManager
public MCRPURLManager()
-
-
Method Details
-
login
sets the session cookie, if the login was successful- Parameters:
purlServerURL
- - the base URL of the PURL serveruser
- - the PURL server userpassword
- - the user's password
-
logout
public void logout()logout from PURL server -
registerNewPURL
register a new PURL- Parameters:
purl
- - the PURLtarget
- the target URLtype
- - the PURL typemaintainers
- - the maintainers- Returns:
- the HTTP Status Code of the request
-
updateExistingPURL
updates an existing PURL- Parameters:
purl
- - the PURL (relative URL)target
- - the target URLtype
- - the PURL typemaintainers
- list of maintainers (PURL server users or groups)- Returns:
- the HTTP Status Code of the request
-
deletePURL
deletes an existing PURL- Parameters:
purl
-- Returns:
- the HTTP Status Code of the request
-
isPURLTargetURLUnchanged
check if a purl has the given target url- Parameters:
purl
- - the purltargetURL
- - the target URL- Returns:
- true, if the target URL is registered at the given PURL
-
retrievePURLMetadata
return the PURL metadata- Parameters:
purl
- - the purl- Returns:
- an XML document containing the metadata of the PURL or null if the PURL does not exist
-
existsPURL
check if a PURL exists- Parameters:
purl
- - the purl- Returns:
- true, if the given PURL is known
-