dev.fitko.fitconnect.api.services.events.CaseService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of client Show documentation
Show all versions of client Show documentation
Library that provides client access to the FIT-Connect api-endpoints for sending, subscribing and
routing
The newest version!
package dev.fitko.fitconnect.api.services.events;
import dev.fitko.fitconnect.api.domain.model.cases.Case;
import dev.fitko.fitconnect.api.domain.model.cases.Cases;
import dev.fitko.fitconnect.api.domain.model.event.EventLog;
import dev.fitko.fitconnect.api.domain.model.event.EventLogEntry;
import dev.fitko.fitconnect.api.domain.model.event.Status;
import dev.fitko.fitconnect.api.domain.model.event.authtags.AuthenticationTags;
import dev.fitko.fitconnect.api.domain.model.reply.Reply;
import dev.fitko.fitconnect.api.domain.model.reply.SentReply;
import dev.fitko.fitconnect.api.domain.model.submission.SentSubmission;
import dev.fitko.fitconnect.api.domain.model.submission.Submission;
import dev.fitko.fitconnect.api.exceptions.internal.EventLogException;
import dev.fitko.fitconnect.api.exceptions.internal.RestApiException;
import java.util.List;
import java.util.UUID;
/**
* A service that provides access to the {@link Submission}s {@link EventLog} and {@link Case} via the FIT-Connect REST-API.
* Every event is a recorded step within the process of sending a submission or a case.
* Events are encoded as security event tokens (SET).
**
* @see Event Documentation
* @see Submission-API
*/
public interface CaseService {
/**
* Get the {@link EventLog} by caseId.
*
* @param caseId unique case identifier
* @param destinationId unique identifier of the destination
* @return list of {@link EventLogEntry}
* @throws EventLogException if a technical error occurred or the validation failed
*/
List getEventLog(UUID caseId, UUID destinationId) throws EventLogException;
/**
* Lists all {@link Cases} that are visible to the client.
*
* @param limit max entries per request
* @param offset skip n elements
*
* @return list of cases
* @throws RestApiException if a technical error occurred
*/
Cases listCases(int limit, int offset) throws RestApiException;
/**
* Load a specific {@link Case} for a caseId.
*
* @return {@link Case}
* @throws RestApiException if a technical error occurred
*/
Case getCase(UUID caseId) throws RestApiException;
/**
* Retrieve the authentication tags for the submitted state of a submission.
*
* @return {@link AuthenticationTags} of the submit event
* @throws EventLogException if a validation error occurred
* @throws RestApiException if a technical error occurred
*/
AuthenticationTags getAuthenticationTags(Submission submission) throws RestApiException, EventLogException;
/**
* Retrieve the authentication tags for the submitted state of a reply.
*
* @return {@link AuthenticationTags} of the submit event
* @throws EventLogException if a validation error occurred
* @throws RestApiException if a technical error occurred
*/
AuthenticationTags getAuthenticationTags(Reply reply) throws RestApiException, EventLogException;
/**
* Send an event for a given caseId.
*
* @param caseId unique case identifier
* @param signedAndSerializedSET the serialised and signed event as SET string
* @throws EventLogException if a validation error occurred
* @throws RestApiException if a technical error occurred
*/
void sendEvent(UUID caseId, String signedAndSerializedSET) throws RestApiException, EventLogException;
/**
* Retrieve the latest status of a {@link Submission}.
*
* @return {@link Status} the current status
* @throws EventLogException if a validation failed
* @throws RestApiException if a technical error occurred
*/
Status getStatus(SentSubmission sentSubmission) throws RestApiException, EventLogException;
/**
* Retrieve the latest status of a {@link Reply}.
*
* @return {@link Status} the current status
* @throws EventLogException if a validation error occurred
* @throws RestApiException if a technical error occurred
*/
Status getStatus(SentReply reply) throws RestApiException, EventLogException;
/**
* Retrieve submitted state of a submission.
*
* @return {@link Status} the submitted status
* @throws EventLogException if a validation error occurred
* @throws RestApiException if a technical error occurred
*/
Status getSubmissionSubmitState(UUID caseId, UUID submissionId) throws RestApiException, EventLogException;
}