congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
WithId
Code IndexAdd Tabnine to your IDE (free)

How to use
WithId
in
org.eclipse.ditto.signals.base

Best Java code snippets using org.eclipse.ditto.signals.base.WithId (Showing top 9 results out of 315)

origin: org.eclipse.ditto/ditto-services-connectivity-messaging

private static String namespaceFromId(final WithId withId) {
  return withId.getId().split(":", 2)[0];
}
origin: eclipse/ditto

private static String namespaceFromId(final WithId withId) {
  return withId.getId().split(":", 2)[0];
}
origin: eclipse/ditto

private static String namespaceFromId(final WithId withId) {
  return withId.getId().split(":", 2)[0];
}
origin: eclipse/ditto

private static String namespaceFromId(final WithId withId) {
  return withId.getId().split(":", 2)[0];
}
origin: org.eclipse.ditto/ditto-services-things-persistence

static IllegalArgumentException unhandled(final WithId command) {
  final String msgPattern = "This Thing Actor did not handle the requested Thing with ID <{0}>!";
  throw new IllegalArgumentException(MessageFormat.format(msgPattern, command.getId()));
}
origin: eclipse/ditto

static IllegalArgumentException unhandled(final WithId command) {
  final String msgPattern = "This Thing Actor did not handle the requested Thing with ID <{0}>!";
  throw new IllegalArgumentException(MessageFormat.format(msgPattern, command.getId()));
}
origin: org.eclipse.ditto/ditto-services-utils-cluster

@Override
public String entityId(final Object message) {
  if (message instanceof ShardedMessageEnvelope) {
    return ((ShardedMessageEnvelope) message).getId();
  } else if (message instanceof WithId) {
    return ((WithId) message).getId();
  } else if (message instanceof ShardRegion.StartEntity) {
    return ((ShardRegion.StartEntity) message).entityId();
  }
  return null;
}
origin: eclipse/ditto

@Override
public String entityId(final Object message) {
  if (message instanceof ShardedMessageEnvelope) {
    return ((ShardedMessageEnvelope) message).getId();
  } else if (message instanceof WithId) {
    return ((WithId) message).getId();
  } else if (message instanceof ShardRegion.StartEntity) {
    return ((ShardRegion.StartEntity) message).entityId();
  }
  return null;
}
origin: eclipse/ditto

/**
 * Blocks a {@code signal} if it relates to an entity within a blocked namespace.
 *
 * @param signal the signal to block.
 * @return a completion stage which either completes successfully with the given {@code signal} or exceptionally
 * with a {@code NamespaceBlockedException}.
 */
public CompletionStage<WithDittoHeaders> block(final WithDittoHeaders signal) {
  if (signal instanceof WithId) {
    final Optional<String> namespaceOptional = NamespaceReader.fromEntityId(((WithId) signal).getId());
    if (namespaceOptional.isPresent()) {
      final String namespace = namespaceOptional.get();
      return blockedNamespaces.contains(namespace)
          .thenApply(containsNamespace -> {
            if (containsNamespace != null && containsNamespace) {
              throw NamespaceBlockedException.newBuilder(namespace)
                  .dittoHeaders(signal.getDittoHeaders())
                  .build();
            } else {
              return signal;
            }
          });
    }
  }
  return CompletableFuture.completedFuture(signal);
}
org.eclipse.ditto.signals.baseWithId

Javadoc

Implementations of this interface are associated to an entity identified by the value returned from #getId().

Most used methods

  • getId
    Returns the identifier of the entity.

Popular in Java

  • Updating database using SQL prepared statement
  • setScale (BigDecimal)
  • addToBackStack (FragmentTransaction)
  • onCreateOptionsMenu (Activity)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • JButton (javax.swing)
  • Table (org.hibernate.mapping)
    A relational table
  • 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