io.vertx.servicediscovery.types

## Interface EventBusService

- All Superinterfaces:
    ServiceType

      public interface EventBusService
      extends ServiceType

  `ServiceType` for event bus services (service proxies). Consumers receive a service proxy to use the service.
  Author:
    Clement Escoffier

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `TYPE` Name of the type.

    - ### Fields inherited from interface io.vertx.servicediscovery.spi.ServiceType

      `UNKNOWN`

  - ### Method Summary

    All Methods Static Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Record` | `createRecord(String name, String address, Class itf)` Same as `createRecord(String, String, Class, JsonObject)` but without metadata.
    `static Record` | `createRecord(String name, String address, Class itf, JsonObject metadata)` Sugar method to creates a record for this type.
    `static Record` | `createRecord(String name, String address, String classname)` Creates a record based on the parameters.
    `static Record` | `createRecord(String name, String address, String itf, JsonObject metadata)` Sugar method to creates a record for this type.
    `static <T> T` | `getProxy(ServiceDiscovery discovery, Class<T> itf, Handler<AsyncResult<T>> resultHandler)` Lookup for a service record and if found, retrieve it and return the service object (used to consume the service).
    `static <T> T` | `getServiceProxy(ServiceDiscovery discovery, java.util.function.Function<Record,Boolean> filter, Class<T> clientClass, Handler<AsyncResult<T>> resultHandler)` Lookup for a service record and if found, retrieve it and return the service object (used to consume the service).
    `static <T> T` | `getServiceProxyWithJsonFilter(ServiceDiscovery discovery, JsonObject filter, Class<T> clientClass, Handler<AsyncResult<T>> resultHandler)` Lookup for a service record and if found, retrieve it and return the service object (used to consume the service).

    - ### Methods inherited from interface io.vertx.servicediscovery.spi.ServiceType

      `get, name`

- - ### Field Detail

    - #### TYPE

          static final String TYPE

      Name of the type.
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### createRecord

          static Record createRecord(String name,
                                     String address,
                                     Class itf,
                                     JsonObject metadata)

      Sugar method to creates a record for this type.

      The java interface is added to the metadata in the `service.interface` key.

      Parameters:
        `name` - the name of the service.
        `address` - the event bus address on which the service available
        `itf` - the Java interface
        `metadata` - the metadata
      Returns:
        the created record

    - #### createRecord

          static Record createRecord(String name,
                                     String address,
                                     String itf,
                                     JsonObject metadata)

      Sugar method to creates a record for this type.

      The java interface is added to the metadata in the `service.interface` key.

      Parameters:
        `name` - the name of the service.
        `address` - the event bus address on which the service available
        `itf` - the Java interface (name)
        `metadata` - the metadata
      Returns:
        the created record

    - #### createRecord

          static Record createRecord(String name,
                                     String address,
                                     Class itf)

      Same as `createRecord(String, String, Class, JsonObject)` but without metadata.
      Parameters:
        `name` - the name of the service
        `itf` - the Java interface
        `address` - the event bus address on which the service available
      Returns:
        the created record

    - #### getProxy

          static <T> T getProxy(ServiceDiscovery discovery,
                                Class<T> itf,
                                Handler<AsyncResult<T>> resultHandler)

      Lookup for a service record and if found, retrieve it and return the service object (used to consume the service). This is a convenient method to avoid explicit lookup and then retrieval of the service. A filter based on the request interface is used.
      Type Parameters:
        `T` - the service interface
      Parameters:
        `discovery` - the service discovery instance
        `itf` - the service interface
        `resultHandler` - the result handler
      Returns:
        `null`

    - #### getServiceProxy

          static <T> T getServiceProxy(ServiceDiscovery discovery,
                                       java.util.function.Function<Record,Boolean> filter,
                                       Class<T> clientClass,
                                       Handler<AsyncResult<T>> resultHandler)

      Lookup for a service record and if found, retrieve it and return the service object (used to consume the service). This is a convenient method to avoid explicit lookup and then retrieval of the service. This method requires to have the `clientClass` set with the expected set of client. This is important for usages not using Java so you can pass the expected type.
      Type Parameters:
        `T` - the type of the client class
      Parameters:
        `discovery` - the service discovery
        `filter` - the filter
        `clientClass` - the client class
        `resultHandler` - the result handler
      Returns:
        `null` - do not use

    - #### getServiceProxyWithJsonFilter

          static <T> T getServiceProxyWithJsonFilter(ServiceDiscovery discovery,
                                                     JsonObject filter,
                                                     Class<T> clientClass,
                                                     Handler<AsyncResult<T>> resultHandler)

      Lookup for a service record and if found, retrieve it and return the service object (used to consume the service). This is a convenient method to avoid explicit lookup and then retrieval of the service. This method requires to have the `clientClass` set with the expected set of client. This is important for usages not using Java so you can pass the expected type.
      Type Parameters:
        `T` - the type of the client class
      Parameters:
        `discovery` - the service discovery
        `filter` - the filter as json object
        `clientClass` - the client class
        `resultHandler` - the result handler
      Returns:
        `null` - do not use

    - #### createRecord

          static Record createRecord(String name,
                                     String address,
                                     String classname)

      Creates a record based on the parameters.
      Parameters:
        `name` - the service name
        `address` - the address
        `classname` - the payload class
      Returns:
        the record

Copyright © 2017. All rights reserved.