public Optional getLockFromDynamoDB()

in src/main/java/com/amazonaws/services/dynamodbv2/AmazonDynamoDBLockClient.java [987:998]


    public Optional<LockItem> getLockFromDynamoDB(final GetLockOptions options) {
        Objects.requireNonNull(options, "AcquireLockOptions cannot be null");
        Objects.requireNonNull(options.getPartitionKey(), "Cannot lookup null key");
        final GetItemResponse result = this.readFromDynamoDB(options.getPartitionKey(), options.getSortKey());
        final Map<String, AttributeValue> item = result.item();

        if (item == null || item.isEmpty()) {
            return Optional.empty();
        }

        return Optional.of(this.createLockItem(options, item));
    }