Interface ClientController

  • All Superinterfaces:
    Iterable<Client>
    All Known Implementing Classes:
    MapClientController, SuppliedClientController

    public interface ClientController
    extends Iterable<Client>
    This interface allows an application to flexibly decide how clients are managed, they could be in memory like the MapClientController, in a database, or Redis, whatever is best fit for the application(s) being developed. Webhooker only cares that one way or another it is able to store and get clients.
    • Method Detail

      • add

        Client add​(Client client)
        Add a new client to this controller.
        Parameters:
        client - The new client to add.
        Returns:
        The same client that was added.
      • get

        Client get​(UUID uuid)
        Get a client by UUID.
        Parameters:
        uuid - The UUID of the client to get.
        Returns:
        The client that is represented by this UUID, or null if no such client exists within the context of this controller.
      • getAll

        Map<UUID,​Client> getAll()
        Returns:
        A list of all clients.
      • add

        default Client add​(Dispatcher... callbacks)
        Create a new client.
        Parameters:
        callbacks - Any callbacks to associate with the client.
        Returns:
        Return the new client that was created.
      • add

        default Client add​(UUID uuid,
                           Dispatcher... callbacks)
        Create a new client.
        Parameters:
        uuid - The UUID of the client to get.
        callbacks - Any callbacks to associate with the client.
        Returns:
        Return the new client that was created.