test_class.declarator: ADAPTER_FACTORY = new SocketIoMemoryAdapter.Factory()
test_class.modifier: private static final
test_class.original_string: private static final SocketIoMemoryAdapter.AdapterFactory ADAPTER_FACTORY = new SocketIoMemoryAdapter.Factory();
test_class.type: SocketIoMemoryAdapter.AdapterFactory
test_class.var_name: ADAPTER_FACTORY
test_class.file: socket.io-server/src/test/java/io/socket/socketio/server/SocketIoMemoryAdapterTest.java
test_class.identifier: SocketIoMemoryAdapterTest
test_case.body: @Test(expected = IllegalArgumentException.class)
      public void test_broadcast_exception_on_null_packet() {
          final SocketIoAdapter adapter = ADAPTER_FACTORY.createAdapter(null);
  
          adapter.broadcast(null, null, null);
      }
test_case.class_method_signature: SocketIoMemoryAdapterTest.test_broadcast_exception_on_null_packet()
test_case.full_signature: @Test(expected = IllegalArgumentException.class) public void test_broadcast_exception_on_null_packet()
test_case.identifier: test_broadcast_exception_on_null_packet
test_case.invocations: createAdapter broadcast
test_case.modifiers: @Test(expected = IllegalArgumentException.class) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void test_broadcast_exception_on_null_packet()
focal_class.declarator: EMPTY_SOCKET_EXCLUSION = new String[0]
focal_class.modifier: private static final
focal_class.original_string: private static final String[] EMPTY_SOCKET_EXCLUSION = new String[0];
focal_class.type: String[]
focal_class.var_name: EMPTY_SOCKET_EXCLUSION
focal_class.file: socket.io-server/src/main/java/io/socket/socketio/server/SocketIoMemoryAdapter.java
focal_class.identifier: SocketIoMemoryAdapter
focal_class.class_method_signature: SocketIoMemoryAdapter.SocketIoMemoryAdapter(SocketIoNamespace namespace)
focal_class.full_signature: private  SocketIoMemoryAdapter(SocketIoNamespace namespace)
focal_class.identifier: SocketIoMemoryAdapter
focal_class.modifiers: private
focal_class.parameters: (SocketIoNamespace namespace)
focal_class.signature:  SocketIoMemoryAdapter(SocketIoNamespace namespace)
focal_class.class_method_signature: SocketIoMemoryAdapter.broadcast(Packet packet, String[] rooms, String[] socketsExcluded)
focal_class.full_signature: @Override public synchronized void broadcast(Packet packet, String[] rooms, String[] socketsExcluded)
focal_class.identifier: broadcast
focal_class.modifiers: @Override public synchronized
focal_class.parameters: (Packet packet, String[] rooms, String[] socketsExcluded)
focal_class.return: void
focal_class.signature: void broadcast(Packet packet, String[] rooms, String[] socketsExcluded)
focal_class.class_method_signature: SocketIoMemoryAdapter.add(String room, SocketIoSocket socket)
focal_class.full_signature: @Override public synchronized void add(String room, SocketIoSocket socket)
focal_class.identifier: add
focal_class.modifiers: @Override public synchronized
focal_class.parameters: (String room, SocketIoSocket socket)
focal_class.return: void
focal_class.signature: void add(String room, SocketIoSocket socket)
focal_class.class_method_signature: SocketIoMemoryAdapter.remove(String room, SocketIoSocket socket)
focal_class.full_signature: @Override public synchronized void remove(String room, SocketIoSocket socket)
focal_class.identifier: remove
focal_class.modifiers: @Override public synchronized
focal_class.parameters: (String room, SocketIoSocket socket)
focal_class.return: void
focal_class.signature: void remove(String room, SocketIoSocket socket)
focal_class.class_method_signature: SocketIoMemoryAdapter.listClients(String room)
focal_class.full_signature: @Override public SocketIoSocket[] listClients(String room)
focal_class.identifier: listClients
focal_class.modifiers: @Override public
focal_class.parameters: (String room)
focal_class.return: SocketIoSocket[]
focal_class.signature: SocketIoSocket[] listClients(String room)
focal_class.class_method_signature: SocketIoMemoryAdapter.listClientRooms(SocketIoSocket socket)
focal_class.full_signature: @Override public String[] listClientRooms(SocketIoSocket socket)
focal_class.identifier: listClientRooms
focal_class.modifiers: @Override public
focal_class.parameters: (SocketIoSocket socket)
focal_class.return: String[]
focal_class.signature: String[] listClientRooms(SocketIoSocket socket)
focal_class.superclass: extends SocketIoAdapter
focal_method.body: @Override
      public synchronized void broadcast(Packet packet, String[] rooms, String[] socketsExcluded) throws IllegalArgumentException {
          if (packet == null) {
              throw new IllegalArgumentException("packet must not be null.");
          }
  
          socketsExcluded = (socketsExcluded != null)? socketsExcluded : EMPTY_SOCKET_EXCLUSION;
          final Set<String> socketsExcludedSet = new HashSet<>();
          Collections.addAll(socketsExcludedSet, socketsExcluded);
  
          final Map<String, SocketIoSocket> connectedSockets = mNamespace.getConnectedSockets();
  
          if (rooms != null) {
              final Set<String> sentSocketIds = new HashSet<>();  // To ensure only one packet is sent if socket is added to multiple rooms
  
              for (String room : rooms) {
                  if (mRoomSockets.containsKey(room)) {
                      final Set<SocketIoSocket> sockets = mRoomSockets.get(room);
                      for (SocketIoSocket socket : sockets) {
                          if (!socketsExcludedSet.contains(socket.getId()) &&
                                  !sentSocketIds.contains(socket.getId()) &&
                                  connectedSockets.containsKey(socket.getId())) {
                              socket.sendPacket(packet);
                              sentSocketIds.add(socket.getId());
                          }
                      }
                  }
              }
          } else {
              for (String socketId : mSocketRooms.keySet()) {
                  if (!socketsExcludedSet.contains(socketId)) {
                      final SocketIoSocket socket = connectedSockets.get(socketId);
                      if (socket != null) {
                          socket.sendPacket(packet);
                      }
                  }
              }
          }
      }
focal_method.class_method_signature: SocketIoMemoryAdapter.broadcast(Packet packet, String[] rooms, String[] socketsExcluded)
focal_method.full_signature: @Override public synchronized void broadcast(Packet packet, String[] rooms, String[] socketsExcluded)
focal_method.identifier: broadcast
focal_method.invocations: addAll getConnectedSockets containsKey get contains getId contains getId containsKey getId sendPacket add getId keySet contains get sendPacket
focal_method.modifiers: @Override public synchronized
focal_method.parameters: (Packet packet, String[] rooms, String[] socketsExcluded)
focal_method.return: void
focal_method.signature: void broadcast(Packet packet, String[] rooms, String[] socketsExcluded)