Package nl.knaw.dans.lib.dataverse
Class AdminApi
java.lang.Object
nl.knaw.dans.lib.dataverse.AdminApi
Administration API end-points.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final nl.knaw.dans.lib.dataverse.HttpClientWrapperprotected static final String -
Method Summary
Modifier and TypeMethodDescriptionaddBannerMessage(String json) Adds a banner message.addBannerMessage(Messages messages) Adds a banner message.protected PathdeleteBannerMessage(int id) Deletes a banner message.Retrieves a list of available storage drivers from the Dataverse instance.getDatabaseSetting(String key) getQueryParamsFromMetadataKeys(Map<String, String> metadataKeys) Lists all banner messages.listSingleUser(String id) putDatabaseSetting(String key, String value) submitDatasetVersionToArchive(String id, String version, boolean isPersistentId) Submits a dataset version to the archive.toString()validateDatasetFiles(int dbId) The following validates all the physical files in the dataset specified by recalculating the checksums and comparing them against the values saved in the database.Validates all the physical files in the dataset specified by recalculating the checksums and comparing them against the values saved in the database.validateDatasetFiles(String id, boolean isPersistentId) Validates all the physical files in the dataset specified by recalculating the checksums and comparing them against the values saved in the database.
-
Field Details
-
MDKEY_PARAM_NAME_PREFIX
- See Also:
-
httpClientWrapper
protected final nl.knaw.dans.lib.dataverse.HttpClientWrapper httpClientWrapper
-
-
Method Details
-
listSingleUser
public DataverseHttpResponse<AuthenticatedUser> listSingleUser(String id) throws IOException, DataverseException - Parameters:
id- username- Returns:
- the user
- Throws:
IOException- when I/O problems occur during the interaction with DataverseDataverseException- when Dataverse fails to perform the request- See Also:
-
putDatabaseSetting
public DataverseHttpResponse<Map<String,String>> putDatabaseSetting(String key, String value) throws IOException, DataverseException - Parameters:
key- the settings keyvalue- the new value- Returns:
- the result
- Throws:
IOException- when I/O problems occur during the interaction with DataverseDataverseException- when Dataverse fails to perform the request- See Also:
-
getDatabaseSetting
public DataverseHttpResponse<DataMessage> getDatabaseSetting(String key) throws IOException, DataverseException - Parameters:
key- the settings key- Returns:
- the result
- Throws:
IOException- when I/O problems occur during the interaction with DataverseDataverseException- when Dataverse fails to perform the request- See Also:
-
validateDatasetFiles
public DataverseHttpResponseWithoutEnvelope<DatasetFileValidationResultList> validateDatasetFiles(int dbId) throws IOException, DataverseException The following validates all the physical files in the dataset specified by recalculating the checksums and comparing them against the values saved in the database.- Parameters:
dbId- the dataset database id- Returns:
- the result
- Throws:
IOException- when I/O problems occur during the interaction with DataverseDataverseException- when Dataverse fails to perform the request- See Also:
-
validateDatasetFiles
public DataverseHttpResponseWithoutEnvelope<DatasetFileValidationResultList> validateDatasetFiles(String pid) throws IOException, DataverseException Validates all the physical files in the dataset specified by recalculating the checksums and comparing them against the values saved in the database.- Parameters:
pid- the dataset persistent identifier- Returns:
- the result
- Throws:
IOException- when I/O problems occur during the interaction with DataverseDataverseException- when Dataverse fails to perform the request- See Also:
-
validateDatasetFiles
public DataverseHttpResponseWithoutEnvelope<DatasetFileValidationResultList> validateDatasetFiles(String id, boolean isPersistentId) throws IOException, DataverseException Validates all the physical files in the dataset specified by recalculating the checksums and comparing them against the values saved in the database.- Parameters:
id- the dataset id (dbId or pid)isPersistentId- indicates whether the id is a persistent identifier- Returns:
- the result
- Throws:
IOException- when I/O problems occur during the interaction with DataverseDataverseException- when Dataverse fails to perform the request- See Also:
-
listBannerMessages
public DataverseHttpResponse<List<BannerMessage>> listBannerMessages() throws IOException, DataverseExceptionLists all banner messages.- Returns:
- the list of banner messages
- Throws:
IOException- when I/O problems occur during the interaction with DataverseDataverseException- when Dataverse fails to perform the request- See Also:
-
addBannerMessage
public DataverseHttpResponse<DataMessageWithId> addBannerMessage(String json) throws IOException, DataverseException Adds a banner message.- Parameters:
json- the banner message in JSON format- Returns:
- the response
- Throws:
IOException- when I/O problems occur during the interaction with DataverseDataverseException- when Dataverse fails to perform the request- See Also:
-
addBannerMessage
public DataverseHttpResponse<DataMessageWithId> addBannerMessage(Messages messages) throws IOException, DataverseException Adds a banner message.- Parameters:
messages- the banner message- Returns:
- the response
- Throws:
IOException- when I/O problems occur during the interaction with DataverseDataverseException- when Dataverse fails to perform the request- See Also:
-
deleteBannerMessage
public DataverseHttpResponse<DataMessage> deleteBannerMessage(int id) throws IOException, DataverseException Deletes a banner message.- Parameters:
id- the banner message id- Returns:
- the response envelope from Dataverse
- Throws:
IOException- when I/O problems occur during the interaction with DataverseDataverseException- when Dataverse fails to perform the request- See Also:
-
submitDatasetVersionToArchive
public DataverseHttpResponse<DataMessage> submitDatasetVersionToArchive(String id, String version, boolean isPersistentId) throws IOException, DataverseException Submits a dataset version to the archive.- Parameters:
id- the dataset idversion- the version of the datasetisPersistentId- indicates whether the id is a persistent identifier- Returns:
- the result
- Throws:
IOException- when I/O problems occur during the interaction with DataverseDataverseException- when Dataverse fails to perform the request- See Also:
-
getAvailableStorageDrivers
public DataverseHttpResponse<Map<String,String>> getAvailableStorageDrivers() throws IOException, DataverseExceptionRetrieves a list of available storage drivers from the Dataverse instance.- Returns:
- a
DataverseHttpResponsecontaining a list ofStorageDriverobjects - Throws:
IOException- if an I/O error occurs during the interaction with DataverseDataverseException- if Dataverse fails to process the request- See Also:
-
toString
-
buildPath
-
getQueryParamsFromMetadataKeys
-