All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.computate.smartvillage.enus.model.iotnode.IotNodeEnUSGenApiServiceVertxEBProxy Maven / Gradle / Ivy

Go to download

Red Hat Global Social Innovation Program is partnering with Boston University and Smarta Byar in order to collaborate on creating a global and open research platform allowing researchers to study what social sustainability means by using a digital twin of Veberöd, Sweden as the test village, supported by Smarta Byar. The goal of this collaboration is to build the open source technological infrastructure so that researchers can collaborate on this platform effectively to study mobility, public health, sustainability among other study areas to ultimately help define better the link between well being and eco-smart cities.

The newest version!
/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/

package org.computate.smartvillage.enus.model.iotnode;

import io.vertx.core.eventbus.DeliveryOptions;
import io.vertx.core.Vertx;
import io.vertx.core.Future;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.function.Function;
import io.vertx.serviceproxy.ServiceException;
import io.vertx.serviceproxy.ServiceExceptionMessageCodec;
import io.vertx.serviceproxy.ProxyUtils;

import io.vertx.ext.web.client.WebClient;
import io.vertx.ext.web.templ.handlebars.HandlebarsTemplateEngine;
import io.vertx.core.Vertx;
import io.vertx.pgclient.PgPool;
import io.vertx.kafka.client.producer.KafkaProducer;
import io.vertx.ext.web.api.service.ServiceRequest;
import io.vertx.core.WorkerExecutor;
import io.vertx.core.eventbus.EventBus;
import io.vertx.ext.web.api.service.ServiceResponse;
import io.vertx.ext.auth.oauth2.OAuth2Auth;
import io.vertx.ext.auth.authorization.AuthorizationProvider;
import io.vertx.core.AsyncResult;
import io.vertx.core.Handler;
/*
  Generated Proxy code - DO NOT EDIT
  @author Roger the Robot
*/

@SuppressWarnings({"unchecked", "rawtypes"})
public class IotNodeEnUSGenApiServiceVertxEBProxy implements IotNodeEnUSGenApiService {
  private Vertx _vertx;
  private String _address;
  private DeliveryOptions _options;
  private boolean closed;

  public IotNodeEnUSGenApiServiceVertxEBProxy(Vertx vertx, String address) {
    this(vertx, address, null);
  }

  public IotNodeEnUSGenApiServiceVertxEBProxy(Vertx vertx, String address, DeliveryOptions options) {
    this._vertx = vertx;
    this._address = address;
    this._options = options;
    try {
      this._vertx.eventBus().registerDefaultCodec(ServiceException.class, new ServiceExceptionMessageCodec());
    } catch (IllegalStateException ex) {
    }
  }

  @Override
  public void searchIotNode(ServiceRequest serviceRequest, Handler> eventHandler){
    if (closed) {
      eventHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
      return;
    }
    JsonObject _json = new JsonObject();
    _json.put("serviceRequest", serviceRequest != null ? serviceRequest.toJson() : null);

    DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
    _deliveryOptions.addHeader("action", "searchIotNode");
    _deliveryOptions.getHeaders().set("action", "searchIotNode");
    _vertx.eventBus().request(_address, _json, _deliveryOptions, res -> {
      if (res.failed()) {
        eventHandler.handle(Future.failedFuture(res.cause()));
      } else {
        eventHandler.handle(Future.succeededFuture(res.result().body() != null ? new io.vertx.ext.web.api.service.ServiceResponse((JsonObject)res.result().body()) : null));
      }
    });
  }
  @Override
  public void getIotNode(ServiceRequest serviceRequest, Handler> eventHandler){
    if (closed) {
      eventHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
      return;
    }
    JsonObject _json = new JsonObject();
    _json.put("serviceRequest", serviceRequest != null ? serviceRequest.toJson() : null);

    DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
    _deliveryOptions.addHeader("action", "getIotNode");
    _deliveryOptions.getHeaders().set("action", "getIotNode");
    _vertx.eventBus().request(_address, _json, _deliveryOptions, res -> {
      if (res.failed()) {
        eventHandler.handle(Future.failedFuture(res.cause()));
      } else {
        eventHandler.handle(Future.succeededFuture(res.result().body() != null ? new io.vertx.ext.web.api.service.ServiceResponse((JsonObject)res.result().body()) : null));
      }
    });
  }
  @Override
  public void patchIotNode(JsonObject body, ServiceRequest serviceRequest, Handler> eventHandler){
    if (closed) {
      eventHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
      return;
    }
    JsonObject _json = new JsonObject();
    _json.put("body", body);
    _json.put("serviceRequest", serviceRequest != null ? serviceRequest.toJson() : null);

    DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
    _deliveryOptions.addHeader("action", "patchIotNode");
    _deliveryOptions.getHeaders().set("action", "patchIotNode");
    _vertx.eventBus().request(_address, _json, _deliveryOptions, res -> {
      if (res.failed()) {
        eventHandler.handle(Future.failedFuture(res.cause()));
      } else {
        eventHandler.handle(Future.succeededFuture(res.result().body() != null ? new io.vertx.ext.web.api.service.ServiceResponse((JsonObject)res.result().body()) : null));
      }
    });
  }
  @Override
  public void patchIotNodeFuture(JsonObject body, ServiceRequest serviceRequest, Handler> eventHandler){
    if (closed) {
      eventHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
      return;
    }
    JsonObject _json = new JsonObject();
    _json.put("body", body);
    _json.put("serviceRequest", serviceRequest != null ? serviceRequest.toJson() : null);

    DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
    _deliveryOptions.addHeader("action", "patchIotNodeFuture");
    _deliveryOptions.getHeaders().set("action", "patchIotNodeFuture");
    _vertx.eventBus().request(_address, _json, _deliveryOptions, res -> {
      if (res.failed()) {
        eventHandler.handle(Future.failedFuture(res.cause()));
      } else {
        eventHandler.handle(Future.succeededFuture(res.result().body() != null ? new io.vertx.ext.web.api.service.ServiceResponse((JsonObject)res.result().body()) : null));
      }
    });
  }
  @Override
  public void postIotNode(JsonObject body, ServiceRequest serviceRequest, Handler> eventHandler){
    if (closed) {
      eventHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
      return;
    }
    JsonObject _json = new JsonObject();
    _json.put("body", body);
    _json.put("serviceRequest", serviceRequest != null ? serviceRequest.toJson() : null);

    DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
    _deliveryOptions.addHeader("action", "postIotNode");
    _deliveryOptions.getHeaders().set("action", "postIotNode");
    _vertx.eventBus().request(_address, _json, _deliveryOptions, res -> {
      if (res.failed()) {
        eventHandler.handle(Future.failedFuture(res.cause()));
      } else {
        eventHandler.handle(Future.succeededFuture(res.result().body() != null ? new io.vertx.ext.web.api.service.ServiceResponse((JsonObject)res.result().body()) : null));
      }
    });
  }
  @Override
  public void postIotNodeFuture(JsonObject body, ServiceRequest serviceRequest, Handler> eventHandler){
    if (closed) {
      eventHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
      return;
    }
    JsonObject _json = new JsonObject();
    _json.put("body", body);
    _json.put("serviceRequest", serviceRequest != null ? serviceRequest.toJson() : null);

    DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
    _deliveryOptions.addHeader("action", "postIotNodeFuture");
    _deliveryOptions.getHeaders().set("action", "postIotNodeFuture");
    _vertx.eventBus().request(_address, _json, _deliveryOptions, res -> {
      if (res.failed()) {
        eventHandler.handle(Future.failedFuture(res.cause()));
      } else {
        eventHandler.handle(Future.succeededFuture(res.result().body() != null ? new io.vertx.ext.web.api.service.ServiceResponse((JsonObject)res.result().body()) : null));
      }
    });
  }
  @Override
  public void putimportIotNode(JsonObject body, ServiceRequest serviceRequest, Handler> eventHandler){
    if (closed) {
      eventHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
      return;
    }
    JsonObject _json = new JsonObject();
    _json.put("body", body);
    _json.put("serviceRequest", serviceRequest != null ? serviceRequest.toJson() : null);

    DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
    _deliveryOptions.addHeader("action", "putimportIotNode");
    _deliveryOptions.getHeaders().set("action", "putimportIotNode");
    _vertx.eventBus().request(_address, _json, _deliveryOptions, res -> {
      if (res.failed()) {
        eventHandler.handle(Future.failedFuture(res.cause()));
      } else {
        eventHandler.handle(Future.succeededFuture(res.result().body() != null ? new io.vertx.ext.web.api.service.ServiceResponse((JsonObject)res.result().body()) : null));
      }
    });
  }
  @Override
  public void putimportIotNodeFuture(JsonObject body, ServiceRequest serviceRequest, Handler> eventHandler){
    if (closed) {
      eventHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
      return;
    }
    JsonObject _json = new JsonObject();
    _json.put("body", body);
    _json.put("serviceRequest", serviceRequest != null ? serviceRequest.toJson() : null);

    DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
    _deliveryOptions.addHeader("action", "putimportIotNodeFuture");
    _deliveryOptions.getHeaders().set("action", "putimportIotNodeFuture");
    _vertx.eventBus().request(_address, _json, _deliveryOptions, res -> {
      if (res.failed()) {
        eventHandler.handle(Future.failedFuture(res.cause()));
      } else {
        eventHandler.handle(Future.succeededFuture(res.result().body() != null ? new io.vertx.ext.web.api.service.ServiceResponse((JsonObject)res.result().body()) : null));
      }
    });
  }
  @Override
  public void searchpageIotNodeId(ServiceRequest serviceRequest, Handler> eventHandler){
    if (closed) {
      eventHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
      return;
    }
    JsonObject _json = new JsonObject();
    _json.put("serviceRequest", serviceRequest != null ? serviceRequest.toJson() : null);

    DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
    _deliveryOptions.addHeader("action", "searchpageIotNodeId");
    _deliveryOptions.getHeaders().set("action", "searchpageIotNodeId");
    _vertx.eventBus().request(_address, _json, _deliveryOptions, res -> {
      if (res.failed()) {
        eventHandler.handle(Future.failedFuture(res.cause()));
      } else {
        eventHandler.handle(Future.succeededFuture(res.result().body() != null ? new io.vertx.ext.web.api.service.ServiceResponse((JsonObject)res.result().body()) : null));
      }
    });
  }
  @Override
  public void searchpageIotNode(ServiceRequest serviceRequest, Handler> eventHandler){
    if (closed) {
      eventHandler.handle(Future.failedFuture(new IllegalStateException("Proxy is closed")));
      return;
    }
    JsonObject _json = new JsonObject();
    _json.put("serviceRequest", serviceRequest != null ? serviceRequest.toJson() : null);

    DeliveryOptions _deliveryOptions = (_options != null) ? new DeliveryOptions(_options) : new DeliveryOptions();
    _deliveryOptions.addHeader("action", "searchpageIotNode");
    _deliveryOptions.getHeaders().set("action", "searchpageIotNode");
    _vertx.eventBus().request(_address, _json, _deliveryOptions, res -> {
      if (res.failed()) {
        eventHandler.handle(Future.failedFuture(res.cause()));
      } else {
        eventHandler.handle(Future.succeededFuture(res.result().body() != null ? new io.vertx.ext.web.api.service.ServiceResponse((JsonObject)res.result().body()) : null));
      }
    });
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy