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,GetInfoExecution,ModifyDirEntryExecution,ReadDirEntryCertExecution,ReadDirEntryExecution,SafeModifyDirEntryExecution
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 java.util.concurrent.Callable<java.lang.Boolean>createCallable(CommandType command)Creates Callable to execute one commandprotected abstract ExecutionResultexecuteCommand(CommandType command, GemApiClient apiClient)Function that execute one command and returns the resultprotected java.lang.StringextractExecutorName(ExecutionBase executor)Gets the name of the specific executor for loggingprotected java.lang.StringfindTelematiId(CommandType command)protected 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 executevoidreset()booleansearchByUserCertificate(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 java.util.concurrent.Callable<java.lang.Boolean> createCallable(CommandType command)
Creates Callable to execute one command- Parameters:
command-- Returns:
-
executeCommand
protected abstract ExecutionResult executeCommand(CommandType command, GemApiClient apiClient) throws ApiException, javax.xml.datatype.DatatypeConfigurationException
Function that execute one command and returns the result- Parameters:
command-apiClient-- Returns:
- Throws:
ApiExceptionjavax.xml.datatype.DatatypeConfigurationException
-
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
-
findTelematiId
protected java.lang.String findTelematiId(CommandType command)
-
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
-
reset
public void reset()
-
-