class ConfigurableUDPSource {

    static void clearSourceHandlers(String sourceName) {
        ExtensionWebSocketClient client = clients.get(sourceName);

        synchronized (socketLock) { // Don't want to edit while another is adding to or removing from the udpSocket Map
            // Disassociate the source from the socket
            for (Map.Entry<DatagramSocket,List<String>> entry : udpSocketToSources.entrySet()) {
                List<String> list = entry.getValue();
                if (list.contains(client.getSourceName())) {
                    list.remove(client.getSourceName());
                    if (list.isEmpty()) {
                        // Get rid of the socket if it's the only one left
                        DatagramSocket socket = entry.getKey();
                        udpSocketToSources.remove(socket);
                        socket.close();
                    }
                    
                    break;
                }
            }
        }
        // Clear the handlers associated with the source
        notificationHandlers.remove(sourceName);
        client.setPublishHandler(UDPDefaultPublish);
        
        // Clear all source address ports
        sourceAddresses.remove(sourceName);
        sourcePorts.remove(sourceName);
        sourceServers.remove(sourceName);
    }

}