@Test public void discoComponentInfo() throws Exception { ServiceCollector collector = new ServiceCollector(); when(serverRuntimeContext.getServerRuntimeContextService( ServiceDiscoveryRequestListenerRegistry.SERVICE_DISCOVERY_REQUEST_LISTENER_REGISTRY)) .thenReturn(collector); module = new Socks5Module("socks"); module.initialize(serverRuntimeContext); InfoRequest infoRequest = new InfoRequest(FROM, COMPONENT, null, "id1"); List<InfoElement> infoElements = collector.processComponentInfoRequest(infoRequest, null); List<InfoElement> expected = Arrays.asList(new Identity("proxy", "bytestreams", "File Transfer Relay"), new Feature(NamespaceURIs.XEP0065_SOCKS5_BYTESTREAMS)); Assert.assertEquals(expected, infoElements); }
@Override public void initialize(ServerRuntimeContext serverRuntimeContext) { super.initialize(serverRuntimeContext); fullDomain = EntityUtils.createComponentDomain(subdomain, serverRuntimeContext); try { startProxy(); } catch (Exception e) { throw new RuntimeException("Failed to start SOCKS5 proxy", e); } }
Socks5Module extends DefaultDiscoAwareModule implements Component, ComponentInfoRequestListener, ItemRequestListener { @Override public void initialize(ServerRuntimeContext serverRuntimeContext) { super.initialize(serverRuntimeContext); fullDomain = EntityUtils.createComponentDomain(subdomain, serverRuntimeContext); try { startProxy(); } catch (Exception e) { throw new RuntimeException("Failed to start SOCKS5 proxy", e); } } }
Socks5Module extends DefaultDiscoAwareModule implements Component, ComponentInfoRequestListener, ItemRequestListener { @Override public void initialize(ServerRuntimeContext serverRuntimeContext) { super.initialize(serverRuntimeContext); fullDomain = EntityUtils.createComponentDomain(subdomain, serverRuntimeContext); try { startProxy(); } catch (Exception e) { throw new RuntimeException("Failed to start SOCKS5 proxy", e); } } Socks5Module(String subdomain, InetSocketAddress proxyAddress);  Socks5Module(String subdomain);  Socks5Module(); }
Socks5Module extends DefaultDiscoAwareModule implements Component, ComponentInfoRequestListener, ItemRequestListener { @Override public void initialize(ServerRuntimeContext serverRuntimeContext) { super.initialize(serverRuntimeContext); fullDomain = EntityUtils.createComponentDomain(subdomain, serverRuntimeContext); try { startProxy(); } catch (Exception e) { throw new RuntimeException("Failed to start SOCKS5 proxy", e); } } Socks5Module(String subdomain, InetSocketAddress proxyAddress);  Socks5Module(String subdomain);  Socks5Module(); @Override void initialize(ServerRuntimeContext serverRuntimeContext); void close(); @Override String getName(); @Override String getVersion(); String getSubdomain(); @Override List<StanzaHandler> getComponentHandlers(Entity fullDomain); @Override List<NamespaceHandlerDictionary> getComponentHandlerDictionnaries(Entity fullDomain); List<Item> getItemsFor(InfoRequest request, StanzaBroker stanzaBroker); List<InfoElement> getComponentInfosFor(InfoRequest request, StanzaBroker stanzaBroker); void setConnectionsRegistry(Socks5ConnectionsRegistry connectionsRegistry); }
Socks5Module extends DefaultDiscoAwareModule implements Component, ComponentInfoRequestListener, ItemRequestListener { @Override public void initialize(ServerRuntimeContext serverRuntimeContext) { super.initialize(serverRuntimeContext); fullDomain = EntityUtils.createComponentDomain(subdomain, serverRuntimeContext); try { startProxy(); } catch (Exception e) { throw new RuntimeException("Failed to start SOCKS5 proxy", e); } } Socks5Module(String subdomain, InetSocketAddress proxyAddress);  Socks5Module(String subdomain);  Socks5Module(); @Override void initialize(ServerRuntimeContext serverRuntimeContext); void close(); @Override String getName(); @Override String getVersion(); String getSubdomain(); @Override List<StanzaHandler> getComponentHandlers(Entity fullDomain); @Override List<NamespaceHandlerDictionary> getComponentHandlerDictionnaries(Entity fullDomain); List<Item> getItemsFor(InfoRequest request, StanzaBroker stanzaBroker); List<InfoElement> getComponentInfosFor(InfoRequest request, StanzaBroker stanzaBroker); void setConnectionsRegistry(Socks5ConnectionsRegistry connectionsRegistry);  }