Search in sources :

Example 1 with StreamingType

use of org.eclipse.ditto.internal.utils.pubsub.StreamingType 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 2 with StreamingType

use of org.eclipse.ditto.internal.utils.pubsub.StreamingType in project ditto by eclipse.

the class OutboundMappingProcessorActor method splitTargetsByExtraFields.

/**
 * Split the targets of an outbound signal into 2 parts: those without extra fields and those with.
 *
 * @param outboundSignal The outbound signal.
 * @return A pair of lists. The first list contains targets without matching extra fields.
 * The second list contains targets together with their extra fields matching the outbound signal.
 */
private static Pair<List<Target>, List<Pair<Target, FilteredTopic>>> splitTargetsByExtraFields(final OutboundSignal outboundSignal) {
    final Optional<StreamingType> streamingTypeOptional = StreamingType.fromSignal(outboundSignal.getSource());
    if (streamingTypeOptional.isPresent()) {
        // Find targets with a matching topic with extra fields
        final StreamingType streamingType = streamingTypeOptional.get();
        final List<Target> targetsWithoutExtraFields = new ArrayList<>(outboundSignal.getTargets().size());
        final List<Pair<Target, FilteredTopic>> targetsWithExtraFields = new ArrayList<>(outboundSignal.getTargets().size());
        for (final Target target : outboundSignal.getTargets()) {
            final Optional<FilteredTopic> matchingExtraFields = target.getTopics().stream().filter(filteredTopic -> filteredTopic.getExtraFields().isPresent() && streamingType == StreamingType.fromTopic(filteredTopic.getTopic().getPubSubTopic())).findAny();
            if (matchingExtraFields.isPresent()) {
                targetsWithExtraFields.add(Pair.create(target, matchingExtraFields.get()));
            } else {
                targetsWithoutExtraFields.add(target);
            }
        }
        return Pair.create(targetsWithoutExtraFields, targetsWithExtraFields);
    } else {
        // The outbound signal has no streaming type: Do not attach extra fields.
        return Pair.create(outboundSignal.getTargets(), Collections.emptyList());
    }
}
Also used : ThingEventToThingConverter(org.eclipse.ditto.things.model.signals.events.ThingEventToThingConverter) PFBuilder(akka.japi.pf.PFBuilder) PlaceholderResolver(org.eclipse.ditto.placeholders.PlaceholderResolver) StreamingType(org.eclipse.ditto.internal.utils.pubsub.StreamingType) 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) PlaceholderFactory(org.eclipse.ditto.placeholders.PlaceholderFactory) DittoRuntimeException(org.eclipse.ditto.base.model.exceptions.DittoRuntimeException) Criteria(org.eclipse.ditto.rql.query.criteria.Criteria) AcknowledgementRequest(org.eclipse.ditto.base.model.acks.AcknowledgementRequest) DittoHeaders(org.eclipse.ditto.base.model.headers.DittoHeaders) ConnectionValidator(org.eclipse.ditto.connectivity.service.messaging.validation.ConnectionValidator) ActorRef(akka.actor.ActorRef) CommandResponse(org.eclipse.ditto.base.model.signals.commands.CommandResponse) Mapped(org.eclipse.ditto.connectivity.api.OutboundSignal.Mapped) OutboundSignalFactory(org.eclipse.ditto.connectivity.api.OutboundSignalFactory) PrintWriter(java.io.PrintWriter) JsonValue(org.eclipse.ditto.json.JsonValue) DittoProtocolAdapter(org.eclipse.ditto.protocol.adapter.DittoProtocolAdapter) LimitsConfig(org.eclipse.ditto.base.service.config.limits.LimitsConfig) LogCategory(org.eclipse.ditto.connectivity.model.LogCategory) PartialFunction(scala.PartialFunction) QueryFilterCriteriaFactory(org.eclipse.ditto.rql.query.filter.QueryFilterCriteriaFactory) Done(akka.Done) Predicate(java.util.function.Predicate) FilteredTopic(org.eclipse.ditto.connectivity.model.FilteredTopic) Collection(java.util.Collection) MappingConfig(org.eclipse.ditto.connectivity.service.config.mapping.MappingConfig) Set(java.util.Set) ConnectivityMdcEntryKey(org.eclipse.ditto.connectivity.service.util.ConnectivityMdcEntryKey) Sink(akka.stream.javadsl.Sink) MetricDirection(org.eclipse.ditto.connectivity.model.MetricDirection) ThingId(org.eclipse.ditto.things.model.ThingId) Collectors(java.util.stream.Collectors) DROPPED(org.eclipse.ditto.connectivity.model.MetricType.DROPPED) Objects(java.util.Objects) ConnectionFailure(org.eclipse.ditto.connectivity.service.messaging.internal.ConnectionFailure) List(java.util.List) CompletionStage(java.util.concurrent.CompletionStage) Stream(java.util.stream.Stream) ConnectivitySignalEnrichmentProvider(org.eclipse.ditto.connectivity.service.mapping.ConnectivitySignalEnrichmentProvider) InfoProviderFactory(org.eclipse.ditto.connectivity.service.messaging.monitoring.logs.InfoProviderFactory) NotUsed(akka.NotUsed) ThingPredicateVisitor(org.eclipse.ditto.rql.query.things.ThingPredicateVisitor) 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) MonitoringConfig(org.eclipse.ditto.connectivity.service.config.MonitoringConfig) SignalEnrichmentFacade(org.eclipse.ditto.internal.models.signalenrichment.SignalEnrichmentFacade) Props(akka.actor.Props) DittoAcknowledgementLabel(org.eclipse.ditto.base.model.acks.DittoAcknowledgementLabel) ThingNotAccessibleException(org.eclipse.ditto.things.model.signals.commands.exceptions.ThingNotAccessibleException) AbstractGraphActor(org.eclipse.ditto.internal.utils.akka.controlflow.AbstractGraphActor) ConnectivityConfig(org.eclipse.ditto.connectivity.service.config.ConnectivityConfig) DefaultConnectionMonitorRegistry(org.eclipse.ditto.connectivity.service.messaging.monitoring.DefaultConnectionMonitorRegistry) Flow(akka.stream.javadsl.Flow) Source(akka.stream.javadsl.Source) AcknowledgementLabel(org.eclipse.ditto.base.model.acks.AcknowledgementLabel) ConnectionMonitor(org.eclipse.ditto.connectivity.service.messaging.monitoring.ConnectionMonitor) CompletableFuture(java.util.concurrent.CompletableFuture) OutboundSignal(org.eclipse.ditto.connectivity.api.OutboundSignal) Target(org.eclipse.ditto.connectivity.model.Target) ArrayList(java.util.ArrayList) ErrorResponse(org.eclipse.ditto.base.model.signals.commands.ErrorResponse) JsonObject(org.eclipse.ditto.json.JsonObject) WithEntityId(org.eclipse.ditto.base.model.entity.id.WithEntityId) SignalEnrichmentFailedException(org.eclipse.ditto.base.model.exceptions.SignalEnrichmentFailedException) ThreadSafeDittoLoggingAdapter(org.eclipse.ditto.internal.utils.akka.logging.ThreadSafeDittoLoggingAdapter) EntityId(org.eclipse.ditto.base.model.entity.id.EntityId) Nullable(javax.annotation.Nullable) TopicPathPlaceholder(org.eclipse.ditto.protocol.placeholders.TopicPathPlaceholder) JsonSchemaVersion(org.eclipse.ditto.base.model.json.JsonSchemaVersion) StringWriter(java.io.StringWriter) BoxedUnit(scala.runtime.BoxedUnit) TopicPath(org.eclipse.ditto.protocol.TopicPath) Connection(org.eclipse.ditto.connectivity.model.Connection) Pair(akka.japi.Pair) Acknowledgements(org.eclipse.ditto.base.model.signals.acks.Acknowledgements) TimePlaceholder(org.eclipse.ditto.placeholders.TimePlaceholder) MetricType(org.eclipse.ditto.connectivity.model.MetricType) LogType(org.eclipse.ditto.connectivity.model.LogType) Status(akka.actor.Status) ConditionChecker.checkNotEmpty(org.eclipse.ditto.base.model.common.ConditionChecker.checkNotEmpty) MappingOutcome(org.eclipse.ditto.connectivity.service.messaging.mappingoutcome.MappingOutcome) JsonField(org.eclipse.ditto.json.JsonField) Collections(java.util.Collections) MAPPED(org.eclipse.ditto.connectivity.model.MetricType.MAPPED) Target(org.eclipse.ditto.connectivity.model.Target) ArrayList(java.util.ArrayList) StreamingType(org.eclipse.ditto.internal.utils.pubsub.StreamingType) FilteredTopic(org.eclipse.ditto.connectivity.model.FilteredTopic) Pair(akka.japi.Pair)

Example 3 with StreamingType

use of org.eclipse.ditto.internal.utils.pubsub.StreamingType in project ditto by eclipse.

the class ProtocolMessageExtractor method getStartStreaming.

private StartStreaming getStartStreaming(final ProtocolMessageType protocolMessageType, final String protocolMsg) {
    final StreamingType streamingType = protocolMessageType.getStreamingTypeOrThrow();
    final Map<String, String> params = determineParams(protocolMsg);
    return StartStreaming.getBuilder(streamingType, connectionCorrelationId, connectionAuthContext).withNamespaces(getNamespaces(params.get(PARAM_NAMESPACES))).withFilter(params.get(PARAM_FILTER)).withExtraFields(getExtraFields(params.get(PARAM_EXTRA_FIELDS))).withCorrelationId(params.get(DittoHeaderDefinition.CORRELATION_ID.getKey())).build();
}
Also used : StreamingType(org.eclipse.ditto.internal.utils.pubsub.StreamingType)

Example 4 with StreamingType

use of org.eclipse.ditto.internal.utils.pubsub.StreamingType in project ditto by eclipse.

the class WebSocketRoute method streamingAckToString.

private static String streamingAckToString(final StreamingAck streamingAck) {
    final StreamingType streamingType = streamingAck.getStreamingType();
    final boolean subscribed = streamingAck.isSubscribed();
    final String protocolMessage;
    switch(streamingType) {
        case EVENTS:
            protocolMessage = subscribed ? ProtocolMessageType.START_SEND_EVENTS.toString() : ProtocolMessageType.STOP_SEND_EVENTS.toString();
            break;
        case MESSAGES:
            protocolMessage = subscribed ? ProtocolMessageType.START_SEND_MESSAGES.toString() : ProtocolMessageType.STOP_SEND_MESSAGES.toString();
            break;
        case LIVE_COMMANDS:
            protocolMessage = subscribed ? ProtocolMessageType.START_SEND_LIVE_COMMANDS.toString() : ProtocolMessageType.STOP_SEND_LIVE_COMMANDS.toString();
            break;
        case LIVE_EVENTS:
            protocolMessage = subscribed ? ProtocolMessageType.START_SEND_LIVE_EVENTS.toString() : ProtocolMessageType.STOP_SEND_LIVE_EVENTS.toString();
            break;
        case POLICY_ANNOUNCEMENTS:
            protocolMessage = subscribed ? ProtocolMessageType.START_SEND_POLICY_ANNOUNCEMENTS.toString() : ProtocolMessageType.STOP_SEND_POLICY_ANNOUNCEMENTS.toString();
            break;
        default:
            throw new IllegalArgumentException("Unknown streamingType: " + streamingType);
    }
    return protocolMessage + PROTOCOL_CMD_ACK_SUFFIX;
}
Also used : StreamingType(org.eclipse.ditto.internal.utils.pubsub.StreamingType)

Example 5 with StreamingType

use of org.eclipse.ditto.internal.utils.pubsub.StreamingType in project ditto by eclipse.

the class StreamingSessionActor method createPubSubBehavior.

private Receive createPubSubBehavior() {
    return ReceiveBuilder.create().match(StartStreaming.class, startStreaming -> {
        authorizationContext = startStreaming.getAuthorizationContext();
        Criteria criteria;
        try {
            criteria = startStreaming.getFilter().map(f -> parseCriteria(f, DittoHeaders.newBuilder().correlationId(startStreaming.getCorrelationId().orElse(startStreaming.getConnectionCorrelationId())).build())).orElse(null);
        } catch (final DittoRuntimeException e) {
            logger.info("Got 'DittoRuntimeException' <{}> session during 'StartStreaming' processing:" + " {}: <{}>", type, e.getClass().getSimpleName(), e.getMessage());
            eventAndResponsePublisher.offer(SessionedJsonifiable.error(e));
            return;
        }
        final var session = StreamingSession.of(startStreaming.getNamespaces(), criteria, startStreaming.getExtraFields().orElse(null), getSelf(), logger);
        streamingSessions.put(startStreaming.getStreamingType(), session);
        logger.debug("Got 'StartStreaming' message in <{}> session, subscribing for <{}> in Cluster ...", type, startStreaming.getStreamingType().name());
        outstandingSubscriptionAcks.add(startStreaming.getStreamingType());
        // In Cluster: Subscribe
        final var subscribeConfirmation = new ConfirmSubscription(startStreaming.getStreamingType());
        final Collection<StreamingType> currentStreamingTypes = streamingSessions.keySet();
        dittoProtocolSub.subscribe(currentStreamingTypes, authorizationContext.getAuthorizationSubjectIds(), getSelf()).whenComplete((ack, throwable) -> {
            if (null == throwable) {
                logger.debug("subscription to Ditto pubsub succeeded");
                getSelf().tell(subscribeConfirmation, getSelf());
            } else {
                logger.error(throwable, "subscription to Ditto pubsub failed: {}", throwable.getMessage());
                final var dittoRuntimeException = DittoRuntimeException.asDittoRuntimeException(throwable, cause -> GatewayInternalErrorException.newBuilder().dittoHeaders(DittoHeaders.newBuilder().correlationId(startStreaming.getConnectionCorrelationId()).build()).cause(cause).build());
                eventAndResponsePublisher.offer(SessionedJsonifiable.error(dittoRuntimeException));
                terminateWebsocketStream();
            }
        });
    }).match(StopStreaming.class, stopStreaming -> {
        logger.debug("Got 'StopStreaming' message in <{}> session, unsubscribing from <{}> in Cluster ...", type, stopStreaming.getStreamingType().name());
        streamingSessions.remove(stopStreaming.getStreamingType());
        // In Cluster: Unsubscribe
        final var unsubscribeConfirmation = new ConfirmUnsubscription(stopStreaming.getStreamingType());
        final Collection<StreamingType> currentStreamingTypes = streamingSessions.keySet();
        switch(stopStreaming.getStreamingType()) {
            case EVENTS:
                dittoProtocolSub.removeTwinSubscriber(getSelf(), authorizationContext.getAuthorizationSubjectIds()).thenAccept(ack -> getSelf().tell(unsubscribeConfirmation, getSelf()));
                break;
            case POLICY_ANNOUNCEMENTS:
                dittoProtocolSub.removePolicyAnnouncementSubscriber(getSelf(), authorizationContext.getAuthorizationSubjectIds()).thenAccept(ack -> getSelf().tell(unsubscribeConfirmation, getSelf()));
                break;
            case LIVE_COMMANDS:
            case LIVE_EVENTS:
            case MESSAGES:
            default:
                dittoProtocolSub.updateLiveSubscriptions(currentStreamingTypes, authorizationContext.getAuthorizationSubjectIds(), getSelf()).thenAccept(ack -> getSelf().tell(unsubscribeConfirmation, getSelf()));
        }
    }).match(ConfirmSubscription.class, msg -> confirmSubscription(msg.getStreamingType())).match(ConfirmUnsubscription.class, msg -> confirmUnsubscription(msg.getStreamingType())).build();
}
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) StopStreaming(org.eclipse.ditto.gateway.service.streaming.StopStreaming) Collection(java.util.Collection) Criteria(org.eclipse.ditto.rql.query.criteria.Criteria) StreamingType(org.eclipse.ditto.internal.utils.pubsub.StreamingType) DittoRuntimeException(org.eclipse.ditto.base.model.exceptions.DittoRuntimeException)

Aggregations

StreamingType (org.eclipse.ditto.internal.utils.pubsub.StreamingType)6 Done (akka.Done)3 ActorRef (akka.actor.ActorRef)3 Props (akka.actor.Props)3 PFBuilder (akka.japi.pf.PFBuilder)3 Collection (java.util.Collection)3 List (java.util.List)3 Optional (java.util.Optional)3 Set (java.util.Set)3 Nullable (javax.annotation.Nullable)3 AcknowledgementLabel (org.eclipse.ditto.base.model.acks.AcknowledgementLabel)3 DittoRuntimeException (org.eclipse.ditto.base.model.exceptions.DittoRuntimeException)3 DittoHeaderDefinition (org.eclipse.ditto.base.model.headers.DittoHeaderDefinition)3 DittoHeaders (org.eclipse.ditto.base.model.headers.DittoHeaders)3 JsonSchemaVersion (org.eclipse.ditto.base.model.json.JsonSchemaVersion)3 Signal (org.eclipse.ditto.base.model.signals.Signal)3 Acknowledgement (org.eclipse.ditto.base.model.signals.acks.Acknowledgement)3 CommandResponse (org.eclipse.ditto.base.model.signals.commands.CommandResponse)3 AbstractActorWithTimers (akka.actor.AbstractActorWithTimers)2 Terminated (akka.actor.Terminated)2