// Path: tftp-protocol/src/main/java/org/anarres/tftp/protocol/engine/AbstractTftpServer.java
// public abstract class AbstractTftpServer {
// 
//     public static final int DEFAULT_SERVER_PORT = 69;
// 
//     private final TftpDataProvider dataProvider;
//     private final int port;
// 
//     public AbstractTftpServer(@Nonnull TftpDataProvider dataProvider, @Nonnegative int port) {
//         this.dataProvider = dataProvider;
//         this.port = port;
//     }
// 
//     @Nonnull
//     public TftpDataProvider getDataProvider() {
//         return dataProvider;
//     }
// 
//     @Nonnegative
//     public int getPort() {
//         return port;
//     }
// 
//     @PostConstruct
//     public abstract void start() throws IOException, InterruptedException;
// 
//     @PreDestroy
//     public abstract void stop() throws IOException, InterruptedException;
// }
// 
// Path: tftp-protocol/src/main/java/org/anarres/tftp/protocol/resource/TftpDataProvider.java
// public interface TftpDataProvider {
// 
//     /**
//      * Returns the resource with the given name.
//      */
//     @CheckForNull
//     public TftpData open(@Nonnull String filename) throws IOException;
// }


import java.io.IOException;
import java.net.InetSocketAddress;
import javax.annotation.Nonnegative;
import javax.annotation.Nonnull;
import org.anarres.tftp.protocol.engine.AbstractTftpServer;
import org.anarres.tftp.protocol.resource.TftpDataProvider;
import org.apache.mina.filter.codec.ProtocolCodecFilter;
import org.apache.mina.filter.logging.LoggingFilter;
import org.apache.mina.transport.socket.DatagramSessionConfig;
import org.apache.mina.transport.socket.nio.NioDatagramAcceptor;
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.anarres.tftp.server.mina;


/**
 *
 * @author shevek
 */
public class TftpServer extends AbstractTftpServer {

    private NioDatagramAcceptor acceptor;

// Path: tftp-protocol/src/main/java/org/anarres/tftp/protocol/engine/AbstractTftpServer.java
// public abstract class AbstractTftpServer {
// 
//     public static final int DEFAULT_SERVER_PORT = 69;
// 
//     private final TftpDataProvider dataProvider;
//     private final int port;
// 
//     public AbstractTftpServer(@Nonnull TftpDataProvider dataProvider, @Nonnegative int port) {
//         this.dataProvider = dataProvider;
//         this.port = port;
//     }
// 
//     @Nonnull
//     public TftpDataProvider getDataProvider() {
//         return dataProvider;
//     }
// 
//     @Nonnegative
//     public int getPort() {
//         return port;
//     }
// 
//     @PostConstruct
//     public abstract void start() throws IOException, InterruptedException;
// 
//     @PreDestroy
//     public abstract void stop() throws IOException, InterruptedException;
// }
// 
// Path: tftp-protocol/src/main/java/org/anarres/tftp/protocol/resource/TftpDataProvider.java
// public interface TftpDataProvider {
// 
//     /**
//      * Returns the resource with the given name.
//      */
//     @CheckForNull
//     public TftpData open(@Nonnull String filename) throws IOException;
// }


// Path: tftp-server-mina/src/main/java/org/anarres/tftp/server/mina/TftpServer.java
import java.io.IOException;
import java.net.InetSocketAddress;
import javax.annotation.Nonnegative;
import javax.annotation.Nonnull;
import org.anarres.tftp.protocol.engine.AbstractTftpServer;
import org.anarres.tftp.protocol.resource.TftpDataProvider;
import org.apache.mina.filter.codec.ProtocolCodecFilter;
import org.apache.mina.filter.logging.LoggingFilter;
import org.apache.mina.transport.socket.DatagramSessionConfig;
import org.apache.mina.transport.socket.nio.NioDatagramAcceptor;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.anarres.tftp.server.mina;


/**
 *
 * @author shevek
 */
public class TftpServer extends AbstractTftpServer {

    private NioDatagramAcceptor acceptor;

    public TftpServer(@Nonnull TftpDataProvider dataProvider, @Nonnegative int port) {