Search in sources :

Example 1 with Signal

use of org.eclipse.ditto.base.model.signals.Signal in project ditto by eclipse.

the class SignalFilter method matchesFilterBeforeEnrichment.

private static boolean matchesFilterBeforeEnrichment(final FilteredTopic filteredTopic, final Signal<?> signal) {
    final Optional<String> filterOptional = filteredTopic.getFilter();
    if (filterOptional.isPresent()) {
        // match filter ignoring "extraFields"
        final TopicPath topicPath = DITTO_PROTOCOL_ADAPTER.toTopicPath(signal);
        final PlaceholderResolver<TopicPath> topicPathPlaceholderResolver = PlaceholderFactory.newPlaceholderResolver(TOPIC_PATH_PLACEHOLDER, topicPath);
        final PlaceholderResolver<WithResource> resourcePlaceholderResolver = PlaceholderFactory.newPlaceholderResolver(RESOURCE_PLACEHOLDER, signal);
        final PlaceholderResolver<Object> timePlaceholderResolver = PlaceholderFactory.newPlaceholderResolver(TIME_PLACEHOLDER, new Object());
        final Criteria criteria = parseCriteria(filterOptional.get(), signal.getDittoHeaders(), topicPathPlaceholderResolver, resourcePlaceholderResolver, timePlaceholderResolver);
        final Set<JsonPointer> extraFields = filteredTopic.getExtraFields().map(JsonFieldSelector::getPointers).orElse(Collections.emptySet());
        if (signal instanceof ThingEvent) {
            return ThingEventToThingConverter.thingEventToThing((ThingEvent<?>) signal).filter(thing -> Thing3ValuePredicateVisitor.couldBeTrue(criteria, extraFields, thing, topicPathPlaceholderResolver, resourcePlaceholderResolver, timePlaceholderResolver)).isPresent();
        } else {
            final Thing emptyThing = Thing.newBuilder().build();
            return Thing3ValuePredicateVisitor.couldBeTrue(criteria, extraFields, emptyThing, topicPathPlaceholderResolver, resourcePlaceholderResolver, timePlaceholderResolver);
        }
    } else {
        return true;
    }
}
Also used : ThingEventToThingConverter(org.eclipse.ditto.things.model.signals.events.ThingEventToThingConverter) Command(org.eclipse.ditto.base.model.signals.commands.Command) PlaceholderResolver(org.eclipse.ditto.placeholders.PlaceholderResolver) Event(org.eclipse.ditto.base.model.signals.events.Event) Signal(org.eclipse.ditto.base.model.signals.Signal) AuthorizationContext(org.eclipse.ditto.base.model.auth.AuthorizationContext) ConnectionMonitor(org.eclipse.ditto.connectivity.service.messaging.monitoring.ConnectionMonitor) RqlPredicateParser(org.eclipse.ditto.rql.parser.RqlPredicateParser) PlaceholderFactory(org.eclipse.ditto.placeholders.PlaceholderFactory) Target(org.eclipse.ditto.connectivity.model.Target) Criteria(org.eclipse.ditto.rql.query.criteria.Criteria) WithEntityId(org.eclipse.ditto.base.model.entity.id.WithEntityId) DittoHeaders(org.eclipse.ditto.base.model.headers.DittoHeaders) Topic(org.eclipse.ditto.connectivity.model.Topic) COMMANDS(org.eclipse.ditto.protocol.TopicPath.Criterion.COMMANDS) CommandResponse(org.eclipse.ditto.base.model.signals.commands.CommandResponse) PolicyAnnouncement(org.eclipse.ditto.policies.model.signals.announcements.PolicyAnnouncement) ThingEvent(org.eclipse.ditto.things.model.signals.events.ThingEvent) JsonPointer(org.eclipse.ditto.json.JsonPointer) Nullable(javax.annotation.Nullable) NamespaceReader(org.eclipse.ditto.base.model.namespaces.NamespaceReader) ConnectivityAnnouncement(org.eclipse.ditto.connectivity.model.signals.announcements.ConnectivityAnnouncement) Thing(org.eclipse.ditto.things.model.Thing) DittoProtocolAdapter(org.eclipse.ditto.protocol.adapter.DittoProtocolAdapter) TopicPathPlaceholder(org.eclipse.ditto.protocol.placeholders.TopicPathPlaceholder) MessageCommand(org.eclipse.ditto.messages.model.signals.commands.MessageCommand) QueryFilterCriteriaFactory(org.eclipse.ditto.rql.query.filter.QueryFilterCriteriaFactory) Predicate(java.util.function.Predicate) FilteredTopic(org.eclipse.ditto.connectivity.model.FilteredTopic) Set(java.util.Set) TopicPath(org.eclipse.ditto.protocol.TopicPath) ThingId(org.eclipse.ditto.things.model.ThingId) Connection(org.eclipse.ditto.connectivity.model.Connection) Collectors(java.util.stream.Collectors) ConnectionMonitorRegistry(org.eclipse.ditto.connectivity.service.messaging.monitoring.ConnectionMonitorRegistry) TimePlaceholder(org.eclipse.ditto.placeholders.TimePlaceholder) List(java.util.List) MessageCommandResponse(org.eclipse.ditto.messages.model.signals.commands.MessageCommandResponse) EVENTS(org.eclipse.ditto.protocol.TopicPath.Criterion.EVENTS) JsonFieldSelector(org.eclipse.ditto.json.JsonFieldSelector) ResourcePlaceholder(org.eclipse.ditto.protocol.placeholders.ResourcePlaceholder) Optional(java.util.Optional) WithResource(org.eclipse.ditto.base.model.signals.WithResource) Collections(java.util.Collections) TopicPath(org.eclipse.ditto.protocol.TopicPath) Criteria(org.eclipse.ditto.rql.query.criteria.Criteria) JsonPointer(org.eclipse.ditto.json.JsonPointer) WithResource(org.eclipse.ditto.base.model.signals.WithResource) ThingEvent(org.eclipse.ditto.things.model.signals.events.ThingEvent) Thing(org.eclipse.ditto.things.model.Thing)

Example 2 with Signal

use of org.eclipse.ditto.base.model.signals.Signal in project ditto by eclipse.

the class StreamingSessionActor method createOutgoingSignalBehavior.

private Receive createOutgoingSignalBehavior() {
    final PartialFunction<Object, Object> setCorrelationIdAndStartAckForwarder = new PFBuilder<>().match(Signal.class, this::startAckForwarder).match(DittoRuntimeException.class, x -> x).build();
    final Receive publishSignal = ReceiveBuilder.create().match(SubscriptionEvent.class, signal -> {
        logger.debug("Got SubscriptionEvent in <{}> session, publishing: {}", type, signal);
        eventAndResponsePublisher.offer(SessionedJsonifiable.subscription(signal));
    }).match(CommandResponse.class, this::publishResponseOrError).match(DittoRuntimeException.class, this::publishResponseOrError).match(Signal.class, this::isSameOrigin, signal -> logger.withCorrelationId(signal).debug("Got Signal of type <{}> in <{}> session, but this was issued by " + " this connection itself, not publishing", signal.getType(), type)).match(Signal.class, signal -> {
        // check if this session is "allowed" to receive the Signal
        final var streamingType = determineStreamingType(signal);
        @Nullable final var session = streamingSessions.get(streamingType);
        if (null != session && isSessionAllowedToReceiveSignal(signal, session, streamingType)) {
            final ThreadSafeDittoLoggingAdapter l = logger.withCorrelationId(signal);
            l.info("Publishing Signal of type <{}> in <{}> session", signal.getType(), type);
            l.debug("Publishing Signal of type <{}> in <{}> session: {}", type, signal.getType(), signal);
            final DittoHeaders sessionHeaders = DittoHeaders.newBuilder().authorizationContext(authorizationContext).schemaVersion(jsonSchemaVersion).build();
            final var sessionedJsonifiable = SessionedJsonifiable.signal(signal, sessionHeaders, session);
            eventAndResponsePublisher.offer(sessionedJsonifiable);
        }
    }).matchEquals(Done.getInstance(), done -> {
    /* already done, nothing to publish */
    }).build();
    return addPreprocessors(List.of(setCorrelationIdAndStartAckForwarder), publishSignal);
}
Also used : EntityIdPlaceholder(org.eclipse.ditto.connectivity.api.placeholders.EntityIdPlaceholder) PFBuilder(akka.japi.pf.PFBuilder) StreamingType(org.eclipse.ditto.internal.utils.pubsub.StreamingType) Terminated(akka.actor.Terminated) Acknowledgement(org.eclipse.ditto.base.model.signals.acks.Acknowledgement) Signal(org.eclipse.ditto.base.model.signals.Signal) DittoHeaderDefinition(org.eclipse.ditto.base.model.headers.DittoHeaderDefinition) RqlPredicateParser(org.eclipse.ditto.rql.parser.RqlPredicateParser) MessageCommandAckRequestSetter(org.eclipse.ditto.messages.model.signals.commands.acks.MessageCommandAckRequestSetter) DittoRuntimeException(org.eclipse.ditto.base.model.exceptions.DittoRuntimeException) Criteria(org.eclipse.ditto.rql.query.criteria.Criteria) DittoHeaders(org.eclipse.ditto.base.model.headers.DittoHeaders) InvalidJwt(org.eclipse.ditto.gateway.service.streaming.InvalidJwt) DittoProtocolSub(org.eclipse.ditto.internal.utils.pubsub.DittoProtocolSub) ActorRef(akka.actor.ActorRef) Duration(java.time.Duration) Map(java.util.Map) RefreshSession(org.eclipse.ditto.gateway.service.streaming.RefreshSession) CommandResponse(org.eclipse.ditto.base.model.signals.commands.CommandResponse) PolicyAnnouncement(org.eclipse.ditto.policies.model.signals.announcements.PolicyAnnouncement) EnumSet(java.util.EnumSet) NamespaceReader(org.eclipse.ditto.base.model.namespaces.NamespaceReader) SubscriptionManager(org.eclipse.ditto.internal.utils.search.SubscriptionManager) SourceQueueWithComplete(akka.stream.javadsl.SourceQueueWithComplete) SubscriptionEvent(org.eclipse.ditto.thingsearch.model.signals.events.SubscriptionEvent) PartialFunction(scala.PartialFunction) EnumMap(java.util.EnumMap) SignalInformationPoint(org.eclipse.ditto.internal.models.signal.SignalInformationPoint) QueryFilterCriteriaFactory(org.eclipse.ditto.rql.query.filter.QueryFilterCriteriaFactory) Done(akka.Done) Collection(java.util.Collection) ThingLiveCommandAckRequestSetter(org.eclipse.ditto.things.model.signals.commands.acks.ThingLiveCommandAckRequestSetter) GatewayInternalErrorException(org.eclipse.ditto.base.model.signals.commands.exceptions.GatewayInternalErrorException) Set(java.util.Set) GatewayWebsocketSessionExpiredException(org.eclipse.ditto.base.model.signals.commands.exceptions.GatewayWebsocketSessionExpiredException) Instant(java.time.Instant) FatalPubSubException(org.eclipse.ditto.base.model.acks.FatalPubSubException) DittoLoggerFactory(org.eclipse.ditto.internal.utils.akka.logging.DittoLoggerFactory) HeaderTranslator(org.eclipse.ditto.protocol.HeaderTranslator) List(java.util.List) ResourcePlaceholder(org.eclipse.ditto.protocol.placeholders.ResourcePlaceholder) Optional(java.util.Optional) Props(akka.actor.Props) Connect(org.eclipse.ditto.gateway.service.streaming.Connect) StartStreaming(org.eclipse.ditto.gateway.service.streaming.StartStreaming) ThingSearchCommand(org.eclipse.ditto.thingsearch.model.signals.commands.ThingSearchCommand) Event(org.eclipse.ditto.base.model.signals.events.Event) AcknowledgementConfig(org.eclipse.ditto.internal.models.acks.config.AcknowledgementConfig) AcknowledgementLabel(org.eclipse.ditto.base.model.acks.AcknowledgementLabel) AuthorizationContext(org.eclipse.ditto.base.model.auth.AuthorizationContext) Jwt(org.eclipse.ditto.gateway.service.streaming.Jwt) DittoHeaderInvalidException(org.eclipse.ditto.base.model.exceptions.DittoHeaderInvalidException) ThreadSafeDittoLoggingAdapter(org.eclipse.ditto.internal.utils.akka.logging.ThreadSafeDittoLoggingAdapter) GatewayWebsocketSessionClosedException(org.eclipse.ditto.base.model.signals.commands.exceptions.GatewayWebsocketSessionClosedException) AbstractActorWithTimers(akka.actor.AbstractActorWithTimers) Nullable(javax.annotation.Nullable) JwtAuthenticationResultProvider(org.eclipse.ditto.gateway.service.security.authentication.jwt.JwtAuthenticationResultProvider) TopicPathPlaceholder(org.eclipse.ditto.protocol.placeholders.TopicPathPlaceholder) JsonSchemaVersion(org.eclipse.ditto.base.model.json.JsonSchemaVersion) AcknowledgementLabelNotDeclaredException(org.eclipse.ditto.base.model.acks.AcknowledgementLabelNotDeclaredException) AcknowledgementAggregatorActorStarter(org.eclipse.ditto.internal.models.acks.AcknowledgementAggregatorActorStarter) StopStreaming(org.eclipse.ditto.gateway.service.streaming.StopStreaming) ImmutableJsonWebToken(org.eclipse.ditto.jwt.model.ImmutableJsonWebToken) TimePlaceholder(org.eclipse.ditto.placeholders.TimePlaceholder) ThingModifyCommandAckRequestSetter(org.eclipse.ditto.things.model.signals.commands.acks.ThingModifyCommandAckRequestSetter) JwtValidator(org.eclipse.ditto.gateway.service.security.authentication.jwt.JwtValidator) IncomingSignal(org.eclipse.ditto.gateway.service.streaming.IncomingSignal) AcknowledgementForwarderActor(org.eclipse.ditto.internal.models.acks.AcknowledgementForwarderActor) ReceiveBuilder(akka.japi.pf.ReceiveBuilder) AcknowledgementLabelNotUniqueException(org.eclipse.ditto.base.model.acks.AcknowledgementLabelNotUniqueException) Signal(org.eclipse.ditto.base.model.signals.Signal) IncomingSignal(org.eclipse.ditto.gateway.service.streaming.IncomingSignal) DittoHeaders(org.eclipse.ditto.base.model.headers.DittoHeaders) ThreadSafeDittoLoggingAdapter(org.eclipse.ditto.internal.utils.akka.logging.ThreadSafeDittoLoggingAdapter) CommandResponse(org.eclipse.ditto.base.model.signals.commands.CommandResponse) DittoRuntimeException(org.eclipse.ditto.base.model.exceptions.DittoRuntimeException) Nullable(javax.annotation.Nullable)

Example 3 with Signal

use of org.eclipse.ditto.base.model.signals.Signal in project ditto by eclipse.

the class PublishSignal method fromJson.

/**
 * Deserialize this command.
 *
 * @param jsonObject the JSON representation of this command.
 * @param dittoHeaders the Ditto headers of the underlying signal.
 * @param parseInnerJson function to parse the inner JSON.
 * @return the deserialized command.
 */
// called by reflection in AnnotationBasedJsonParsable.parse
@SuppressWarnings("unused")
public static PublishSignal fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders, final JsonParsable.ParseInnerJson parseInnerJson) {
    try {
        final Signal<?> signal = (Signal<?>) parseInnerJson.parseInnerJson(jsonObject.getValueOrThrow(JsonFields.SIGNAL));
        final Map<String, Integer> groups = jsonObject.getValueOrThrow(JsonFields.GROUPS).stream().collect(Collectors.toMap(JsonField::getKeyName, field -> field.getValue().asInt()));
        return new PublishSignal(signal, groups);
    } catch (final NotSerializableException e) {
        throw new JsonParseException(e.getMessage());
    }
}
Also used : JsonValue(org.eclipse.ditto.json.JsonValue) Command(org.eclipse.ditto.base.model.signals.commands.Command) JsonParseException(org.eclipse.ditto.json.JsonParseException) Predicate(java.util.function.Predicate) JsonSchemaVersion(org.eclipse.ditto.base.model.json.JsonSchemaVersion) Signal(org.eclipse.ditto.base.model.signals.Signal) JsonFieldDefinition(org.eclipse.ditto.json.JsonFieldDefinition) NotSerializableException(java.io.NotSerializableException) JsonParsableCommand(org.eclipse.ditto.base.model.json.JsonParsableCommand) Collectors(java.util.stream.Collectors) JsonObjectBuilder(org.eclipse.ditto.json.JsonObjectBuilder) Objects(java.util.Objects) JsonObject(org.eclipse.ditto.json.JsonObject) DittoHeaders(org.eclipse.ditto.base.model.headers.DittoHeaders) JsonFactory(org.eclipse.ditto.json.JsonFactory) AbstractCommand(org.eclipse.ditto.base.model.signals.commands.AbstractCommand) JsonParsable(org.eclipse.ditto.base.model.signals.JsonParsable) Map(java.util.Map) JsonField(org.eclipse.ditto.json.JsonField) JsonCollectors(org.eclipse.ditto.json.JsonCollectors) JsonPointer(org.eclipse.ditto.json.JsonPointer) Signal(org.eclipse.ditto.base.model.signals.Signal) NotSerializableException(java.io.NotSerializableException) JsonParseException(org.eclipse.ditto.json.JsonParseException)

Example 4 with Signal

use of org.eclipse.ditto.base.model.signals.Signal in project ditto by eclipse.

the class MessageMappingProcessorActorTest method testThingIdEnforcementExternalMessageInDittoProtocolIsProcessed.

@Test
public void testThingIdEnforcementExternalMessageInDittoProtocolIsProcessed() {
    final Enforcement mqttEnforcement = ConnectivityModelFactory.newEnforcement("{{ test:placeholder }}", "mqtt/topic/{{ thing:namespace }}/{{ thing:name }}");
    final EnforcementFilterFactory<String, Signal<?>> factory = EnforcementFactoryFactory.newEnforcementFilterFactory(mqttEnforcement, new TestPlaceholder());
    final EnforcementFilter<Signal<?>> enforcementFilter = factory.getFilter("mqtt/topic/my/thing");
    testExternalMessageInDittoProtocolIsProcessed(enforcementFilter);
}
Also used : Enforcement(org.eclipse.ditto.connectivity.model.Enforcement) Signal(org.eclipse.ditto.base.model.signals.Signal) OutboundSignal(org.eclipse.ditto.connectivity.api.OutboundSignal) InboundSignal(org.eclipse.ditto.connectivity.api.InboundSignal) Test(org.junit.Test)

Example 5 with Signal

use of org.eclipse.ditto.base.model.signals.Signal in project ditto by eclipse.

the class AbstractMessageMappingProcessorActorTest method testExternalMessageInDittoProtocolIsProcessed.

void testExternalMessageInDittoProtocolIsProcessed(@Nullable final EnforcementFilter<Signal<?>> enforcement, final boolean expectSuccess, @Nullable final String mapping, final Consumer<ThingErrorResponse> verifyErrorResponse) {
    new TestKit(actorSystem) {

        {
            final ActorRef outboundMappingProcessorActor = createOutboundMappingProcessorActor(this);
            final ActorRef inboundMappingProcessorActor = createInboundMappingProcessorActor(this, outboundMappingProcessorActor);
            final ModifyAttribute modifyCommand = createModifyAttributeCommand();
            final PayloadMapping mappings = ConnectivityModelFactory.newPayloadMapping(mapping);
            final ExternalMessage externalMessage = ExternalMessageFactory.newExternalMessageBuilder(modifyCommand.getDittoHeaders()).withText(ProtocolFactory.wrapAsJsonifiableAdaptable(DITTO_PROTOCOL_ADAPTER.toAdaptable(modifyCommand)).toJsonString()).withAuthorizationContext(TestConstants.Authorization.AUTHORIZATION_CONTEXT).withEnforcement(enforcement).withPayloadMapping(mappings).withInternalHeaders(HEADERS_WITH_REPLY_INFORMATION).build();
            TestProbe collectorProbe = TestProbe.apply("collector", actorSystem);
            inboundMappingProcessorActor.tell(new InboundMappingSink.ExternalMessageWithSender(externalMessage, collectorProbe.ref()), ActorRef.noSender());
            if (expectSuccess) {
                final ModifyAttribute modifyAttribute = expectMsgClass(ModifyAttribute.class);
                assertThat(modifyAttribute.getType()).isEqualTo(ModifyAttribute.TYPE);
                assertThat(modifyAttribute.getDittoHeaders().getCorrelationId()).contains(modifyCommand.getDittoHeaders().getCorrelationId().orElse(null));
                assertThat(modifyAttribute.getDittoHeaders().getAuthorizationContext()).isEqualTo(TestConstants.Authorization.AUTHORIZATION_CONTEXT);
                // thing ID is included in the header for error reporting
                assertThat(modifyAttribute.getDittoHeaders()).extracting(headers -> {
                    final String prefixedEntityId = headers.get(DittoHeaderDefinition.ENTITY_ID.getKey());
                    return prefixedEntityId.substring(prefixedEntityId.indexOf(":") + 1);
                }).isEqualTo(KNOWN_THING_ID.toString());
                // internal headers added by consumer actors are appended
                assertThat(modifyAttribute.getDittoHeaders()).containsEntry("ditto-reply-target", "0");
                final String expectedMapperHeader = mapping == null ? "default" : mapping;
                assertThat(modifyAttribute.getDittoHeaders().getInboundPayloadMapper()).contains(expectedMapperHeader);
                if (ADD_HEADER_MAPPER.equals(mapping)) {
                    assertThat(modifyAttribute.getDittoHeaders()).contains(AddHeaderMessageMapper.INBOUND_HEADER);
                }
                final ModifyAttributeResponse commandResponse = ModifyAttributeResponse.modified(KNOWN_THING_ID, modifyAttribute.getAttributePointer(), modifyAttribute.getDittoHeaders());
                outboundMappingProcessorActor.tell(commandResponse, getRef());
                final OutboundSignal.Mapped responseMessage = expectMsgClass(BaseClientActor.PublishMappedMessage.class).getOutboundSignal().first();
                if (ADD_HEADER_MAPPER.equals(mapping)) {
                    final Map<String, String> headers = responseMessage.getExternalMessage().getHeaders();
                    assertThat(headers).contains(AddHeaderMessageMapper.OUTBOUND_HEADER);
                }
            } else {
                final OutboundSignal errorResponse = expectMsgClass(BaseClientActor.PublishMappedMessage.class).getOutboundSignal();
                assertThat(errorResponse.getSource()).isInstanceOf(ThingErrorResponse.class);
                final ThingErrorResponse response = (ThingErrorResponse) errorResponse.getSource();
                verifyErrorResponse.accept(response);
            }
        }
    };
}
Also used : Arrays(java.util.Arrays) Acknowledgement(org.eclipse.ditto.base.model.signals.acks.Acknowledgement) Signal(org.eclipse.ditto.base.model.signals.Signal) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) DittoHeaderDefinition(org.eclipse.ditto.base.model.headers.DittoHeaderDefinition) ConfigValueFactory(com.typesafe.config.ConfigValueFactory) DittoHeaders(org.eclipse.ditto.base.model.headers.DittoHeaders) TestProbe(akka.testkit.TestProbe) ThingErrorResponse(org.eclipse.ditto.things.model.signals.commands.ThingErrorResponse) DittoAuthorizationContextType(org.eclipse.ditto.base.model.auth.DittoAuthorizationContextType) ActorRef(akka.actor.ActorRef) Duration(java.time.Duration) Map(java.util.Map) After(org.junit.After) ResponseType(org.eclipse.ditto.base.model.common.ResponseType) Patterns(akka.pattern.Patterns) HeaderMapping(org.eclipse.ditto.connectivity.model.HeaderMapping) TestNameCorrelationId(org.eclipse.ditto.base.model.correlationid.TestNameCorrelationId) Source(akka.stream.scaladsl.Source) AutoCloseableSoftAssertions(org.assertj.core.api.AutoCloseableSoftAssertions) ContentType(org.eclipse.ditto.base.model.headers.contenttype.ContentType) JsonValue(org.eclipse.ditto.json.JsonValue) DittoProtocolAdapter(org.eclipse.ditto.protocol.adapter.DittoProtocolAdapter) AuthorizationModelFactory(org.eclipse.ditto.base.model.auth.AuthorizationModelFactory) Set(java.util.Set) ThingId(org.eclipse.ditto.things.model.ThingId) OverflowStrategy(akka.stream.OverflowStrategy) Collectors(java.util.stream.Collectors) AllParametersAndReturnValuesAreNonnullByDefault(org.eclipse.ditto.utils.jsr305.annotations.AllParametersAndReturnValuesAreNonnullByDefault) ProtocolAdapterProvider(org.eclipse.ditto.internal.utils.protocol.ProtocolAdapterProvider) List(java.util.List) WithDittoHeaders(org.eclipse.ditto.base.model.headers.WithDittoHeaders) ActorSystem(akka.actor.ActorSystem) Optional(java.util.Optional) Props(akka.actor.Props) PayloadMappingDefinition(org.eclipse.ditto.connectivity.model.PayloadMappingDefinition) ConnectivityModelFactory(org.eclipse.ditto.connectivity.model.ConnectivityModelFactory) ConnectivityConfig(org.eclipse.ditto.connectivity.service.config.ConnectivityConfig) AuthorizationContext(org.eclipse.ditto.base.model.auth.AuthorizationContext) HashMap(java.util.HashMap) OutboundSignal(org.eclipse.ditto.connectivity.api.OutboundSignal) Materializer(akka.stream.Materializer) ActorSelection(akka.actor.ActorSelection) Target(org.eclipse.ditto.connectivity.model.Target) SourceBuilder(org.eclipse.ditto.connectivity.model.SourceBuilder) JsonObject(org.eclipse.ditto.json.JsonObject) ProtocolFactory(org.eclipse.ditto.protocol.ProtocolFactory) JsonifiableAdaptable(org.eclipse.ditto.protocol.JsonifiableAdaptable) ModifyAttributeResponse(org.eclipse.ditto.things.model.signals.commands.modify.ModifyAttributeResponse) ModifyAttribute(org.eclipse.ditto.things.model.signals.commands.modify.ModifyAttribute) ThreadSafeDittoLoggingAdapter(org.eclipse.ditto.internal.utils.akka.logging.ThreadSafeDittoLoggingAdapter) JsonPointer(org.eclipse.ditto.json.JsonPointer) Nullable(javax.annotation.Nullable) Before(org.junit.Before) ProtocolAdapter(org.eclipse.ditto.protocol.adapter.ProtocolAdapter) PayloadMapping(org.eclipse.ditto.connectivity.model.PayloadMapping) Placeholder(org.eclipse.ditto.placeholders.Placeholder) TestKit(akka.testkit.javadsl.TestKit) Connection(org.eclipse.ditto.connectivity.model.Connection) EnforcementFilter(org.eclipse.ditto.connectivity.model.EnforcementFilter) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) Acknowledgements(org.eclipse.ditto.base.model.signals.acks.Acknowledgements) ConnectivityCachingSignalEnrichmentProvider(org.eclipse.ditto.connectivity.service.mapping.ConnectivityCachingSignalEnrichmentProvider) Mockito(org.mockito.Mockito) ExternalMessageFactory(org.eclipse.ditto.connectivity.api.ExternalMessageFactory) Rule(org.junit.Rule) ConnectionId(org.eclipse.ditto.connectivity.model.ConnectionId) Collections(java.util.Collections) ExternalMessage(org.eclipse.ditto.connectivity.api.ExternalMessage) MappingContext(org.eclipse.ditto.connectivity.model.MappingContext) ThingErrorResponse(org.eclipse.ditto.things.model.signals.commands.ThingErrorResponse) ActorRef(akka.actor.ActorRef) ModifyAttribute(org.eclipse.ditto.things.model.signals.commands.modify.ModifyAttribute) ModifyAttributeResponse(org.eclipse.ditto.things.model.signals.commands.modify.ModifyAttributeResponse) PayloadMapping(org.eclipse.ditto.connectivity.model.PayloadMapping) TestKit(akka.testkit.javadsl.TestKit) OutboundSignal(org.eclipse.ditto.connectivity.api.OutboundSignal) TestProbe(akka.testkit.TestProbe) ExternalMessage(org.eclipse.ditto.connectivity.api.ExternalMessage)

Aggregations

Signal (org.eclipse.ditto.base.model.signals.Signal)29 DittoHeaders (org.eclipse.ditto.base.model.headers.DittoHeaders)19 Optional (java.util.Optional)16 Nullable (javax.annotation.Nullable)15 Collections (java.util.Collections)14 Collectors (java.util.stream.Collectors)14 DittoHeaderDefinition (org.eclipse.ditto.base.model.headers.DittoHeaderDefinition)14 Map (java.util.Map)13 Set (java.util.Set)13 Acknowledgement (org.eclipse.ditto.base.model.signals.acks.Acknowledgement)13 OutboundSignal (org.eclipse.ditto.connectivity.api.OutboundSignal)13 Connection (org.eclipse.ditto.connectivity.model.Connection)13 ActorRef (akka.actor.ActorRef)12 List (java.util.List)12 DittoRuntimeException (org.eclipse.ditto.base.model.exceptions.DittoRuntimeException)12 JsonObject (org.eclipse.ditto.json.JsonObject)12 CompletionStage (java.util.concurrent.CompletionStage)11 AcknowledgementLabel (org.eclipse.ditto.base.model.acks.AcknowledgementLabel)11 Target (org.eclipse.ditto.connectivity.model.Target)11 JsonValue (org.eclipse.ditto.json.JsonValue)11