package mendel.client;

/**
 * Created by ctolooee on 12/7/14.
 */
public class EventPublisher {
}

@@ -1,99 +1,2788 @@
-package mendel.client;%0A%0A/**%0A * Created by ctolooee on 12/7/14.%0A */%0Apublic class EventPublisher %7B%0A
+/*%0ACopyright (c) 2013, Colorado State University%0AAll rights reserved.%0ARedistribution and use in source and binary forms, with or without modification,%0Aare permitted provided that the following conditions are met:%0A1. Redistributions of source code must retain the above copyright notice, this%0A   list of conditions and the following disclaimer.%0A2. Redistributions in binary form must reproduce the above copyright notice,%0A   this list of conditions and the following disclaimer in the documentation%0A   and/or other materials provided with the distribution.%0AThis software is provided by the copyright holders and contributors %22as is%22 and%0Aany express or implied warranties, including, but not limited to, the implied%0Awarranties of merchantability and fitness for a particular purpose are%0Adisclaimed. In no event shall the copyright holder or contributors be liable for%0Aany direct, indirect, incidental, special, exemplary, or consequential damages%0A(including, but not limited to, procurement of substitute goods or services;%0Aloss of use, data, or profits; or business interruption) however caused and on%0Aany theory of liability, whether in contract, strict liability, or tort%0A(including negligence or otherwise) arising in any way out of the use of this%0Asoftware, even if advised of the possibility of such damage.%0A*/%0A%0Apackage mendel.client;%0A%0Aimport java.io.IOException;%0A%0Aimport mendel.comm.MendelEventMap;%0Aimport mendel.event.BasicEventWrapper;%0Aimport mendel.event.Event;%0Aimport mendel.event.EventWrapper;%0Aimport mendel.network.ClientMessageRouter;%0Aimport mendel.network.MendelMessage;%0Aimport mendel.network.NetworkDestination;%0A%0A/**%0A * Handles publishing events from a client to a server.%0A *%0A * @author malensek%0A */%0Apublic class EventPublisher %7B%0A%0A    private static MendelEventMap eventMap = new MendelEventMap();%0A    private static EventWrapper wrapper = new BasicEventWrapper(eventMap);%0A    private ClientMessageRouter router;%0A%0A    /**%0A     * Creates a new EventPublisher instance using the provided%0A     * %7B@link ClientMessageRouter%7D instance for communications.%0A     */%0A    public EventPublisher(ClientMessageRouter router) %7B%0A        this.router = router;%0A    %7D%0A%0A    /**%0A     * Publishes a %7B@link Event%7D via the client's%0A     * %7B@link ClientMessageRouter%7D.%0A     *%0A     */%0A    public void publish(NetworkDestination destination, Event event)%0A            throws IOException %7B%0A        MendelMessage message = wrapper.wrap(event);%0A        router.sendMessage(destination, message);%0A    %7D%0A%0A    /**%0A     * Wraps a GalileoEvent inside an EventContainer, and places the container%0A     * inside a GalileoMessage, ready to be transmitted across the network.%0A     */%0A    public static MendelMessage wrapEvent(Event event)%0A            throws IOException %7B%0A        return wrapper.wrap(event);%0A    
 %7D%0A
+%7D

Add client EventPublisher