// Path: ctrl/src/main/java/com/github/sdnwiselab/sdnwise/controlplane/ControlPlaneLogger.java
// public final class ControlPlaneLogger {
// 
//     /**
//      * Private constructor.
//      */
//     private ControlPlaneLogger() {
//         // Nothing to do here
//     }
// 
//     /**
//      * Creates a logger using the SimplerFormatter formatter.
//      *
//      * @param prefix the name of the ControlPlane class
//      */
//     public static void setupLogger(final String prefix) {
// 
//         Logger logger = Logger.getLogger(prefix);
//         logger.setUseParentHandlers(false);
//         SimplerFormatter f = new SimplerFormatter(prefix);
//         StreamHandler h = new StreamHandler(System.out, f) {
//             @Override
//             public synchronized void publish(final LogRecord record) {
//                 super.publish(record);
//                 flush();
//             }
//         };
//         logger.addHandler(h);
//     }
// }


import com.github.sdnwiselab.sdnwise.controlplane.ControlPlaneLogger;
import java.util.Observable;
import java.util.Observer;
import java.util.logging.Level;
import java.util.logging.Logger;

/*
 * 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.adapter;


/**
 * Representation of an abstract adapter. It is an observable class for the
 * adaptation, but it is also an observer for changes coming from the specific
 * adapter type.
 *
 * @author Sebastiano Milardo
 */
public abstract class AbstractAdapter extends Observable implements Observer {

    /**
     * Logger.
     */
    protected static final Logger LOGGER = Logger.getLogger("ADP");

    private boolean active;

    /**
     * Creates an AbstractAdapter.
     */
    AbstractAdapter() {
        this.active = false;

// Path: ctrl/src/main/java/com/github/sdnwiselab/sdnwise/controlplane/ControlPlaneLogger.java
// public final class ControlPlaneLogger {
// 
//     /**
//      * Private constructor.
//      */
//     private ControlPlaneLogger() {
//         // Nothing to do here
//     }
// 
//     /**
//      * Creates a logger using the SimplerFormatter formatter.
//      *
//      * @param prefix the name of the ControlPlane class
//      */
//     public static void setupLogger(final String prefix) {
// 
//         Logger logger = Logger.getLogger(prefix);
//         logger.setUseParentHandlers(false);
//         SimplerFormatter f = new SimplerFormatter(prefix);
//         StreamHandler h = new StreamHandler(System.out, f) {
//             @Override
//             public synchronized void publish(final LogRecord record) {
//                 super.publish(record);
//                 flush();
//             }
//         };
//         logger.addHandler(h);
//     }
// }


// Path: ctrl/src/main/java/com/github/sdnwiselab/sdnwise/adapter/AbstractAdapter.java
import com.github.sdnwiselab.sdnwise.controlplane.ControlPlaneLogger;
import java.util.Observable;
import java.util.Observer;
import java.util.logging.Level;
import java.util.logging.Logger;

/*
 * 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.adapter;


/**
 * Representation of an abstract adapter. It is an observable class for the
 * adaptation, but it is also an observer for changes coming from the specific
 * adapter type.
 *
 * @author Sebastiano Milardo
 */
public abstract class AbstractAdapter extends Observable implements Observer {

    /**
     * Logger.
     */
    protected static final Logger LOGGER = Logger.getLogger("ADP");

    private boolean active;

    /**
     * Creates an AbstractAdapter.
     */
    AbstractAdapter() {
        this.active = false;

        ControlPlaneLogger.setupLogger("ADP");
