/** * Get broadcast operations for clients within * room by <code>room</code> name * * @param room - name of room * @return broadcast operations */ public BroadcastOperations getRoomOperations(String room) { Iterable<SocketIOClient> clients = namespacesHub.getRoomClients(room); return new BroadcastOperations(clients, configCopy.getStoreFactory()); }
public void stop() { StoreFactory factory = configuration.getStoreFactory(); factory.shutdown(); scheduler.shutdown(); }
public BroadcastOperations getBroadcastOperations() { return new BroadcastOperations(getAllClients(), configCopy.getStoreFactory()); }
public Namespace(String name, Configuration configuration) { super(); this.name = name; this.jsonSupport = configuration.getJsonSupport(); this.storeFactory = configuration.getStoreFactory(); this.exceptionListener = configuration.getExceptionListener(); this.ackMode = configuration.getAckMode(); }
@Override public void onDisconnect(ClientHead client) { ackManager.onDisconnect(client); authorizeHandler.onDisconnect(client); configuration.getStoreFactory().onDisconnect(client); configuration.getStoreFactory().pubSubStore().publish(PubSubType.DISCONNECT, new DisconnectMessage(client.getSessionId())); log.debug("Client with sessionId: {} disconnected", client.getSessionId()); }
log.info("Session store / pubsub factory used: {}", configCopy.getStoreFactory()); initGroups();
public void connect(ClientHead client) { Namespace ns = namespacesHub.get(Namespace.DEFAULT_NAME); if (!client.getNamespaces().contains(ns)) { Packet packet = new Packet(PacketType.MESSAGE); packet.setSubType(PacketType.CONNECT); client.send(packet); configuration.getStoreFactory().pubSubStore().publish(PubSubType.CONNECT, new ConnectMessage(client.getSessionId())); SocketIOClient nsClient = client.addNamespaceClient(ns); ns.onConnect(nsClient); } }
public void start(Configuration configuration, NamespacesHub namespacesHub) { this.configuration = configuration; ackManager = new AckManager(scheduler); JsonSupport jsonSupport = configuration.getJsonSupport(); PacketEncoder encoder = new PacketEncoder(configuration, jsonSupport); PacketDecoder decoder = new PacketDecoder(jsonSupport, ackManager); String connectPath = configuration.getContext() + "/"; boolean isSsl = configuration.getKeyStore() != null; if (isSsl) { try { sslContext = createSSLContext(configuration); } catch (Exception e) { throw new IllegalStateException(e); } } StoreFactory factory = configuration.getStoreFactory(); authorizeHandler = new AuthorizeHandler(connectPath, scheduler, configuration, namespacesHub, factory, this, ackManager, clientsBox); factory.init(namespacesHub, authorizeHandler, jsonSupport); xhrPollingTransport = new PollingTransport(decoder, authorizeHandler, clientsBox); webSocketTransport = new WebSocketTransport(isSsl, authorizeHandler, configuration, scheduler, clientsBox); PacketListener packetListener = new PacketListener(ackManager, namespacesHub, xhrPollingTransport, scheduler); packetHandler = new InPacketHandler(packetListener, decoder, namespacesHub, configuration.getExceptionListener()); try { encoderHandler = new EncoderHandler(configuration, encoder); } catch (Exception e) { throw new IllegalStateException(e); } wrongUrlHandler = new WrongUrlHandler(); }
setStoreFactory(conf.getStoreFactory()); setAuthorizationListener(conf.getAuthorizationListener()); setExceptionListener(conf.getExceptionListener());
/** * Get broadcast operations for clients within * room by <code>room</code> name * * @param room - name of room * @return broadcast operations */ public BroadcastOperations getRoomOperations(String room) { Iterable<SocketIOClient> clients = namespacesHub.getRoomClients(room); return new BroadcastOperations(clients, configCopy.getStoreFactory()); }
public void stop() { StoreFactory factory = configuration.getStoreFactory(); factory.shutdown(); scheduler.shutdown(); }
public BroadcastOperations getBroadcastOperations() { return new BroadcastOperations(getAllClients(), configCopy.getStoreFactory()); }
public Namespace(String name, Configuration configuration) { super(); this.name = name; this.jsonSupport = configuration.getJsonSupport(); this.storeFactory = configuration.getStoreFactory(); this.exceptionListener = configuration.getExceptionListener(); this.ackMode = configuration.getAckMode(); }
@Override public void onDisconnect(ClientHead client) { ackManager.onDisconnect(client); authorizeHandler.onDisconnect(client); configuration.getStoreFactory().onDisconnect(client); configuration.getStoreFactory().pubSubStore().publish(PubSubType.DISCONNECT, new DisconnectMessage(client.getSessionId())); log.debug("Client with sessionId: {} disconnected", client.getSessionId()); }
log.info("Session store / pubsub factory used: {}", configCopy.getStoreFactory()); initGroups();
public void connect(ClientHead client) { Namespace ns = namespacesHub.get(Namespace.DEFAULT_NAME); if (!client.getNamespaces().contains(ns)) { Packet packet = new Packet(PacketType.MESSAGE); packet.setSubType(PacketType.CONNECT); client.send(packet); configuration.getStoreFactory().pubSubStore().publish(PubSubType.CONNECT, new ConnectMessage(client.getSessionId())); SocketIOClient nsClient = client.addNamespaceClient(ns); ns.onConnect(nsClient); } }
public void start(Configuration configuration, NamespacesHub namespacesHub) { this.configuration = configuration; ackManager = new AckManager(scheduler); JsonSupport jsonSupport = configuration.getJsonSupport(); PacketEncoder encoder = new PacketEncoder(configuration, jsonSupport); PacketDecoder decoder = new PacketDecoder(jsonSupport, ackManager); String connectPath = configuration.getContext() + "/"; boolean isSsl = configuration.getKeyStore() != null; if (isSsl) { try { sslContext = createSSLContext(configuration); } catch (Exception e) { throw new IllegalStateException(e); } } StoreFactory factory = configuration.getStoreFactory(); authorizeHandler = new AuthorizeHandler(connectPath, scheduler, configuration, namespacesHub, factory, this, ackManager, clientsBox); factory.init(namespacesHub, authorizeHandler, jsonSupport); xhrPollingTransport = new PollingTransport(decoder, authorizeHandler, clientsBox); webSocketTransport = new WebSocketTransport(isSsl, authorizeHandler, configuration, scheduler, clientsBox); PacketListener packetListener = new PacketListener(ackManager, namespacesHub, xhrPollingTransport, scheduler); packetHandler = new InPacketHandler(packetListener, decoder, namespacesHub, configuration.getExceptionListener()); try { encoderHandler = new EncoderHandler(configuration, encoder); } catch (Exception e) { throw new IllegalStateException(e); } wrongUrlHandler = new WrongUrlHandler(); }
setStoreFactory(conf.getStoreFactory()); setAuthorizationListener(conf.getAuthorizationListener()); setExceptionListener(conf.getExceptionListener());