All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.springwolf.bindings.sqs.scanners.operations.SqsOperationBindingProcessor Maven / Gradle / Ivy

There is a newer version: 1.8.0
Show newest version
// SPDX-License-Identifier: Apache-2.0
package io.github.springwolf.bindings.sqs.scanners.operations;

import io.github.springwolf.asyncapi.v3.bindings.sqs.SQSChannelBindingQueue;
import io.github.springwolf.asyncapi.v3.bindings.sqs.SQSOperationBinding;
import io.github.springwolf.bindings.sqs.annotations.SqsAsyncOperationBinding;
import io.github.springwolf.bindings.sqs.annotations.SqsAsyncQueueBinding;
import io.github.springwolf.core.asyncapi.scanners.bindings.operations.AbstractOperationBindingProcessor;
import io.github.springwolf.core.asyncapi.scanners.bindings.operations.ProcessedOperationBinding;

import java.util.ArrayList;
import java.util.List;

public class SqsOperationBindingProcessor extends AbstractOperationBindingProcessor {

    @Override
    protected ProcessedOperationBinding mapToOperationBinding(SqsAsyncOperationBinding bindingAnnotation) {
        List queues = new ArrayList<>();
        for (SqsAsyncQueueBinding queue : bindingAnnotation.queues()) {
            queues.add(SQSChannelBindingQueue.builder()
                    .name(queue.name())
                    .fifoQueue(queue.fifoQueue())
                    .build());
        }
        var operationBinding = SQSOperationBinding.builder().queues(queues).build();
        return new ProcessedOperationBinding("sqs", operationBinding);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy