Interface DocumentGateway
- All Known Implementing Classes:
RestDocumentGateway
public interface DocumentGateway
Port to the documents the signed-in user keeps on the resource server. An implementation acts on behalf of the user
of the current request, never returns
null and reports every failure with one of the exceptions below, so no
transport or framework type reaches its callers.-
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteById(String id) Deletes one document of the signed-in user.list()Lists the documents the signed-in user may see.
-
Method Details
-
list
Lists the documents the signed-in user may see.- Returns:
- the documents, empty when there are none.
- Throws:
DocumentsUnauthorizedException- if the session holds no valid token for the user.DocumentsForbiddenException- if the user may not list documents.DocumentsUnavailableException- if the resource server cannot be reached or fails.
-
deleteById
Deletes one document of the signed-in user.- Parameters:
id- identifier of the document.- Throws:
DocumentsUnauthorizedException- if the session holds no valid token for the user.DocumentsForbiddenException- if the user may not delete documents.DocumentNotFoundException- if the document does not exist or belongs to someone else.DocumentsUnavailableException- if the resource server cannot be reached or fails.
-