// Path: ctrl/src/main/java/com/github/sdnwiselab/sdnwise/configuration/ConfigAdaptation.java
// public class ConfigAdaptation {
// 
//     /**
//      * Contain the lower and upper adapter configurations.
//      */
//     private final List<Map<String, String>> lower = new LinkedList<>(),
//             upper = new LinkedList<>();
// 
//     /**
//      * Returns an unmodifiableMap containing the configurations for the lower
//      * Adapter.
//      *
//      * @return a {@code Map<String,String>} containing the configurations for
//      * the lower Adapter
//      * @see com.github.sdnwiselab.sdnwise.adapter.AbstractAdapter
//      */
//     public final List<Map<String, String>> getLowers() {
//         return Collections.unmodifiableList(lower);
//     }
// 
//     /**
//      * Returns an unmodifiableMap containing the configurations for the upper
//      * Adapter.
//      *
//      * @return a {@code Map<String,String>} containing the configurations for
//      * the upper Adapter
//      * @see com.github.sdnwiselab.sdnwise.adapter.AbstractAdapter
//      */
//     public final List<Map<String, String>> getUppers() {
//         return Collections.unmodifiableList(upper);
//     }
// 
// }
// 
// Path: ctrl/src/main/java/com/github/sdnwiselab/sdnwise/configuration/Configurator.java
// public class Configurator {
// 
//     /**
//      * Configuration parameters for the adaptation layer.
//      */
//     private final ConfigAdaptation adaptation = new ConfigAdaptation();
//     /**
//      * Configuration parameters for the controller layer.
//      */
//     private final ConfigController controller = new ConfigController();
//     /**
//      * Configuration parameters for the FlowVisor layer.
//      */
//     private final ConfigFlowVisor flowvisor = new ConfigFlowVisor();
// 
//     /**
//      * Parses a file given in input containing a JSON string and returns the
//      * corresponding configurator object described in the file.
//      *
//      * @param fileName the path to the JSON file
//      * @return a configurator object
//      */
//     public static final Configurator load(final InputStream fileName) {
//         try {
//             return (new Gson()).fromJson(new JsonReader(new InputStreamReader(
//                     fileName, "UTF-8")), Configurator.class);
//         } catch (UnsupportedEncodingException ex) {
//             Logger.getLogger(Configurator.class.getName())
//                     .log(Level.SEVERE, null, ex);
//         }
//         return null;
//     }
// 
//     /**
//      * Returns a configAdaptation object.
//      *
//      * @return a configAdaptation object
//      */
//     public final ConfigAdaptation getAdaptation() {
//         return adaptation;
//     }
// 
//     /**
//      * Returns a ConfigController object.
//      *
//      * @return a configController object
//      */
//     public final ConfigController getController() {
//         return controller;
//     }
// 
//     /**
//      * Returns a configFlowvisor object.
//      *
//      * @return a configFlowvisor object
//      */
//     public final ConfigFlowVisor getFlowvisor() {
//         return flowvisor;
//     }
// 
//     /**
//      * Returns a string representation of the object in JSON format.
//      *
//      * @return a JSON string representation of this object.
//      */
//     @Override
//     public final String toString() {
//         Gson gson = new GsonBuilder().setPrettyPrinting().create();
//         return gson.toJson(this);
//     }
// 
// }


import com.github.sdnwiselab.sdnwise.adapter.*;
import com.github.sdnwiselab.sdnwise.configuration.ConfigAdaptation;
import com.github.sdnwiselab.sdnwise.configuration.Configurator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

/*
 * Copyright (C) 2015 SDN-WISE
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.github.sdnwiselab.sdnwise.adaptation;


/**
 * Creates an Adaptation object given the specifications contained in a
 * Configurator object. This class implements the factory object pattern.
 * <p>
 * This class is used in the initialization phase of the network in order to
 * create an adaptation object. The different types of adapter are chosen using
 * the option TYPE of the configuration file provided to the ConfigAdaptation
 * class.
 *
 * @author Sebastiano Milardo
 */
public final class AdaptationFactory {

    /**
     * Contains the configuration parameters of the class.
     */
    private static ConfigAdaptation conf;

    /**
     * Returns an adaptation object given a configAdaptation object. If one of
     * the adapter cannot be instantiated then this method throws an
     * UnsupportedOperationException.
     *
     * @param c contains the configurations for the adaptation object
     * @return an adaptation object
     */

// Path: ctrl/src/main/java/com/github/sdnwiselab/sdnwise/configuration/ConfigAdaptation.java
// public class ConfigAdaptation {
// 
//     /**
//      * Contain the lower and upper adapter configurations.
//      */
//     private final List<Map<String, String>> lower = new LinkedList<>(),
//             upper = new LinkedList<>();
// 
//     /**
//      * Returns an unmodifiableMap containing the configurations for the lower
//      * Adapter.
//      *
//      * @return a {@code Map<String,String>} containing the configurations for
//      * the lower Adapter
//      * @see com.github.sdnwiselab.sdnwise.adapter.AbstractAdapter
//      */
//     public final List<Map<String, String>> getLowers() {
//         return Collections.unmodifiableList(lower);
//     }
// 
//     /**
//      * Returns an unmodifiableMap containing the configurations for the upper
//      * Adapter.
//      *
//      * @return a {@code Map<String,String>} containing the configurations for
//      * the upper Adapter
//      * @see com.github.sdnwiselab.sdnwise.adapter.AbstractAdapter
//      */
//     public final List<Map<String, String>> getUppers() {
//         return Collections.unmodifiableList(upper);
//     }
// 
// }
// 
// Path: ctrl/src/main/java/com/github/sdnwiselab/sdnwise/configuration/Configurator.java
// public class Configurator {
// 
//     /**
//      * Configuration parameters for the adaptation layer.
//      */
//     private final ConfigAdaptation adaptation = new ConfigAdaptation();
//     /**
//      * Configuration parameters for the controller layer.
//      */
//     private final ConfigController controller = new ConfigController();
//     /**
//      * Configuration parameters for the FlowVisor layer.
//      */
//     private final ConfigFlowVisor flowvisor = new ConfigFlowVisor();
// 
//     /**
//      * Parses a file given in input containing a JSON string and returns the
//      * corresponding configurator object described in the file.
//      *
//      * @param fileName the path to the JSON file
//      * @return a configurator object
//      */
//     public static final Configurator load(final InputStream fileName) {
//         try {
//             return (new Gson()).fromJson(new JsonReader(new InputStreamReader(
//                     fileName, "UTF-8")), Configurator.class);
//         } catch (UnsupportedEncodingException ex) {
//             Logger.getLogger(Configurator.class.getName())
//                     .log(Level.SEVERE, null, ex);
//         }
//         return null;
//     }
// 
//     /**
//      * Returns a configAdaptation object.
//      *
//      * @return a configAdaptation object
//      */
//     public final ConfigAdaptation getAdaptation() {
//         return adaptation;
//     }
// 
//     /**
//      * Returns a ConfigController object.
//      *
//      * @return a configController object
//      */
//     public final ConfigController getController() {
//         return controller;
//     }
// 
//     /**
//      * Returns a configFlowvisor object.
//      *
//      * @return a configFlowvisor object
//      */
//     public final ConfigFlowVisor getFlowvisor() {
//         return flowvisor;
//     }
// 
//     /**
//      * Returns a string representation of the object in JSON format.
//      *
//      * @return a JSON string representation of this object.
//      */
//     @Override
//     public final String toString() {
//         Gson gson = new GsonBuilder().setPrettyPrinting().create();
//         return gson.toJson(this);
//     }
// 
// }


// Path: ctrl/src/main/java/com/github/sdnwiselab/sdnwise/adaptation/AdaptationFactory.java
import com.github.sdnwiselab.sdnwise.adapter.*;
import com.github.sdnwiselab.sdnwise.configuration.ConfigAdaptation;
import com.github.sdnwiselab.sdnwise.configuration.Configurator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

/*
 * Copyright (C) 2015 SDN-WISE
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.github.sdnwiselab.sdnwise.adaptation;


/**
 * Creates an Adaptation object given the specifications contained in a
 * Configurator object. This class implements the factory object pattern.
 * <p>
 * This class is used in the initialization phase of the network in order to
 * create an adaptation object. The different types of adapter are chosen using
 * the option TYPE of the configuration file provided to the ConfigAdaptation
 * class.
 *
 * @author Sebastiano Milardo
 */
public final class AdaptationFactory {

    /**
     * Contains the configuration parameters of the class.
     */
    private static ConfigAdaptation conf;

    /**
     * Returns an adaptation object given a configAdaptation object. If one of
     * the adapter cannot be instantiated then this method throws an
     * UnsupportedOperationException.
     *
     * @param c contains the configurations for the adaptation object
     * @return an adaptation object
     */

    public static Adaptation getAdaptation(final Configurator c) {
