Codota Logo
CompleteCredentialsService.add
Code IndexAdd Codota to your IDE (free)

How to use
add
method
in
org.eclipse.hono.service.credentials.CompleteCredentialsService

Best Java code snippets using org.eclipse.hono.service.credentials.CompleteCredentialsService.add (Showing top 2 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
LocalDateTime l =
  • Codota Iconnew LocalDateTime()
  • Codota IconLocalDateTime.now()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseLocalDateTime(text)
  • Smart code suggestions by Codota
}
origin: eclipse/hono

  protected static void register(
      final CompleteCredentialsService svc,
      final String tenant,
      final String deviceId,
      final String authId,
      final String type,
      final JsonObject clientContext,
      final JsonArray secrets,
      final TestContext ctx) {

    final JsonObject data = new JsonObject()
        .put(CredentialsConstants.FIELD_PAYLOAD_DEVICE_ID, deviceId)
        .put(CredentialsConstants.FIELD_AUTH_ID, authId)
        .put(CredentialsConstants.FIELD_TYPE, type)
        .put(CredentialsConstants.FIELD_SECRETS, secrets);

    if (clientContext != null) {
      data.mergeIn(clientContext);
    }

    final Async registration = ctx.async();
    svc.add("tenant", data, ctx.asyncAssertSuccess(s -> {
      assertThat(s.getStatus(), is(HttpURLConnection.HTTP_CREATED));
      registration.complete();
    }));
    registration.await();
  }
}
origin: eclipse/hono

/**
 * Verifies that only one set of credentials can be registered for an auth-id and type (per tenant).
 *
 * @param ctx The vert.x test context.
 */
@Test
public void testAddCredentialsRefusesDuplicateRegistration(final TestContext ctx) {
  register(getCompleteCredentialsService(), "tenant", "device", "myId", "myType", ctx);
  final JsonObject payload2 = new JsonObject()
      .put(CredentialsConstants.FIELD_PAYLOAD_DEVICE_ID, "other-device")
      .put(CredentialsConstants.FIELD_AUTH_ID, "myId")
      .put(CredentialsConstants.FIELD_TYPE, "myType")
      .put(CredentialsConstants.FIELD_SECRETS, new JsonArray());
  final Async add = ctx.async();
  getCompleteCredentialsService().add("tenant", payload2, ctx.asyncAssertSuccess(s -> {
    assertThat(s.getStatus(), is(HttpURLConnection.HTTP_CONFLICT));
    add.complete();
  }));
  add.await();
}
org.eclipse.hono.service.credentialsCompleteCredentialsServiceadd

Javadoc

Adds credentials for a device.

Popular methods of CompleteCredentialsService

  • get
  • getAll
    Gets all credentials registered for a device.
  • remove
    Removes credentials by authentication identifier and type.
  • removeAll
    Removes all credentials for a device.

Popular in Java

  • Reactive rest calls using spring rest template
  • getSupportFragmentManager (FragmentActivity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getExternalFilesDir (Context)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • MalformedURLException (java.net)
    Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a s
  • Socket (java.net)
    Provides a client-side TCP socket.
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now