<commit_before>/*******************************************************************************
 * Copyright (c) 2014 Whizzo Software, LLC.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *******************************************************************************/
package com.whizzosoftware.hobson.ssdp;

import com.whizzosoftware.hobson.api.disco.DeviceAdvertisement;
import com.whizzosoftware.hobson.api.plugin.AbstractHobsonPlugin;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.net.*;
import java.util.Dictionary;

/**
 * Class that looks for devices advertising via SSDP and publishes them to a DiscoManager.
 *
 * @author <NAME>
 */
public class SSDPScannerPlugin extends AbstractHobsonPlugin implements Runnable {
    private final Logger logger = LoggerFactory.getLogger(getClass());

    private static final int PORT = 1900;

    private Thread discoThread;
    private InetAddress address;
    private MulticastSocket multicastSocket;

    public SSDPScannerPlugin(String pluginId) {
        super(pluginId);
    }

    @Override
    public String getName() {
        return "SSDP Scanner Plugin";
    }

    @Override
    public void onStartup(Dictionary config) {
        try {
            logger.info("SSDP scanner starting");
            address = InetAddress.getByName("172.16.58.3");
            if (discoThread == null) {
                discoThread = new Thread(this, "SSDP Scanner");
                discoThread.start();
            }
        } catch (UnknownHostException e) {
            logger.error("Unable to lookup UDP address", e);
        }
    }

    @Override
    public void onShutdown() {
        logger.info("SSDP scanner stopping");
        if (discoThread != null) {
            discoThread.interrupt();
        }
    }

    @Override<commit_msg>Changed log levels for some startup messages.<commit_after>/*******************************************************************************
 * Copyright (c) 2014 Whizzo Software, LLC.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *******************************************************************************/
package com.whizzosoftware.hobson.ssdp;

import com.whizzosoftware.hobson.api.disco.DeviceAdvertisement;
import com.whizzosoftware.hobson.api.plugin.AbstractHobsonPlugin;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.net.*;
import java.util.Dictionary;

/**
 * Class that looks for devices advertising via SSDP and publishes them to a DiscoManager.
 *
 * @author <NAME>
 */
public class SSDPScannerPlugin extends AbstractHobsonPlugin implements Runnable {
    private final Logger logger = LoggerFactory.getLogger(getClass());

    private static final int PORT = 1900;

    private Thread discoThread;
    private InetAddress address;
    private MulticastSocket multicastSocket;

    public SSDPScannerPlugin(String pluginId) {
        super(pluginId);
    }

    @Override
    public String getName() {
        return "SSDP Scanner Plugin";
    }

    @Override
    public void onStartup(Dictionary config) {
        try {
            logger.debug("SSDP scanner starting");
            address = InetAddress.getByName("172.16.58.3");
            if (discoThread == null) {
                discoThread = new Thread(this, "SSDP Scanner");
                discoThread.start();
            }
        } catch (UnknownHostException e) {
            logger.error("Unable to lookup UDP address", e);
        }
    }

    @Override
    public void onShutdown() {
        logger.info("SSDP scanner stopping");
        if (discoThread != null) {
            discoThread.interrupt();
        }
    }

    @Override
{'fraction_non_alphanumeric': 0.16053593179049938, 'fraction_numerical': 0.01071863580998782, 'mean_word_length': 3.1812627291242364, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7151165', 'n_tokens_mistral': 1137, 'n_tokens_neox': 1054, 'n_words': 303}