// Path: src/main/java/net/eliosoft/elios/main/LoggersManager.java
// public class LoggersManager {
//     private static LoggersManager instance;
// 
//     private HashMap<String, Logger> loggersMap = new HashMap<String, Logger>();
// 
//     private LoggersManager() {
//     }
// 
//     /**
//      * get the singleton instance of the LoggersManager.
//      *
//      * @return the instance
//      */
//     public static LoggersManager getInstance() {
//         if (LoggersManager.instance == null) {
//             LoggersManager.instance = new LoggersManager();
//         }
//         return LoggersManager.instance;
//     }
// 
//     /**
//      * gets the logger with the given name.
//      *
//      * @param loggerName
//      *            the name of the logger to get
//      * @return the logger with the corresponding name
//      */
//     public Logger getLogger(final String loggerName) {
//         if (!loggersMap.containsKey(loggerName)) {
//             this.loggersMap.put(loggerName, Logger.getLogger(loggerName));
//         }
//         return this.loggersMap.get(loggerName);
//     }
// 
//     /**
//      * get all the loggers of the application.
//      *
//      * @return a list containing all the loggers
//      */
//     public List<Logger> getLoggersList() {
//         return new ArrayList<Logger>(this.loggersMap.values());
//     }
// }
// 
// Path: src/main/java/net/eliosoft/elios/server/events/CueAddedEvent.java
// public class CueAddedEvent {
//     private final String cueName;
// 
//     /**
//      * Constructor method to instantiate a new event.
//      *
//      * @param cueName
//      *            the name of the new cue in the cuesList
//      */
//     public CueAddedEvent(final String cueName) {
//         this.cueName = cueName;
//     }
// 
//     /**
//      * Returns the name of the new cue.
//      *
//      * @return the cue name
//      */
//     public String getCueName() {
//         return cueName;
//     }
// 
// }
// 
// Path: src/main/java/net/eliosoft/elios/server/events/CueRemovedEvent.java
// public class CueRemovedEvent {
//     private String cueName;
// 
//     /**
//      * Constructor method to instantiate a new event.
//      *
//      * @param cueName
//      *            the name of the removed cue in the cuesList
//      */
//     public CueRemovedEvent(final String cueName) {
//         this.cueName = cueName;
//     }
// 
//     /**
//      * Returns the name of the removed cue.
//      *
//      * @return the cue name
//      */
//     public String getCueName() {
//         return cueName;
//     }
// 
// }
// 
// Path: src/main/java/net/eliosoft/elios/server/listeners/CuesManagerListener.java
// public interface CuesManagerListener {
//     /**
//      * This method is called when a cue has been added to the cuesList.
//      *
//      * @param event
//      *            the event corresponding to the add of a cue
//      */
//     void cueAdded(CueAddedEvent event);
// 
//     /**
//      * This method is called when a cue has been removed from the list.
//      *
//      * @param event
//      *            the event corresponding to the remove of a cue
//      */
//     void cueRemoved(CueRemovedEvent event);
// }


import java.util.logging.Logger;
import net.eliosoft.elios.main.LoggersManager;
import net.eliosoft.elios.server.events.CueAddedEvent;
import net.eliosoft.elios.server.events.CueRemovedEvent;
import net.eliosoft.elios.server.listeners.CuesManagerListener;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
    /**
     * Adds an element to the list of listener of the cues manager.
     *
     * @param listener
     *            the listener to add
     */
    public void addCuesManagerChangedListener(final CuesManagerListener listener) {
        this.cuesManagerChangedListeners.add(listener);
    }

    /**
     * Removes an element to the list of listener of the cues manager.
     *
     * @param listener
     *            the listener to remove
     */
    public void removeCuesManagerChangedListener(
            final CuesManagerListener listener) {
        this.cuesManagerChangedListeners.remove(listener);
    }

    private void fireCueAdded(final String name) {
        for (CuesManagerListener listener : this.cuesManagerChangedListeners) {
            CueAddedEvent e = new CueAddedEvent(name);
            listener.cueAdded(e);
        }
    }

    private void fireCueRemoved(final String name) {
        for (CuesManagerListener listener : this.cuesManagerChangedListeners) {
// Path: src/main/java/net/eliosoft/elios/main/LoggersManager.java
// public class LoggersManager {
//     private static LoggersManager instance;
// 
//     private HashMap<String, Logger> loggersMap = new HashMap<String, Logger>();
// 
//     private LoggersManager() {
//     }
// 
//     /**
//      * get the singleton instance of the LoggersManager.
//      *
//      * @return the instance
//      */
//     public static LoggersManager getInstance() {
//         if (LoggersManager.instance == null) {
//             LoggersManager.instance = new LoggersManager();
//         }
//         return LoggersManager.instance;
//     }
// 
//     /**
//      * gets the logger with the given name.
//      *
//      * @param loggerName
//      *            the name of the logger to get
//      * @return the logger with the corresponding name
//      */
//     public Logger getLogger(final String loggerName) {
//         if (!loggersMap.containsKey(loggerName)) {
//             this.loggersMap.put(loggerName, Logger.getLogger(loggerName));
//         }
//         return this.loggersMap.get(loggerName);
//     }
// 
//     /**
//      * get all the loggers of the application.
//      *
//      * @return a list containing all the loggers
//      */
//     public List<Logger> getLoggersList() {
//         return new ArrayList<Logger>(this.loggersMap.values());
//     }
// }
// 
// Path: src/main/java/net/eliosoft/elios/server/events/CueAddedEvent.java
// public class CueAddedEvent {
//     private final String cueName;
// 
//     /**
//      * Constructor method to instantiate a new event.
//      *
//      * @param cueName
//      *            the name of the new cue in the cuesList
//      */
//     public CueAddedEvent(final String cueName) {
//         this.cueName = cueName;
//     }
// 
//     /**
//      * Returns the name of the new cue.
//      *
//      * @return the cue name
//      */
//     public String getCueName() {
//         return cueName;
//     }
// 
// }
// 
// Path: src/main/java/net/eliosoft/elios/server/events/CueRemovedEvent.java
// public class CueRemovedEvent {
//     private String cueName;
// 
//     /**
//      * Constructor method to instantiate a new event.
//      *
//      * @param cueName
//      *            the name of the removed cue in the cuesList
//      */
//     public CueRemovedEvent(final String cueName) {
//         this.cueName = cueName;
//     }
// 
//     /**
//      * Returns the name of the removed cue.
//      *
//      * @return the cue name
//      */
//     public String getCueName() {
//         return cueName;
//     }
// 
// }
// 
// Path: src/main/java/net/eliosoft/elios/server/listeners/CuesManagerListener.java
// public interface CuesManagerListener {
//     /**
//      * This method is called when a cue has been added to the cuesList.
//      *
//      * @param event
//      *            the event corresponding to the add of a cue
//      */
//     void cueAdded(CueAddedEvent event);
// 
//     /**
//      * This method is called when a cue has been removed from the list.
//      *
//      * @param event
//      *            the event corresponding to the remove of a cue
//      */
//     void cueRemoved(CueRemovedEvent event);
// }


// Path: src/main/java/net/eliosoft/elios/server/CuesManager.java
import java.util.logging.Logger;
import net.eliosoft.elios.main.LoggersManager;
import net.eliosoft.elios.server.events.CueAddedEvent;
import net.eliosoft.elios.server.events.CueRemovedEvent;
import net.eliosoft.elios.server.listeners.CuesManagerListener;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

    /**
     * Adds an element to the list of listener of the cues manager.
     *
     * @param listener
     *            the listener to add
     */
    public void addCuesManagerChangedListener(final CuesManagerListener listener) {
        this.cuesManagerChangedListeners.add(listener);
    }

    /**
     * Removes an element to the list of listener of the cues manager.
     *
     * @param listener
     *            the listener to remove
     */
    public void removeCuesManagerChangedListener(
            final CuesManagerListener listener) {
        this.cuesManagerChangedListeners.remove(listener);
    }

    private void fireCueAdded(final String name) {
        for (CuesManagerListener listener : this.cuesManagerChangedListeners) {
            CueAddedEvent e = new CueAddedEvent(name);
            listener.cueAdded(e);
        }
    }

    private void fireCueRemoved(final String name) {
        for (CuesManagerListener listener : this.cuesManagerChangedListeners) {
            CueRemovedEvent e = new CueRemovedEvent(name);