Tabnine Logo
Signal.getType
Code IndexAdd Tabnine to your IDE (free)

How to use
getType
method
in
org.eclipse.ditto.signals.base.Signal

Best Java code snippets using org.eclipse.ditto.signals.base.Signal.getType (Showing top 19 results out of 315)

origin: org.eclipse.ditto/ditto-signals-base

/**
 * Returns the name of the signal. This is gathered by the type of the signal by default.
 *
 * @return the name.
 */
@Override
default String getName() {
  return getType().contains(":") ? getType().split(":")[1] : getType();
}
origin: eclipse/ditto

/**
 * Returns the name of the signal. This is gathered by the type of the signal by default.
 *
 * @return the name.
 */
@Override
default String getName() {
  return getType().contains(":") ? getType().split(":")[1] : getType();
}
origin: org.eclipse.ditto/ditto-services-utils-tracing

/**
 * Prepares an {@link ExpiringTimerBuilder} with default {@link #AMQP_ROUNDTRIP_METRIC_NAME} and tags.
 * @param command The command to extract tags.
 * @return The prepared {@link ExpiringTimerBuilder}
 */
public static ExpiringTimerBuilder newAmqpRoundTripTimer(final Signal<?> command) {
  if (command instanceof Command) {
    return newAmqpRoundTripTimer((Command) command);
  }
  final String metricsUri = AMQP_ROUNDTRIP_METRIC_NAME + command.getType();
  return newExpiringTimer(metricsUri)
      .tag(TracingTags.COMMAND_TYPE, command.getType());
}
origin: eclipse/ditto

/**
 * Prepares an {@link ExpiringTimerBuilder} with default {@link #AMQP_ROUNDTRIP_METRIC_NAME} and tags.
 * @param command The command to extract tags.
 * @return The prepared {@link ExpiringTimerBuilder}
 */
public static ExpiringTimerBuilder newAmqpRoundTripTimer(final Signal<?> command) {
  if (command instanceof Command) {
    return newAmqpRoundTripTimer((Command) command);
  }
  final String metricsUri = AMQP_ROUNDTRIP_METRIC_NAME + command.getType();
  return newExpiringTimer(metricsUri)
      .tag(TracingTags.COMMAND_TYPE, command.getType());
}
origin: eclipse/ditto

private void handle(final ExternalMessage externalMessage) {
  ConditionChecker.checkNotNull(externalMessage);
  final String correlationId = externalMessage.getHeaders().get(DittoHeaderDefinition.CORRELATION_ID.getKey());
  LogUtil.enhanceLogWithCorrelationId(log, correlationId);
  LogUtil.enhanceLogWithCustomField(log, BaseClientData.MDC_CONNECTION_ID, connectionId);
  log.debug("Handling ExternalMessage: {}", externalMessage);
  try {
    final ExternalMessage messageWithAuthSubject = placeholderSubstitution.apply(externalMessage);
    final Optional<InboundExternalMessage> inboundMessageOpt = processor.process(messageWithAuthSubject);
    inboundMessageOpt.ifPresent(inboundMessage -> {
      final Signal<?> signal = inboundMessage.getSignal();
      enhanceLogUtil(signal);
      applySignalIdEnforcement.accept(messageWithAuthSubject, signal);
      final Signal<?> adjustedSignal = mapHeaders
          .andThen(mappedHeaders -> adjustHeaders.apply(messageWithAuthSubject, mappedHeaders))
          .andThen(signal::setDittoHeaders)
          .apply(inboundMessage);
      startTrace(adjustedSignal);
      // This message is important to check if a command is accepted for a specific connection, as this
      // happens quite a lot this is going to the debug level. Use best with a connection-id filter.
      log.debug("Message successfully mapped to signal: '{}'. Passing to conciergeForwarder", adjustedSignal
          .getType());
      conciergeForwarder.tell(adjustedSignal, getSelf());
    });
  } catch (final DittoRuntimeException e) {
    handleDittoRuntimeException(e, externalMessage.getHeaders());
  } catch (final Exception e) {
    log.warning("Got <{}> when message was processed: <{}>", e.getClass().getSimpleName(), e.getMessage());
  }
}
origin: org.eclipse.ditto/ditto-services-connectivity-messaging

private void handle(final ExternalMessage externalMessage) {
  ConditionChecker.checkNotNull(externalMessage);
  final String correlationId = externalMessage.getHeaders().get(DittoHeaderDefinition.CORRELATION_ID.getKey());
  LogUtil.enhanceLogWithCorrelationId(log, correlationId);
  LogUtil.enhanceLogWithCustomField(log, BaseClientData.MDC_CONNECTION_ID, connectionId);
  log.debug("Handling ExternalMessage: {}", externalMessage);
  try {
    final ExternalMessage messageWithAuthSubject = placeholderSubstitution.apply(externalMessage);
    final Optional<InboundExternalMessage> inboundMessageOpt = processor.process(messageWithAuthSubject);
    inboundMessageOpt.ifPresent(inboundMessage -> {
      final Signal<?> signal = inboundMessage.getSignal();
      enhanceLogUtil(signal);
      applySignalIdEnforcement.accept(messageWithAuthSubject, signal);
      final Signal<?> adjustedSignal = mapHeaders
          .andThen(mappedHeaders -> adjustHeaders.apply(messageWithAuthSubject, mappedHeaders))
          .andThen(signal::setDittoHeaders)
          .apply(inboundMessage);
      startTrace(adjustedSignal);
      // This message is important to check if a command is accepted for a specific connection, as this
      // happens quite a lot this is going to the debug level. Use best with a connection-id filter.
      log.debug("Message successfully mapped to signal: '{}'. Passing to conciergeForwarder", adjustedSignal
          .getType());
      conciergeForwarder.tell(adjustedSignal, getSelf());
    });
  } catch (final DittoRuntimeException e) {
    handleDittoRuntimeException(e, externalMessage.getHeaders());
  } catch (final Exception e) {
    log.warning("Got <{}> when message was processed: <{}>", e.getClass().getSimpleName(), e.getMessage());
  }
}
origin: eclipse/ditto

private void handleSignal(final Signal<?> signal) {
  LogUtil.enhanceLogWithCorrelationId(logger, signal);
  final DittoHeaders dittoHeaders = signal.getDittoHeaders();
  if (connectionCorrelationId.equals(dittoHeaders.getOrigin().orElse(null))) {
    logger.debug("Got Signal <{}> in <{}> session, " +
        "but this was issued by this connection itself, not telling "
        + "eventAndResponsePublisher about it", signal.getType(), type);
  } else {
    // check if this session is "allowed" to receive the LiveSignal
    if (authorizationSubjects != null &&
        !Collections.disjoint(dittoHeaders.getReadSubjects(), authorizationSubjects)) {
      if (matchesNamespaces(signal)) {
        if (matchesFilter(signal)) {
          logger.debug("Got Signal <{}> in <{}> session, " +
                  "telling eventAndResponsePublisher about it: {}",
              signal.getType(), type, signal);
          eventAndResponsePublisher.tell(signal, getSelf());
        } else {
          logger.debug("Signal does not match filter");
        }
      } else {
        logger.debug("Signal does not match namespaces");
      }
    }
  }
}
origin: eclipse/ditto

  private static ShardedMessageEnvelope createEnvelope(final EntityId entityId, final Signal<?> signal) {
    return ShardedMessageEnvelope.of(
        entityId.toString(),
        signal.getType(),
        signal.toJson(signal.getImplementedSchemaVersion(), FieldType.regularOrSpecial()),
        signal.getDittoHeaders());
  }
}
origin: eclipse/ditto

private void handleOutboundSignal(final OutboundSignal signal) {
  enhanceLogUtil(signal.getSource());
  if (messageMappingProcessorActor != null) {
    messageMappingProcessorActor.tell(signal, getSender());
  } else {
    log.info("Cannot handle <{}> signal as there is no MessageMappingProcessor available.",
        signal.getSource().getType());
  }
}
origin: org.eclipse.ditto/ditto-services-connectivity-messaging

private void handleOutboundSignal(final OutboundSignal signal) {
  enhanceLogUtil(signal.getSource());
  if (messageMappingProcessorActor != null) {
    messageMappingProcessorActor.tell(signal, getSender());
  } else {
    log.info("Cannot handle <{}> signal as there is no MessageMappingProcessor available.",
        signal.getSource().getType());
  }
}
origin: org.eclipse.ditto/ditto-services-connectivity-messaging

        unresolvedPlaceholder -> log.info(UNRESOLVED_PLACEHOLDERS_MESSAGE, unresolvedPlaceholder));
log.debug("Forwarding signal <{}> to client actor with targets: {}.", signal.getType(), filteredTargets);
origin: eclipse/ditto

        unresolvedPlaceholder -> log.info(UNRESOLVED_PLACEHOLDERS_MESSAGE, unresolvedPlaceholder));
log.debug("Forwarding signal <{}> to client actor with targets: {}.", signal.getType(), filteredTargets);
origin: eclipse/ditto

final String signalType = transformedSignal.getType();
if (signalId.isEmpty()) {
  log.info("Sending signal without ID and type <{}> to concierge-dispatcherActor", signalType);
origin: eclipse/ditto

  logger.debug("Got new Signal <{}>, currently outstanding are <{}>", signal.getType(),
      outstandingCommandCorrelationIds.size());
  delegateActor.tell(signal, getSelf());
} else {
  logger.warning("Got a Signal <{}> without correlationId, NOT accepting/forwarding it: {}",
      signal.getType(), signal);
origin: org.eclipse.ditto/ditto-services-connectivity-messaging

private DittoRuntimeException unhandledExceptionForSignalInState(final Object signal,
    final BaseClientState state) {
  final DittoHeaders headers = signal instanceof WithDittoHeaders
      ? ((WithDittoHeaders) signal).getDittoHeaders()
      : DittoHeaders.empty();
  switch (state) {
    case CONNECTING:
    case DISCONNECTING:
      return ConnectionSignalIllegalException.newBuilder(connectionId())
          .operationName(state.name().toLowerCase())
          .timeout(CONNECTING_TIMEOUT)
          .dittoHeaders(headers)
          .build();
    default:
      final String signalType = signal instanceof Signal
          ? ((Signal) signal).getType()
          : "unknown"; // no need to disclose Java class of signal to clients
      return ConnectionSignalIllegalException.newBuilder(connectionId())
          .illegalSignalForState(signalType, state.name().toLowerCase())
          .dittoHeaders(headers)
          .build();
  }
}
origin: eclipse/ditto

private DittoRuntimeException unhandledExceptionForSignalInState(final Object signal,
    final BaseClientState state) {
  final DittoHeaders headers = signal instanceof WithDittoHeaders
      ? ((WithDittoHeaders) signal).getDittoHeaders()
      : DittoHeaders.empty();
  switch (state) {
    case CONNECTING:
    case DISCONNECTING:
      return ConnectionSignalIllegalException.newBuilder(connectionId())
          .operationName(state.name().toLowerCase())
          .timeout(CONNECTING_TIMEOUT)
          .dittoHeaders(headers)
          .build();
    default:
      final String signalType = signal instanceof Signal
          ? ((Signal) signal).getType()
          : "unknown"; // no need to disclose Java class of signal to clients
      return ConnectionSignalIllegalException.newBuilder(connectionId())
          .illegalSignalForState(signalType, state.name().toLowerCase())
          .dittoHeaders(headers)
          .build();
  }
}
origin: org.eclipse.ditto/ditto-services-connectivity-messaging

  final T replyTarget = toReplyTarget(replyToFromHeader);
  log().info("Publishing mapped response/error message of type <{}> to reply target <{}>",
      outbound.getSource().getType(), replyTarget);
  log().debug("Publishing mapped response/error message of type <{}> to reply target <{}>: {}",
      outbound.getSource().getType(), replyTarget, response);
    outboundSource.getType(), outbound.getTargets(), message);
outbound.getTargets().forEach(target -> {
  log().info("Publishing mapped message of type <{}> to target address <{}>",
      outboundSource.getType(), target.getAddress());
  try {
    final T publishTarget = toPublishTarget(target.getAddress());
origin: eclipse/ditto

  final T replyTarget = toReplyTarget(replyToFromHeader);
  log().info("Publishing mapped response/error message of type <{}> to reply target <{}>",
      outbound.getSource().getType(), replyTarget);
  log().debug("Publishing mapped response/error message of type <{}> to reply target <{}>: {}",
      outbound.getSource().getType(), replyTarget, response);
    outboundSource.getType(), outbound.getTargets(), message);
outbound.getTargets().forEach(target -> {
  log().info("Publishing mapped message of type <{}> to target address <{}>",
      outboundSource.getType(), target.getAddress());
  try {
    final T publishTarget = toPublishTarget(target.getAddress());
origin: eclipse/ditto

  } else {
    log(signal).warning("No outstanding responses receiver for CommandResponse <{}>",
        signal.getType());
        " looked up! Answering with ThingNotAccessibleException.", signal.getType(),
    signal.getId());
final ThingNotAccessibleException error = ThingNotAccessibleException.newBuilder(entityId().getId())
org.eclipse.ditto.signals.baseSignalgetType

Popular methods of Signal

  • getDittoHeaders
  • getId
  • setDittoHeaders
  • getImplementedSchemaVersion
  • getName
    Returns the name of the signal. This is gathered by the type of the signal by default.
  • getResourcePath
  • getResourceType
  • toJson

Popular in Java

  • Finding current android device location
  • scheduleAtFixedRate (ScheduledExecutorService)
  • scheduleAtFixedRate (Timer)
  • runOnUiThread (Activity)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now