Skip to content
Snippets Groups Projects
Unverified Commit 4ed9f348 authored by Martin Weise's avatar Martin Weise
Browse files

added some comments

parent a0f72126
No related branches found
No related tags found
3 merge requests!81New stable release,!43Merge dev to master,!27Draft: Resolve "Zenodo Sandbox integration for PID (e.g. DOI)"
......@@ -11,14 +11,62 @@ import java.util.List;
@Service
public interface FileService {
/**
* Upload a new file to a remote server for a given database-table id pair and metadata
*
* @param databaseId The database-table id paid
* @param tableId The database-table id pair
* @param data The metadata
* @param resource The file
* @return The new file
* @throws ZenodoAuthenticationException Token invalid
* @throws ZenodoApiException Something other went wrong
* @throws ZenodoNotFoundException The deposit id was not found on the remote server
* @throws ZenodoFileTooLargeException The file exceeds the capabilities
* @throws MetadataDatabaseNotFoundException The deposit was not found on the metadata database
*/
FileResponseDto createResource(Long databaseId, Long tableId, FileUploadDto data, File resource)
throws ZenodoAuthenticationException, ZenodoApiException, ZenodoNotFoundException,
ZenodoFileTooLargeException, MetadataDatabaseNotFoundException;
/**
* List all files known to a deposit number (through the database-table id pair)
*
* @param databaseId The database-table id pair
* @param tableId The database-table id pair
* @return The list of files
* @throws ZenodoAuthenticationException Token invalid
* @throws ZenodoApiException Something other went wrong
* @throws ZenodoNotFoundException The deposit id was not found on the remote server
* @throws MetadataDatabaseNotFoundException The deposit was not found on the metadata database
*/
List<FileResponseDto> listResources(Long databaseId, Long tableId) throws MetadataDatabaseNotFoundException, ZenodoAuthenticationException, ZenodoNotFoundException, ZenodoApiException;
/**
* Find a file for a deposit (through the database-table id pair) by id
*
* @param databaseId The database-table id pair
* @param tableId The database-table id pair
* @param fileId The file id
* @return The file
* @throws MetadataDatabaseNotFoundException The deposit was not found on the metadata database
* @throws ZenodoAuthenticationException Token invalid
* @throws ZenodoNotFoundException The deposit id was not found on the remote server
* @throws ZenodoApiException Something other went wrong
*/
FileResponseDto findResource(Long databaseId, Long tableId, String fileId) throws MetadataDatabaseNotFoundException, ZenodoAuthenticationException, ZenodoNotFoundException, ZenodoApiException;
/**
* Delete a file based on the database-table id pair by id
*
* @param databaseId The database-table id pair
* @param tableId The database-table id pair
* @param fileId The file id
* @throws MetadataDatabaseNotFoundException The deposit was not found on the metadata database
* @throws ZenodoAuthenticationException Token invalid
* @throws ZenodoNotFoundException The deposit id was not found on the remote server
* @throws ZenodoApiException Something other went wrong
*/
void deleteResource(Long databaseId, Long tableId, String fileId)
throws MetadataDatabaseNotFoundException, ZenodoAuthenticationException, ZenodoNotFoundException,
ZenodoApiException;
......
......@@ -10,12 +10,44 @@ import java.util.List;
@Service
public interface MetadataService {
/**
* List all deposits (e.g. datasets) available
*
* @return The deposists
* @throws ZenodoAuthenticationException Token invalid
* @throws ZenodoApiException Something other went wrong
*/
List<DepositResponseDto> listCitations() throws ZenodoAuthenticationException, ZenodoApiException;
/**
* Create a new deposit
*
* @return The created deposit
* @throws ZenodoAuthenticationException Token invalid
* @throws ZenodoApiException Something other went wrong
*/
DepositChangeResponseDto storeCitation() throws ZenodoAuthenticationException, ZenodoApiException;
/**
* Update a deposit with new metadata for a given id
*
* @param id The id
* @param data The new metadata
* @return The updated deposit
* @throws ZenodoAuthenticationException Token invalid
* @throws ZenodoApiException Something other went wrong
* @throws ZenodoNotFoundException The deposit id was not found on the remote server
*/
DepositChangeResponseDto updateCitation(Long id, DepositChangeRequestDto data) throws ZenodoAuthenticationException,
ZenodoApiException, ZenodoNotFoundException;
/**
* Delete a deposit from a given id
*
* @param id The id
* @throws ZenodoAuthenticationException Token invalid
* @throws ZenodoApiException Something other went wrong
*/
void deleteCitation(Long id) throws ZenodoAuthenticationException, ZenodoApiException;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment