/** * Create new Acl token * @param token properties of the token * @param idHandler will be provided with ID of created token * @return reference to this, for fluency */ public io.vertx.rxjava.ext.consul.ConsulClient createAclToken(AclToken token, Handler<AsyncResult<String>> idHandler) { delegate.createAclToken(token, idHandler); return this; }
@Override public ConsulService createAclToken(AclToken aclToken, Handler<AsyncResult<String>> idHandler) { consulClient.createAclToken(aclToken, idHandler); return this; }
/** * Create new Acl token * @param token properties of the token * @param idHandler will be provided with ID of created token * @return reference to this, for fluency */ public io.vertx.rxjava.ext.consul.ConsulClient createAclToken(AclToken token, Handler<AsyncResult<String>> idHandler) { delegate.createAclToken(token, idHandler); return this; }
public static io.vertx.ext.consul.ConsulClient createAclToken(io.vertx.ext.consul.ConsulClient j_receiver, java.util.Map<String, Object> token, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.String>> idHandler) { io.vertx.core.impl.ConversionHelper.fromObject(j_receiver.createAclToken(token != null ? new io.vertx.ext.consul.AclToken(io.vertx.core.impl.ConversionHelper.toJsonObject(token)) : null, idHandler != null ? new io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.String>>() { public void handle(io.vertx.core.AsyncResult<java.lang.String> ar) { idHandler.handle(ar.map(event -> event)); } } : null)); return j_receiver; } public static io.vertx.ext.consul.ConsulClient updateAclToken(io.vertx.ext.consul.ConsulClient j_receiver, java.util.Map<String, Object> token, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.String>> idHandler) {
private Future<String> createToken(ConsulTestNode node, String rules) { if (rules == null || rules.isEmpty()) { rules = ConsulTestEnv.DEFAULT_RULES; } if (masterClient == null) { createMasterClient(node); } Future<String> tokenFuture = Future.future(); masterClient.createAclToken(new AclToken().setType(AclTokenType.CLIENT).setName("token" + aclTokenCount.getAndIncrement()).setRules(rules), tokenFuture); return tokenFuture; }
.setName("tokenName") .setRules("key \"bar/\" { policy = \"read\" }"); ctx.masterClient().createAclToken(init, tc.asyncAssertSuccess(id -> { ctx.masterClient().infoAclToken(id, tc.asyncAssertSuccess(token -> { tc.assertEquals(id, token.getId());