Package org.elypia.webhooker.controller
Interface ClientController
-
- 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 theMapClientController, 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 Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Clientadd(UUID uuid, Dispatcher... callbacks)Create a new client.Clientadd(Client client)Add a new client to this controller.default Clientadd(Dispatcher... callbacks)Create a new client.default Clientget(String uuidString)Clientget(UUID uuid)Get a client by UUID.Map<UUID,Client>getAll()default Iterator<Client>iterator()-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
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.
-
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.
-
-