本文整理匯總了Java中io.vertx.core.eventbus.DeliveryOptions.addHeader方法的典型用法代碼示例。如果您正苦於以下問題:Java DeliveryOptions.addHeader方法的具體用法?Java DeliveryOptions.addHeader怎麽用?Java DeliveryOptions.addHeader使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類io.vertx.core.eventbus.DeliveryOptions
的用法示例。
在下文中一共展示了DeliveryOptions.addHeader方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getPortfolio
import io.vertx.core.eventbus.DeliveryOptions; //導入方法依賴的package包/類
public void getPortfolio(Handler<AsyncResult<Portfolio>> resultHandler) {
if (closed) {
resultHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
return;
}
JsonObject _json = new JsonObject();
DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
_deliveryOptions.addHeader("action", "getPortfolio");
_vertx.eventBus().<JsonObject>send(_address, _json, _deliveryOptions, res -> {
if (res.failed()) {
resultHandler.handle(Future.failedFuture(res.cause()));
} else {
resultHandler.handle(Future.succeededFuture(res.result().body() == null ? null : new Portfolio(res.result().body())));
}
});
}
示例2: buy
import io.vertx.core.eventbus.DeliveryOptions; //導入方法依賴的package包/類
public void buy(int amount, JsonObject quote, Handler<AsyncResult<Portfolio>> resultHandler) {
if (closed) {
resultHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
return;
}
JsonObject _json = new JsonObject();
_json.put("amount", amount);
_json.put("quote", quote);
DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
_deliveryOptions.addHeader("action", "buy");
_vertx.eventBus().<JsonObject>send(_address, _json, _deliveryOptions, res -> {
if (res.failed()) {
resultHandler.handle(Future.failedFuture(res.cause()));
} else {
resultHandler.handle(Future.succeededFuture(res.result().body() == null ? null : new Portfolio(res.result().body())));
}
});
}
示例3: sell
import io.vertx.core.eventbus.DeliveryOptions; //導入方法依賴的package包/類
public void sell(int amount, JsonObject quote, Handler<AsyncResult<Portfolio>> resultHandler) {
if (closed) {
resultHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
return;
}
JsonObject _json = new JsonObject();
_json.put("amount", amount);
_json.put("quote", quote);
DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
_deliveryOptions.addHeader("action", "sell");
_vertx.eventBus().<JsonObject>send(_address, _json, _deliveryOptions, res -> {
if (res.failed()) {
resultHandler.handle(Future.failedFuture(res.cause()));
} else {
resultHandler.handle(Future.succeededFuture(res.result().body() == null ? null : new Portfolio(res.result().body())));
}
});
}
示例4: evaluate
import io.vertx.core.eventbus.DeliveryOptions; //導入方法依賴的package包/類
public void evaluate(Handler<AsyncResult<Double>> resultHandler) {
if (closed) {
resultHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
return;
}
JsonObject _json = new JsonObject();
DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
_deliveryOptions.addHeader("action", "evaluate");
_vertx.eventBus().<Double>send(_address, _json, _deliveryOptions, res -> {
if (res.failed()) {
resultHandler.handle(Future.failedFuture(res.cause()));
} else {
resultHandler.handle(Future.succeededFuture(res.result().body()));
}
});
}
示例5: createNotification
import io.vertx.core.eventbus.DeliveryOptions; //導入方法依賴的package包/類
public NotificationService createNotification(Handler<AsyncResult<JsonObject>> resultHandler) {
if (closed) {
resultHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
return this;
}
JsonObject _json = new JsonObject();
DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
_deliveryOptions.addHeader("action", "createNotification");
_vertx.eventBus().<JsonObject>send(_address, _json, _deliveryOptions, res -> {
if (res.failed()) {
resultHandler.handle(Future.failedFuture(res.cause()));
} else {
resultHandler.handle(Future.succeededFuture(res.result().body()));
}
});
return this;
}
示例6: send
import io.vertx.core.eventbus.DeliveryOptions; //導入方法依賴的package包/類
public MailService send(MailMessage message, Handler<AsyncResult<MailResult>> resultHandler) {
if (closed) {
resultHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
return this;
}
JsonObject _json = new JsonObject();
_json.put("message", message == null ? null : message.toJson());
DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
_deliveryOptions.addHeader("action", "send");
_vertx.eventBus().<JsonObject>send(_address, _json, _deliveryOptions, res -> {
if (res.failed()) {
resultHandler.handle(Future.failedFuture(res.cause()));
} else {
resultHandler.handle(Future.succeededFuture(res.result().body() == null ? null : new MailResult(res.result().body())));
}
});
return this;
}
示例7: getConfiguration
import io.vertx.core.eventbus.DeliveryOptions; //導入方法依賴的package包/類
public ConfigurationProvider getConfiguration(String name, Handler<AsyncResult<JsonObject>> resultHandler) {
if (closed) {
resultHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
return this;
}
JsonObject _json = new JsonObject();
_json.put("name", name);
DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
_deliveryOptions.addHeader("action", "getConfiguration");
_vertx.eventBus().<JsonObject>send(_address, _json, _deliveryOptions, res -> {
if (res.failed()) {
resultHandler.handle(Future.failedFuture(res.cause()));
} else {
resultHandler.handle(Future.succeededFuture(res.result().body()));
}
});
return this;
}
示例8: retrieveStore
import io.vertx.core.eventbus.DeliveryOptions; //導入方法依賴的package包/類
public void retrieveStore(String sellerId, Handler<AsyncResult<Store>> resultHandler) {
if (closed) {
resultHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
return;
}
JsonObject _json = new JsonObject();
_json.put("sellerId", sellerId);
DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
_deliveryOptions.addHeader("action", "retrieveStore");
_vertx.eventBus().<JsonObject>send(_address, _json, _deliveryOptions, res -> {
if (res.failed()) {
resultHandler.handle(Future.failedFuture(res.cause()));
} else {
resultHandler.handle(Future.succeededFuture(res.result().body() == null ? null : new Store(res.result().body())));
}
});
}
示例9: stop
import io.vertx.core.eventbus.DeliveryOptions; //導入方法依賴的package包/類
public TaskService stop(Long taskId, String userId, Handler<AsyncResult<Void>> handler) {
if (closed) {
handler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
return this;
}
JsonObject _json = new JsonObject();
_json.put("taskId", taskId);
_json.put("userId", userId);
DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
_deliveryOptions.addHeader("action", "stop");
_vertx.eventBus().<Void>send(_address, _json, _deliveryOptions, res -> {
if (res.failed()) {
handler.handle(Future.failedFuture(res.cause()));
} else {
handler.handle(Future.succeededFuture(res.result().body()));
}
});
return this;
}
示例10: delete
import io.vertx.core.eventbus.DeliveryOptions; //導入方法依賴的package包/類
public RuleService delete(String factHandle, Handler<AsyncResult<Void>> handler) {
if (closed) {
handler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
return this;
}
JsonObject _json = new JsonObject();
_json.put("factHandle", factHandle);
DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
_deliveryOptions.addHeader("action", "delete");
_vertx.eventBus().<Void>send(_address, _json, _deliveryOptions, res -> {
if (res.failed()) {
handler.handle(Future.failedFuture(res.cause()));
} else {
handler.handle(Future.succeededFuture(res.result().body()));
}
});
return this;
}
示例11: query
import io.vertx.core.eventbus.DeliveryOptions; //導入方法依賴的package包/類
public void query(String graphqlQuery, Handler<AsyncResult<QueryResult>> resultHandler) {
if (closed) {
resultHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
return;
}
JsonObject _json = new JsonObject();
_json.put("graphqlQuery", graphqlQuery);
DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
_deliveryOptions.addHeader("action", "query");
_vertx.eventBus().<JsonObject>send(_address, _json, _deliveryOptions, res -> {
if (res.failed()) {
resultHandler.handle(Future.failedFuture(res.cause()));
} else {
resultHandler.handle(Future.succeededFuture(res.result().body() == null ? null : new QueryResult(res.result().body())));
}
});
}
示例12: deleteAllAccounts
import io.vertx.core.eventbus.DeliveryOptions; //導入方法依賴的package包/類
public AccountService deleteAllAccounts(Handler<AsyncResult<Void>> resultHandler) {
if (closed) {
resultHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
return this;
}
JsonObject _json = new JsonObject();
DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
_deliveryOptions.addHeader("action", "deleteAllAccounts");
_vertx.eventBus().<Void>send(_address, _json, _deliveryOptions, res -> {
if (res.failed()) {
resultHandler.handle(Future.failedFuture(res.cause()));
} else {
resultHandler.handle(Future.succeededFuture(res.result().body()));
}
});
return this;
}
示例13: buy
import io.vertx.core.eventbus.DeliveryOptions; //導入方法依賴的package包/類
public void buy(int amount, JsonObject quote, Handler<AsyncResult<Portfolio>> resultHandler) {
if (closed) {
resultHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
return;
}
JsonObject _json = new JsonObject();
_json.put("amount", amount);
_json.put("quote", quote);
DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
_deliveryOptions.addHeader("action", "buy");
_vertx.eventBus().<JsonObject>send(_address, _json, _deliveryOptions, res -> {
if (res.failed()) {
resultHandler.handle(Future.failedFuture(res.cause()));
} else {
resultHandler.handle(Future.succeededFuture(res.result().body() == null ? null : new Portfolio(res.result().body())));
}
});
}
示例14: initializePersistence
import io.vertx.core.eventbus.DeliveryOptions; //導入方法依賴的package包/類
public ProductService initializePersistence(Handler<AsyncResult<Void>> resultHandler) {
if (closed) {
resultHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
return this;
}
JsonObject _json = new JsonObject();
DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
_deliveryOptions.addHeader("action", "initializePersistence");
_vertx.eventBus().<Void>send(_address, _json, _deliveryOptions, res -> {
if (res.failed()) {
resultHandler.handle(Future.failedFuture(res.cause()));
} else {
resultHandler.handle(Future.succeededFuture(res.result().body()));
}
});
return this;
}
示例15: resume
import io.vertx.core.eventbus.DeliveryOptions; //導入方法依賴的package包/類
public TaskService resume(Long taskId, String userId, Handler<AsyncResult<Void>> handler) {
if (closed) {
handler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
return this;
}
JsonObject _json = new JsonObject();
_json.put("taskId", taskId);
_json.put("userId", userId);
DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
_deliveryOptions.addHeader("action", "resume");
_vertx.eventBus().<Void>send(_address, _json, _deliveryOptions, res -> {
if (res.failed()) {
handler.handle(Future.failedFuture(res.cause()));
} else {
handler.handle(Future.succeededFuture(res.result().body()));
}
});
return this;
}