<commit_before>/**
 * Copyright (c) 2011, 2014 Eurotech and/or its affiliates
 *
 *  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
 *
 * Contributors:
 *   Eurotech
 */
package org.eclipse.kura.net.admin.visitor.linux;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.kura.KuraException;
import org.eclipse.kura.core.net.NetworkConfiguration;
import org.eclipse.kura.core.net.NetworkConfigurationVisitor;


public class LinuxReadVisitor implements NetworkConfigurationVisitor{

    private static LinuxReadVisitor s_instance;
    
    private List<NetworkConfigurationVisitor> m_visitors;
    
    private LinuxReadVisitor() {
        m_visitors = new ArrayList<NetworkConfigurationVisitor>();
        m_visitors.add(IfcfgConfigReader.getInstance());
        m_visitors.add(WifiConfigReader.getInstance());
        m_visitors.add(PppConfigReader.getInstance());
        m_visitors.add(DhcpConfigReader.getInstance());
        m_visitors.add(FirewallNatConfigReader.getInstance());
    }
    
    public static LinuxReadVisitor getInstance() {
        if(s_instance == null) {
            s_instance = new LinuxReadVisitor();
        }
        
        return s_instance;
    }
    
    @Override
    public void visit(NetworkConfiguration config) throws KuraException {
        for(NetworkConfigurationVisitor visitor : m_visitors) {
            visitor.visit(config);
        }
    }

}<commit_msg>ported port forwarding and NATing from esf2 branch<commit_after>/**
 * Copyright (c) 2011, 2014 Eurotech and/or its affiliates
 *
 *  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
 *
 * Contributors:
 *   Eurotech
 */
package org.eclipse.kura.net.admin.visitor.linux;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.kura.KuraException;
import org.eclipse.kura.core.net.NetworkConfiguration;
import org.eclipse.kura.core.net.NetworkConfigurationVisitor;


public class LinuxReadVisitor implements NetworkConfigurationVisitor{

    private static LinuxReadVisitor s_instance;
    
    private List<NetworkConfigurationVisitor> m_visitors;
    
    private LinuxReadVisitor() {
        m_visitors = new ArrayList<NetworkConfigurationVisitor>();
        m_visitors.add(IfcfgConfigReader.getInstance());
        m_visitors.add(WifiConfigReader.getInstance());
        m_visitors.add(PppConfigReader.getInstance());
        m_visitors.add(DhcpConfigReader.getInstance());
        m_visitors.add(FirewallAutoNatConfigReader.getInstance());
    }
    
    public static LinuxReadVisitor getInstance() {
        if(s_instance == null) {
            s_instance = new LinuxReadVisitor();
        }
        
        return s_instance;
    }
    
    @Override
    public void visit(NetworkConfiguration config) throws KuraException {
        for(NetworkConfigurationVisitor visitor : m_visitors) {
            visitor.visit(config);
        }
    }

}
{'fraction_non_alphanumeric': 0.08706240487062405, 'fraction_numerical': 0.0076103500761035, 'mean_word_length': 3.4285714285714284, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, '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': '6445884', 'n_tokens_mistral': 916, 'n_tokens_neox': 886, 'n_words': 201}