Class MagicWebSocketClientProfile<C>
java.lang.Object
dev.ua.theroer.magicutils.http.MagicWebSocketClientProfile<C>
- Type Parameters:
C- config type driving the profile
- All Implemented Interfaces:
AutoCloseable
High-level runtime profile for named
MagicWebSocketClient instances.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbinding()Returns the underlying runtime binding.static <C> MagicWebSocketClientProfile.Builder<C> builder(MagicRuntime runtime, String name, Class<C> configClass) Creates a profile builder.voidclose()current()Returns the current client when available.name()Returns the runtime name of this profile.refresh()Rebuilds the current client from the latest config.require()Returns the current client or throws when unavailable.
-
Method Details
-
builder
public static <C> MagicWebSocketClientProfile.Builder<C> builder(MagicRuntime runtime, String name, Class<C> configClass) Creates a profile builder.- Type Parameters:
C- config type- Parameters:
runtime- runtime that owns the clientname- runtime component nameconfigClass- config class driving the client- Returns:
- builder instance
-
name
-
binding
Returns the underlying runtime binding.- Returns:
- config binding
-
current
Returns the current client when available.- Returns:
- optional current client
-
require
Returns the current client or throws when unavailable.- Returns:
- current client
-
refresh
Rebuilds the current client from the latest config.- Returns:
- rebuilt client
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-