io.vertx.servicediscovery.types

## Interface DataSource

- All Superinterfaces:
    ServiceType
  All Known Subinterfaces:
    JDBCDataSource, RedisDataSource

      public interface DataSource
      extends ServiceType

  Parent interface for data source services. Data source services are databases. They have a "sub-type" indicating the technology they use.
  Author:
    Clement Escoffier

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `DS_TYPE`
    `static String` | `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 type, JsonObject location, JsonObject metadata)` Create a record representing a data source.
    `static void` | `getDataSourceMetadata(ServiceDiscovery discovery, JsonObject filter, Handler<AsyncResult<JsonObject>> resultHandler)` Gets the metadata of a data source service.

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

      `get, name`

- - ### Field Detail

    - #### DS_TYPE

          static final String DS_TYPE

      See Also:
        Constant Field Values

    - #### TYPE

          static final String TYPE

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getDataSourceMetadata

          static void getDataSourceMetadata(ServiceDiscovery discovery,
                                            JsonObject filter,
                                            Handler<AsyncResult<JsonObject>> resultHandler)

      Gets the metadata of a data source service. These metadata contains the location and the service metadata. This method may be used to create a client to access the data source.
      Parameters:
        `discovery` - the service discovery instance
        `filter` - the filter
        `resultHandler` - the result handler, called with a failed result if no service matches.

    - #### createRecord

          static Record createRecord(String name,
                                     String type,
                                     JsonObject location,
                                     JsonObject metadata)

      Create a record representing a data source.
      Parameters:
        `name` - the name of the service
        `type` - the type of data source (MySQL, Redis, Mongo...)
        `location` - the location of the data source
        `metadata` - additional metadata
      Returns:
        the created record

Copyright © 2016. All rights reserved.