Class ExecutionBase
- java.lang.Object
-
- de.gematik.ti.epa.vzd.gem.command.commandExecutions.ExecutionBase
-
- All Implemented Interfaces:
java.util.concurrent.Callable<BaseExecutionResult>
- Direct Known Subclasses:
AddDirEntryCertExecution,AddDirEntryExecution,DeleteDirEntryCertExecution,DeleteDirEntryExecution,ModifyDirEntryCertExecution,ModifyDirEntryExecution,ReadDirEntryCertExecution,ReadDirEntryExecution,SaveModifyDirEntryExecution
public abstract class ExecutionBase extends java.lang.Object implements java.util.concurrent.Callable<BaseExecutionResult>
Represents the base for every specific execution
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<CommandType>commandsprotected IConnectionPoolconnectionPoolprotected CommandNamesEnumexecCommandprotected static intFIRST_INDEX
-
Constructor Summary
Constructors Constructor Description ExecutionBase(IConnectionPool connectionPool, CommandNamesEnum cmd)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description BaseExecutionResultcall()booleancanHandleCommand(CommandNamesEnum cmd)Checks if the Executor can progress the named Commandabstract booleancheckValidation(CommandType command)Every single executor validates their commands and log the missing or wrong valuesprotected abstract java.util.concurrent.Callable<java.lang.Boolean>createCallable(CommandType command)Creates Callable to execute one commandprotected java.lang.StringextractExecutorName(ExecutionBase executor)Gets the name of the specific executor for loggingprotected java.lang.StringgetUid(CommandType command, GemApiClient apiClient)java.lang.StringgetUidByTelematikId(java.lang.String telematikId, GemApiClient apiClient)protected booleanisEntryPresent(CommandType command, GemApiClient apiClient)This function proceed a read command, to check if a entry without cert is already presentbooleanpostCheck()Checks if the execution was successful and logs the resultbooleanpreCheck(CommandType command)Checks the given command for validation and adds it to the queue of commands to executebooleansearchByUserCertificate(CommandType command, GemApiClient apiClient)
-
-
-
Field Detail
-
FIRST_INDEX
protected static final int FIRST_INDEX
- See Also:
- Constant Field Values
-
connectionPool
protected final IConnectionPool connectionPool
-
execCommand
protected CommandNamesEnum execCommand
-
commands
protected java.util.List<CommandType> commands
-
-
Constructor Detail
-
ExecutionBase
public ExecutionBase(IConnectionPool connectionPool, CommandNamesEnum cmd)
-
-
Method Detail
-
checkValidation
public abstract boolean checkValidation(CommandType command)
Every single executor validates their commands and log the missing or wrong values- Parameters:
command-- Returns:
-
createCallable
protected abstract java.util.concurrent.Callable<java.lang.Boolean> createCallable(CommandType command)
Creates Callable to execute one command- Parameters:
command-- Returns:
-
canHandleCommand
public boolean canHandleCommand(CommandNamesEnum cmd)
Checks if the Executor can progress the named Command- Parameters:
cmd-- Returns:
-
preCheck
public boolean preCheck(CommandType command)
Checks the given command for validation and adds it to the queue of commands to execute- Parameters:
command-- Returns:
-
extractExecutorName
protected java.lang.String extractExecutorName(ExecutionBase executor)
Gets the name of the specific executor for logging- Parameters:
executor-- Returns:
-
postCheck
public boolean postCheck()
Checks if the execution was successful and logs the result- Returns:
-
isEntryPresent
protected boolean isEntryPresent(CommandType command, GemApiClient apiClient) throws ApiException
This function proceed a read command, to check if a entry without cert is already present- Parameters:
command-- Returns:
- Throws:
ApiException
-
searchByUserCertificate
public boolean searchByUserCertificate(CommandType command, GemApiClient apiClient)
-
getUidByTelematikId
public java.lang.String getUidByTelematikId(java.lang.String telematikId, GemApiClient apiClient) throws ApiException- Throws:
ApiException
-
call
public BaseExecutionResult call()
- Specified by:
callin interfacejava.util.concurrent.Callable<BaseExecutionResult>
-
getUid
protected java.lang.String getUid(CommandType command, GemApiClient apiClient) throws ApiException
- Throws:
ApiException
-
-