Search in sources :

Example 6 with ProcessorDefinition

use of com.redhat.service.smartevents.infra.models.processors.ProcessorDefinition in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.

the class WebhookActionInvokerBuilderTest method createProcessor.

private ProcessorDTO createProcessor() {
    Action action = new Action();
    action.setType(WebhookAction.TYPE);
    Map<String, String> params = new HashMap<>();
    params.put(ENDPOINT_PARAM, TEST_ENDPOINT);
    action.setMapParameters(params);
    ProcessorDTO processor = new ProcessorDTO();
    processor.setType(ProcessorType.SINK);
    processor.setId("myProcessor");
    processor.setDefinition(new ProcessorDefinition(null, null, action));
    processor.setBridgeId("myBridge");
    return processor;
}
Also used : Action(com.redhat.service.smartevents.infra.models.gateways.Action) HashMap(java.util.HashMap) ProcessorDTO(com.redhat.service.smartevents.infra.models.dto.ProcessorDTO) ProcessorDefinition(com.redhat.service.smartevents.infra.models.processors.ProcessorDefinition)

Example 7 with ProcessorDefinition

use of com.redhat.service.smartevents.infra.models.processors.ProcessorDefinition in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.

the class ExecutorTestUtils method createSourceProcessor.

public static ProcessorDTO createSourceProcessor() {
    Source requestedSource = new Source();
    requestedSource.setType(SlackSource.TYPE);
    Action resolvedAction = new Action();
    resolvedAction.setType(WebhookAction.TYPE);
    return createProcessor(ProcessorType.SOURCE, new ProcessorDefinition(null, null, requestedSource, resolvedAction));
}
Also used : Action(com.redhat.service.smartevents.infra.models.gateways.Action) KafkaTopicAction(com.redhat.service.smartevents.processor.actions.kafkatopic.KafkaTopicAction) SendToBridgeAction(com.redhat.service.smartevents.processor.actions.sendtobridge.SendToBridgeAction) WebhookAction(com.redhat.service.smartevents.processor.actions.webhook.WebhookAction) ProcessorDefinition(com.redhat.service.smartevents.infra.models.processors.ProcessorDefinition) SlackSource(com.redhat.service.smartevents.processor.sources.slack.SlackSource) Source(com.redhat.service.smartevents.infra.models.gateways.Source)

Example 8 with ProcessorDefinition

use of com.redhat.service.smartevents.infra.models.processors.ProcessorDefinition in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.

the class ExecutorTestUtils method createSinkProcessorWithSameAction.

public static ProcessorDTO createSinkProcessorWithSameAction() {
    Action action = new Action();
    action.setType(KafkaTopicAction.TYPE);
    return createProcessor(ProcessorType.SINK, new ProcessorDefinition(null, null, action));
}
Also used : Action(com.redhat.service.smartevents.infra.models.gateways.Action) KafkaTopicAction(com.redhat.service.smartevents.processor.actions.kafkatopic.KafkaTopicAction) SendToBridgeAction(com.redhat.service.smartevents.processor.actions.sendtobridge.SendToBridgeAction) WebhookAction(com.redhat.service.smartevents.processor.actions.webhook.WebhookAction) ProcessorDefinition(com.redhat.service.smartevents.infra.models.processors.ProcessorDefinition)

Example 9 with ProcessorDefinition

use of com.redhat.service.smartevents.infra.models.processors.ProcessorDefinition in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.

the class ExecutorTestUtils method createSinkProcessorWithResolvedAction.

public static ProcessorDTO createSinkProcessorWithResolvedAction() {
    Action requestedAction = new Action();
    requestedAction.setType(SendToBridgeAction.TYPE);
    Action resolvedAction = new Action();
    resolvedAction.setType(WebhookAction.TYPE);
    return createProcessor(ProcessorType.SINK, new ProcessorDefinition(null, null, requestedAction, resolvedAction));
}
Also used : Action(com.redhat.service.smartevents.infra.models.gateways.Action) KafkaTopicAction(com.redhat.service.smartevents.processor.actions.kafkatopic.KafkaTopicAction) SendToBridgeAction(com.redhat.service.smartevents.processor.actions.sendtobridge.SendToBridgeAction) WebhookAction(com.redhat.service.smartevents.processor.actions.webhook.WebhookAction) ProcessorDefinition(com.redhat.service.smartevents.infra.models.processors.ProcessorDefinition)

Example 10 with ProcessorDefinition

use of com.redhat.service.smartevents.infra.models.processors.ProcessorDefinition in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.

the class TestSupport method newRequestedProcessorDTO.

public static ProcessorDTO newRequestedProcessorDTO() {
    Set<BaseFilter> filters = new HashSet<>();
    filters.add(new StringEquals("key", "value"));
    String transformationTemplate = "{\"test\": {key}}";
    Action a = new Action();
    a.setType(KafkaTopicAction.TYPE);
    Map<String, String> params = new HashMap<>();
    params.put(KafkaTopicAction.TOPIC_PARAM, "myTopic");
    a.setMapParameters(params);
    ProcessorDefinition definition = new ProcessorDefinition(filters, transformationTemplate, a);
    ProcessorDTO dto = new ProcessorDTO();
    dto.setType(PROCESSOR_TYPE);
    dto.setId(PROCESSOR_ID);
    dto.setName(PROCESSOR_NAME);
    dto.setDefinition(definition);
    dto.setBridgeId(BRIDGE_ID);
    dto.setCustomerId(CUSTOMER_ID);
    dto.setOwner(USER_NAME);
    dto.setStatus(PREPARING);
    dto.setKafkaConnection(KAFKA_CONNECTION_DTO);
    return dto;
}
Also used : StringEquals(com.redhat.service.smartevents.infra.models.filters.StringEquals) Action(com.redhat.service.smartevents.infra.models.gateways.Action) KafkaTopicAction(com.redhat.service.smartevents.processor.actions.kafkatopic.KafkaTopicAction) HashMap(java.util.HashMap) ProcessorDTO(com.redhat.service.smartevents.infra.models.dto.ProcessorDTO) ProcessorDefinition(com.redhat.service.smartevents.infra.models.processors.ProcessorDefinition) BaseFilter(com.redhat.service.smartevents.infra.models.filters.BaseFilter) HashSet(java.util.HashSet)

Aggregations

ProcessorDefinition (com.redhat.service.smartevents.infra.models.processors.ProcessorDefinition)16 Action (com.redhat.service.smartevents.infra.models.gateways.Action)12 Processor (com.redhat.service.smartevents.manager.models.Processor)9 KafkaTopicAction (com.redhat.service.smartevents.processor.actions.kafkatopic.KafkaTopicAction)7 HashMap (java.util.HashMap)5 WebhookAction (com.redhat.service.smartevents.processor.actions.webhook.WebhookAction)4 ProcessorDTO (com.redhat.service.smartevents.infra.models.dto.ProcessorDTO)3 BaseFilter (com.redhat.service.smartevents.infra.models.filters.BaseFilter)3 SendToBridgeAction (com.redhat.service.smartevents.processor.actions.sendtobridge.SendToBridgeAction)3 Source (com.redhat.service.smartevents.infra.models.gateways.Source)2 ProcessorResponse (com.redhat.service.smartevents.manager.api.models.responses.ProcessorResponse)2 Bridge (com.redhat.service.smartevents.manager.models.Bridge)2 AlreadyExistingItemException (com.redhat.service.smartevents.infra.exceptions.definitions.user.AlreadyExistingItemException)1 BadRequestException (com.redhat.service.smartevents.infra.exceptions.definitions.user.BadRequestException)1 ProcessorLifecycleException (com.redhat.service.smartevents.infra.exceptions.definitions.user.ProcessorLifecycleException)1 StringEquals (com.redhat.service.smartevents.infra.models.filters.StringEquals)1 SlackAction (com.redhat.service.smartevents.processor.actions.slack.SlackAction)1 SlackSource (com.redhat.service.smartevents.processor.sources.slack.SlackSource)1 QuarkusTest (io.quarkus.test.junit.QuarkusTest)1 HashSet (java.util.HashSet)1