Interface EventBusService

    • 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
      • getProxy

        static <T> Future<T> getProxy​(ServiceDiscovery discovery,
                                      Class<T> itf)
        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
        Returns:
        a future notified with the client
      • getProxy

        static <T> Future<T> getProxy​(ServiceDiscovery discovery,
                                      Class<T> itf,
                                      JsonObject conf)
        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
        conf - the configuration for message delivery
        Returns:
        a future notified with the client
      • getServiceProxy

        static <T> Future<T> getServiceProxy​(ServiceDiscovery discovery,
                                             java.util.function.Function<Record,​Boolean> filter,
                                             Class<T> clientClass)
        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
        Returns:
        a future notified with the client
      • getServiceProxy

        static <T> Future<T> getServiceProxy​(ServiceDiscovery discovery,
                                             java.util.function.Function<Record,​Boolean> filter,
                                             Class<T> clientClass,
                                             JsonObject conf)
        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
        conf - the configuration for message delivery
        Returns:
        a future notified with the client
      • getServiceProxyWithJsonFilter

        static <T> Future<T> getServiceProxyWithJsonFilter​(ServiceDiscovery discovery,
                                                           JsonObject filter,
                                                           Class<T> clientClass)
        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
        Returns:
        a future notified with the client
      • getServiceProxyWithJsonFilter

        static <T> Future<T> getServiceProxyWithJsonFilter​(ServiceDiscovery discovery,
                                                           JsonObject filter,
                                                           Class<T> clientClass,
                                                           JsonObject conf)
        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
        conf - the configuration for message delivery
        Returns:
        a future notified with the client
      • 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