Interface EndpointResolver<A extends Address,​S,​D,​E>

  • Type Parameters:
    A - the type of Address resolved
    S - the type of the endpoint server
    D - the type of the data managed by the resolver
    E - the type of the endpoint

    public interface EndpointResolver<A extends Address,​S,​D,​E>
    Endpoint resolver Service Provider Interface (SPI).

    {@link #resolve)} resolves an address to resolver managed state <S>. State modifying methods can be called concurrently, the implementation is responsible to manage concurrent state modifications.

    • Method Detail

      • tryCast

        A tryCast​(Address address)
        Try to cast the address to an address instance that can be resolved by this resolver instance.
        Parameters:
        address - the address to cast
        Returns:
        the address or null when the address cannot be resolved by this resolver
      • addressOf

        SocketAddress addressOf​(S server)
        Returns the socket address of a given endpoint server.
        Parameters:
        server - the endpoint server
        Returns:
        the server socket address
      • propertiesOf

        default JsonObject propertiesOf​(S server)
        Returns the known properties of a given server.
        Parameters:
        server - the endpoint
        Returns:
        the properties as a JSON object
      • resolve

        Future<D> resolve​(A address,
                          EndpointBuilder<E,​S> builder)
        Resolve an address to the resolver state for this name.
        Parameters:
        address - the address to resolve
        builder - the endpoint builder
        Returns:
        a future notified with the result
      • endpoint

        E endpoint​(D state)
        Return the current endpoint visible by the resolver.
        Parameters:
        state - the resolver state
        Returns:
        the list of endpoints
      • isValid

        boolean isValid​(D state)
        Check the state validity.
        Parameters:
        state - resolver state
        Returns:
        the state validity
      • dispose

        void dispose​(D data)
        Dispose the state.
        Parameters:
        data - the state
      • close

        void close()
        Close this resolver.