2018-03-12 22:55:04 +01:00
|
|
|
package com.sismics.docs.core.util.action;
|
|
|
|
|
2018-03-29 17:59:47 +02:00
|
|
|
import com.sismics.docs.core.dao.dto.DocumentDto;
|
2018-03-12 22:55:04 +01:00
|
|
|
|
2023-04-09 21:31:53 +02:00
|
|
|
import jakarta.json.JsonObject;
|
2018-03-12 22:55:04 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Base action interface.
|
|
|
|
*
|
|
|
|
* @author bgamard
|
|
|
|
*/
|
|
|
|
public interface Action {
|
|
|
|
/**
|
|
|
|
* Execute the action.
|
|
|
|
*
|
|
|
|
* @param documentDto Document DTO
|
|
|
|
* @param action Action data
|
|
|
|
*/
|
|
|
|
void execute(DocumentDto documentDto, JsonObject action);
|
2018-03-13 14:09:39 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Validate the action.
|
|
|
|
*
|
|
|
|
* @param action Action data
|
|
|
|
* @throws Exception Validation error
|
|
|
|
*/
|
|
|
|
void validate(JsonObject action) throws Exception;
|
2018-03-12 22:55:04 +01:00
|
|
|
}
|