io.vertx.codegen.annotations.Fluent Java Examples

The following examples show how to use io.vertx.codegen.annotations.Fluent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Job.java    From vertx-kue with Apache License 2.0 5 votes vote down vote up
@Fluent
public Job emitError(Throwable ex) {
  JsonObject errorMessage = new JsonObject().put("id", this.id)
    .put("message", ex.getMessage());
  eventBus.send(Kue.workerAddress("error"), errorMessage);
  eventBus.send(Kue.getCertainJobAddress("error", this), errorMessage);
  return this;
}
 
Example #2
Source File: Job.java    From vertx-kue with Apache License 2.0 5 votes vote down vote up
/**
 * Add on remove handler on event bus.
 *
 * @param removeHandler failure handler
 */
@Fluent
public Job onRemove(Handler<JsonObject> removeHandler) {
  this.on("start", message -> {
    removeHandler.handle((JsonObject) message.body());
  });
  return this;
}
 
Example #3
Source File: Job.java    From vertx-kue with Apache License 2.0 5 votes vote down vote up
/**
 * Send an event to event bus with some data.
 *
 * @param event event type
 * @param msg   data
 */
@Fluent
public Job emit(String event, Object msg) {
  logger.debug("[LOG] Emit: " + Kue.getCertainJobAddress(event, this));
  eventBus.send(Kue.getCertainJobAddress(event, this), msg);
  return this;
}
 
Example #4
Source File: KafkaProducer.java    From vertx-kafka-client with Apache License 2.0 4 votes vote down vote up
@Fluent
@Override
KafkaProducer<K, V> exceptionHandler(Handler<Throwable> handler);
 
Example #5
Source File: CallbackKue.java    From vertx-kue with Apache License 2.0 4 votes vote down vote up
@Fluent
CallbackKue jobDoneFail(Job job, Throwable ex);
 
Example #6
Source File: KafkaProducer.java    From vertx-kafka-client with Apache License 2.0 4 votes vote down vote up
@Fluent
KafkaProducer<K, V> abortTransaction(Handler<AsyncResult<Void>> handler);
 
Example #7
Source File: MySQLConnection.java    From vertx-sql-client with Apache License 2.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Fluent
@Override
MySQLConnection exceptionHandler(Handler<Throwable> handler);
 
Example #8
Source File: MySQLConnection.java    From vertx-sql-client with Apache License 2.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Fluent
@Override
MySQLConnection prepare(String sql, Handler<AsyncResult<PreparedStatement>> handler);
 
Example #9
Source File: CallbackKue.java    From vertx-kue with Apache License 2.0 4 votes vote down vote up
@Fluent
CallbackKue process(String type, int n, Handler<Job> handler);
 
Example #10
Source File: RowStream.java    From vertx-sql-client with Apache License 2.0 4 votes vote down vote up
@Fluent
@Override
RowStream<T> fetch(long l);
 
Example #11
Source File: KafkaWriteStream.java    From vertx-kafka-client with Apache License 2.0 4 votes vote down vote up
@Fluent
@Override
KafkaWriteStream<K, V> setWriteQueueMaxSize(int i);
 
Example #12
Source File: RowStream.java    From vertx-sql-client with Apache License 2.0 4 votes vote down vote up
@Fluent
@Override
RowStream<T> resume();
 
Example #13
Source File: MSSQLConnection.java    From vertx-sql-client with Apache License 2.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Fluent
@Override
MSSQLConnection closeHandler(Handler<Void> handler);
 
Example #14
Source File: CallbackKue.java    From vertx-kue with Apache License 2.0 4 votes vote down vote up
@Fluent
CallbackKue jobDone(Job job);
 
Example #15
Source File: ConsulClient.java    From vertx-consul-client with Apache License 2.0 2 votes vote down vote up
/**
 * Returns the checks associated with the service
 *
 * @param service       the service name
 * @param options       options used to request checks
 * @param resultHandler will be provided with list of checks
 * @return reference to this, for fluency
 * @see <a href="https://www.consul.io/api/health.html#list-checks-for-service">/v1/health/checks/:service</a> endpoint
 */
@Fluent
ConsulClient healthChecksWithOptions(String service, CheckQueryOptions options, Handler<AsyncResult<CheckList>> resultHandler);
 
Example #16
Source File: KafkaConsumer.java    From vertx-kafka-client with Apache License 2.0 2 votes vote down vote up
/**
 * Seek to the first offset for each of the given partitions.
 * <p>
 * Due to internal buffering of messages,
 * the {@linkplain #handler(Handler) record handler} will
 * continue to observe messages fetched with respect to the old offset
 * until some time <em>after</em> the given {@code completionHandler}
 * is called. In contrast, the once the given {@code completionHandler}
 * is called the {@link #batchHandler(Handler)} will only see messages
 * consistent with the new offset.
 *
 * @param topicPartitions topic partition for which seek
 * @param completionHandler handler called on operation completed
 * @return  current KafkaConsumer instance
 */
@Fluent
KafkaConsumer<K, V> seekToBeginning(Set<TopicPartition> topicPartitions, Handler<AsyncResult<Void>> completionHandler);
 
Example #17
Source File: KafkaConsumer.java    From vertx-kafka-client with Apache License 2.0 2 votes vote down vote up
/**
 * Subscribe to the given list of topics to get dynamically assigned partitions.
 * <p>
 * Due to internal buffering of messages, when changing the subscribed topics
 * the old set of topics may remain in effect
 * (as observed by the {@linkplain #handler(Handler)} record handler})
 * until some time <em>after</em> the given {@code completionHandler}
 * is called. In contrast, the once the given {@code completionHandler}
 * is called the {@link #batchHandler(Handler)} will only see messages
 * consistent with the new set of topics.
 *
 * @param topics  topics to subscribe to
 * @param completionHandler handler called on operation completed
 * @return  current KafkaConsumer instance
 */
@Fluent
KafkaConsumer<K, V> subscribe(Set<String> topics, Handler<AsyncResult<Void>> completionHandler);
 
Example #18
Source File: OrderService.java    From vertx-blueprint-microservice with Apache License 2.0 2 votes vote down vote up
/**
 * Save an order into the persistence.
 *
 * @param order         order data object
 * @param resultHandler async result handler
 */
@Fluent
OrderService createOrder(Order order, Handler<AsyncResult<Void>> resultHandler);
 
Example #19
Source File: CircuitBreaker.java    From vertx-circuit-breaker with Apache License 2.0 2 votes vote down vote up
/**
 * Sets a {@link Handler} invoked when the circuit breaker state switches to open.
 *
 * @param handler the handler, must not be {@code null}
 * @return the current {@link CircuitBreaker}
 */
@Fluent
CircuitBreaker openHandler(Handler<Void> handler);
 
Example #20
Source File: MqttEndpoint.java    From vertx-mqtt with Apache License 2.0 2 votes vote down vote up
/**
 * Sends the PUBREC message to the remote MQTT client
 *
 * @param publishMessageId identifier of the PUBLISH message to acknowledge
 * @return a reference to this, so the API can be used fluently
 */
@Fluent
MqttEndpoint publishReceived(int publishMessageId);
 
Example #21
Source File: MySQLConnection.java    From vertx-sql-client with Apache License 2.0 2 votes vote down vote up
/**
 * Send a INIT_DB command to change the default schema of the connection.
 *
 * @param schemaName name of the schema to change to
 * @param handler the handler notified with the execution result
 * @return a reference to this, so the API can be used fluently
 */
@Fluent
MySQLConnection specifySchema(String schemaName, Handler<AsyncResult<Void>> handler);
 
Example #22
Source File: ConsulClient.java    From vertx-consul-client with Apache License 2.0 2 votes vote down vote up
/**
 * Clone Acl token
 *
 * @param id        the ID of token to be cloned
 * @param idHandler will be provided with ID of cloned token
 * @return reference to this, for fluency
 * @see <a href="https://www.consul.io/api/acl.html#clone-acl-token">/v1/acl/clone/:uuid</a> endpoint
 */
@Fluent
ConsulClient cloneAclToken(String id, Handler<AsyncResult<String>> idHandler);
 
Example #23
Source File: KafkaConsumer.java    From vertx-kafka-client with Apache License 2.0 2 votes vote down vote up
/**
 * Get the set of partitions currently assigned to this consumer.
 *
 * @param handler handler called on operation completed
 * @return  current KafkaConsumer instance
 */
@Fluent
KafkaConsumer<K, V> assignment(Handler<AsyncResult<Set<TopicPartition>>> handler);
 
Example #24
Source File: KafkaProducer.java    From vertx-kafka-client with Apache License 2.0 2 votes vote down vote up
/**
 * Asynchronously write a record to a topic
 *
 * @param record  record to write
 * @param handler handler called on operation completed
 * @return  current KafkaWriteStream instance
 */
@Fluent
KafkaProducer<K, V> send(KafkaProducerRecord<K, V> record, Handler<AsyncResult<RecordMetadata>> handler);
 
Example #25
Source File: MqttEndpoint.java    From vertx-mqtt with Apache License 2.0 2 votes vote down vote up
/**
 * Set the pubrel handler on the MQTT endpoint. This handler is called when a PUBREL
 * message is received by the remote MQTT client
 *
 * @param handler the handler
 * @return a reference to this, so the API can be used fluently
 */
@Fluent
MqttEndpoint publishReleaseHandler(Handler<Integer> handler);
 
Example #26
Source File: ConsulClient.java    From vertx-consul-client with Apache License 2.0 2 votes vote down vote up
/**
 * Returns the nodes registered in a datacenter
 *
 * @param resultHandler will be provided with list of nodes
 * @param options       options used to request nodes
 * @return reference to this, for fluency
 * @see <a href="https://www.consul.io/api/catalog.html#list-nodes">/v1/catalog/nodes</a> endpoint
 */
@Fluent
ConsulClient catalogNodesWithOptions(NodeQueryOptions options, Handler<AsyncResult<NodeList>> resultHandler);
 
Example #27
Source File: MqttEndpoint.java    From vertx-mqtt with Apache License 2.0 2 votes vote down vote up
/**
 * Set the pingreq handler on the MQTT endpoint. This handler is called when a PINGREQ
 * message is received by the remote MQTT client. In any case the endpoint sends the
 * PINGRESP internally after executing this handler.
 *
 * @param handler the handler
 * @return a reference to this, so the API can be used fluently
 */
@Fluent
MqttEndpoint pingHandler(Handler<Void> handler);
 
Example #28
Source File: MySQLConnection.java    From vertx-sql-client with Apache License 2.0 2 votes vote down vote up
/**
 * Send a SET_OPTION command to set options for the current connection.
 *
 * @param option the options to set
 * @param handler the handler notified with the execution result
 * @return a reference to this, so the API can be used fluently
 */
@Fluent
MySQLConnection setOption(MySQLSetOption option, Handler<AsyncResult<Void>> handler);
 
Example #29
Source File: ConsulClient.java    From vertx-consul-client with Apache License 2.0 2 votes vote down vote up
/**
 * Removes all the key/value pair that corresponding to the specified key prefix
 *
 * @param keyPrefix     the prefix
 * @param resultHandler will be called on complete
 * @return reference to this, for fluency
 * @see <a href="https://www.consul.io/api/kv.html#delete-key">/v1/kv/:key</a> endpoint
 */
@Fluent
ConsulClient deleteValues(String keyPrefix, Handler<AsyncResult<Void>> resultHandler);
 
Example #30
Source File: Tuple.java    From vertx-sql-client with Apache License 2.0 2 votes vote down vote up
/**
 * Add a {@link JsonArray} value at the end of the tuple.
 *
 * @param value the value
 * @return a reference to this, so the API can be used fluently
 */
@Fluent
default Tuple addJsonArray(JsonArray value) {
  return addValue(value);
}