|
| 1 | +package org.evomaster.client.java.instrumentation; |
| 2 | + |
| 3 | +import java.io.Serializable; |
| 4 | +import java.util.ArrayList; |
| 5 | +import java.util.Collections; |
| 6 | +import java.util.List; |
| 7 | + |
| 8 | +/** |
| 9 | + * Info related to DynamoDB command execution. |
| 10 | + */ |
| 11 | +public class DynamoDbCommand implements Serializable { |
| 12 | + |
| 13 | + |
| 14 | + /** |
| 15 | + * Names of the tables the operation was applied to (with Batch operations, more than one table is possible) |
| 16 | + */ |
| 17 | + private final List<String> tableNames; |
| 18 | + /** |
| 19 | + * Name of the operation that was executed |
| 20 | + */ |
| 21 | + private final String operationName; |
| 22 | + /** |
| 23 | + * Actual executed operation |
| 24 | + */ |
| 25 | + private final Object request; |
| 26 | + /** |
| 27 | + * If the operation was successfully executed |
| 28 | + */ |
| 29 | + private final boolean successfullyExecuted; |
| 30 | + /** |
| 31 | + * Elapsed execution time |
| 32 | + */ |
| 33 | + private final long executionTime; |
| 34 | + |
| 35 | + public DynamoDbCommand(List<String> tableNames, String operationName, Object request, boolean successfullyExecuted, long executionTime) { |
| 36 | + this.tableNames = tableNames == null |
| 37 | + ? Collections.emptyList() |
| 38 | + : Collections.unmodifiableList(new ArrayList<>(tableNames)); |
| 39 | + this.operationName = operationName; |
| 40 | + this.request = request; |
| 41 | + this.successfullyExecuted = successfullyExecuted; |
| 42 | + this.executionTime = executionTime; |
| 43 | + } |
| 44 | + |
| 45 | + public List<String> getTableNames() { |
| 46 | + return tableNames; |
| 47 | + } |
| 48 | + |
| 49 | + public String getOperationName() { |
| 50 | + return operationName; |
| 51 | + } |
| 52 | + |
| 53 | + public Object getRequest() { |
| 54 | + return request; |
| 55 | + } |
| 56 | + |
| 57 | + public boolean isSuccessfullyExecuted() { |
| 58 | + return successfullyExecuted; |
| 59 | + } |
| 60 | + |
| 61 | + public long getExecutionTime() { |
| 62 | + return executionTime; |
| 63 | + } |
| 64 | +} |
0 commit comments