// Get client registry for connection scope
IClientRegistry clientRegistry = connectionScope.getContext().getClientRegistry();
log.debug("Client registry: {}", (clientRegistry == null ? "is null" : "not null"));
// Get client from registry by id or create a new one
IClient client = clientRegistry.hasClient(id) ? clientRegistry.lookupClient(id) : clientRegistry.newClient(params);
// We have a context, and a client object.. time to init the connection.
conn.initialize(client);
// we could checked for banned clients here