// Path: core/src/main/java/com/comcast/viper/flume2storm/F2SConfigurationException.java
// @SuppressWarnings("javadoc")
// public class F2SConfigurationException extends Exception {
//   private static final long serialVersionUID = 4941423443352427505L;
// 
//   /**
//    * @param config
//    *          The configuration that contains the invalid parameter
//    * @param parameter
//    *          The name of the configuration parameter that is invalid
//    * @param throwable
//    *          The exception that occurred when setting the parameter's value
//    * @return The newly built F2SConfigurationException related to a specific
//    *         invalid parameter
//    */
//   public static F2SConfigurationException with(Configuration config, String parameter, Throwable throwable) {
//     return F2SConfigurationException.with(parameter, config.getProperty(parameter), throwable);
//   }
// 
//   /**
//    * @param parameter
//    *          The name of the configuration parameter that is invalid
//    * @param value
//    *          The configured value of the parameter
//    * @param throwable
//    *          The exception that occurred when setting the parameter's value
//    * @return The newly built F2SConfigurationException related to a specific
//    *         invalid parameter
//    */
//   public static F2SConfigurationException with(String parameter, Object value, Throwable throwable) {
//     return new F2SConfigurationException(buildErrorMessage(parameter, value, throwable), throwable);
//   }
// 
//   protected static final String buildErrorMessage(String parameter, Object value, Throwable throwable) {
//     return new StringBuilder("Configuration attribute \"").append(parameter).append("\" has invalid value (\"")
//         .append(value).append("\"). ").append(throwable.getClass().getSimpleName()).append(": ")
//         .append(throwable.getLocalizedMessage()).toString();
//   }
// 
//   /**
//    * @param parameter
//    *          The name of the configuration parameter that is missing
//    * @return The newly built F2SConfigurationException related to a specific
//    *         missing parameter
//    */
//   public static F2SConfigurationException missing(String parameter) {
//     return new F2SConfigurationException(new StringBuilder("Configuration attribute \"").append(parameter)
//         .append("\" is required but not specified").toString());
//   }
// 
//   public F2SConfigurationException() {
//     super();
//   }
// 
//   public F2SConfigurationException(String message) {
//     super(message);
//   }
// 
//   public F2SConfigurationException(Throwable throwable) {
//     super(throwable);
//   }
// 
//   public F2SConfigurationException(String message, Throwable throwable) {
//     super(message, throwable);
//   }
// }
// 
// Path: core/src/main/java/com/comcast/viper/flume2storm/connection/receptor/EventReceptorFactory.java
// public interface EventReceptorFactory<CP extends ConnectionParameters> {
//   /**
//    * Creates a new {@link EventReceptor} based on the connection parameters
//    * provided
//    * 
//    * @param connectionParams
//    *          Connections parameters to use to configure the
//    *          {@link EventReceptor}
//    * @param config
//    *          Additional configuration for the creation of the event receptor
//    * @return The newly created {@link EventReceptor}
//    * @throws F2SConfigurationException
//    *           If the configuration specified is invalid
//    */
//   EventReceptor<CP> create(CP connectionParams, Configuration config) throws F2SConfigurationException;
// }
// 
// Path: core/src/main/java/com/comcast/viper/flume2storm/location/LocationServiceFactory.java
// public interface LocationServiceFactory<SP extends ServiceProvider<?>> {
//   /**
//    * Creates a new {@link LocationService} based on the configuration provided
//    * 
//    * @param config
//    *          Configuration for the location service
//    * @param serviceProviderSerialization
//    *          The {@link ServiceProviderSerialization} to use
//    * @return The newly created {@link LocationService}
//    * @throws F2SConfigurationException
//    *           If the configuration specified is invalid
//    */
//   LocationService<SP> create(Configuration config, ServiceProviderSerialization<SP> serviceProviderSerialization)
//       throws F2SConfigurationException;
// }
// 
// Path: core/src/main/java/com/comcast/viper/flume2storm/location/ServiceProviderSerialization.java
// public interface ServiceProviderSerialization<SP extends ServiceProvider<?>> extends Serializable {
//   /**
//    * Serializes a {@link ServiceProvider} into a byte array
//    * 
//    * @param serviceProvider
//    *          The service provider to serialize
//    * @return The serialized service provider
//    */
//   byte[] serialize(SP serviceProvider);
// 
//   /**
//    * Deserializes a {@link ServiceProvider} from a byte array
//    * 
//    * @param bytes
//    *          The serialized service provider
//    * @return The deserialized service provider
//    */
//   SP deserialize(byte[] bytes);
// }


import com.google.common.base.Preconditions;
import com.google.common.base.Supplier;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.MapConfiguration;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import com.comcast.viper.flume2storm.F2SConfigurationException;
import com.comcast.viper.flume2storm.connection.receptor.EventReceptorFactory;
import com.comcast.viper.flume2storm.location.LocationServiceFactory;
import com.comcast.viper.flume2storm.location.ServiceProviderSerialization;
  }

  /**
   * Copy constructor
   * 
   * @param other
   *          the configuration to copy
   */
  public FlumeSpoutConfiguration(final FlumeSpoutConfiguration other) {
    locationServiceFactoryClassName = other.locationServiceFactoryClassName;
    serviceProviderSerializationClassName = other.serviceProviderSerializationClassName;
    eventReceptorFactoryClassName = other.eventReceptorFactoryClassName;
    configuration = new HashMap<String, Object>(other.configuration);
  }

  /**
   * @return The class name of the location service factory
   */
  public String getLocationServiceFactoryClassName() {
    return locationServiceFactoryClassName;
  }

  /**
   * @param locationServiceFactoryClassName
   *          See {@link #getLocationServiceFactoryClassName()}
   * @throws ClassNotFoundException
   *           If the class specified is not found in the classpath
   */
  public void setLocationServiceFactoryClassName(String locationServiceFactoryClassName) throws ClassNotFoundException {
    Class<?> locationServiceFactoryClass = Class.forName(locationServiceFactoryClassName);
// Path: core/src/main/java/com/comcast/viper/flume2storm/F2SConfigurationException.java
// @SuppressWarnings("javadoc")
// public class F2SConfigurationException extends Exception {
//   private static final long serialVersionUID = 4941423443352427505L;
// 
//   /**
//    * @param config
//    *          The configuration that contains the invalid parameter
//    * @param parameter
//    *          The name of the configuration parameter that is invalid
//    * @param throwable
//    *          The exception that occurred when setting the parameter's value
//    * @return The newly built F2SConfigurationException related to a specific
//    *         invalid parameter
//    */
//   public static F2SConfigurationException with(Configuration config, String parameter, Throwable throwable) {
//     return F2SConfigurationException.with(parameter, config.getProperty(parameter), throwable);
//   }
// 
//   /**
//    * @param parameter
//    *          The name of the configuration parameter that is invalid
//    * @param value
//    *          The configured value of the parameter
//    * @param throwable
//    *          The exception that occurred when setting the parameter's value
//    * @return The newly built F2SConfigurationException related to a specific
//    *         invalid parameter
//    */
//   public static F2SConfigurationException with(String parameter, Object value, Throwable throwable) {
//     return new F2SConfigurationException(buildErrorMessage(parameter, value, throwable), throwable);
//   }
// 
//   protected static final String buildErrorMessage(String parameter, Object value, Throwable throwable) {
//     return new StringBuilder("Configuration attribute \"").append(parameter).append("\" has invalid value (\"")
//         .append(value).append("\"). ").append(throwable.getClass().getSimpleName()).append(": ")
//         .append(throwable.getLocalizedMessage()).toString();
//   }
// 
//   /**
//    * @param parameter
//    *          The name of the configuration parameter that is missing
//    * @return The newly built F2SConfigurationException related to a specific
//    *         missing parameter
//    */
//   public static F2SConfigurationException missing(String parameter) {
//     return new F2SConfigurationException(new StringBuilder("Configuration attribute \"").append(parameter)
//         .append("\" is required but not specified").toString());
//   }
// 
//   public F2SConfigurationException() {
//     super();
//   }
// 
//   public F2SConfigurationException(String message) {
//     super(message);
//   }
// 
//   public F2SConfigurationException(Throwable throwable) {
//     super(throwable);
//   }
// 
//   public F2SConfigurationException(String message, Throwable throwable) {
//     super(message, throwable);
//   }
// }
// 
// Path: core/src/main/java/com/comcast/viper/flume2storm/connection/receptor/EventReceptorFactory.java
// public interface EventReceptorFactory<CP extends ConnectionParameters> {
//   /**
//    * Creates a new {@link EventReceptor} based on the connection parameters
//    * provided
//    * 
//    * @param connectionParams
//    *          Connections parameters to use to configure the
//    *          {@link EventReceptor}
//    * @param config
//    *          Additional configuration for the creation of the event receptor
//    * @return The newly created {@link EventReceptor}
//    * @throws F2SConfigurationException
//    *           If the configuration specified is invalid
//    */
//   EventReceptor<CP> create(CP connectionParams, Configuration config) throws F2SConfigurationException;
// }
// 
// Path: core/src/main/java/com/comcast/viper/flume2storm/location/LocationServiceFactory.java
// public interface LocationServiceFactory<SP extends ServiceProvider<?>> {
//   /**
//    * Creates a new {@link LocationService} based on the configuration provided
//    * 
//    * @param config
//    *          Configuration for the location service
//    * @param serviceProviderSerialization
//    *          The {@link ServiceProviderSerialization} to use
//    * @return The newly created {@link LocationService}
//    * @throws F2SConfigurationException
//    *           If the configuration specified is invalid
//    */
//   LocationService<SP> create(Configuration config, ServiceProviderSerialization<SP> serviceProviderSerialization)
//       throws F2SConfigurationException;
// }
// 
// Path: core/src/main/java/com/comcast/viper/flume2storm/location/ServiceProviderSerialization.java
// public interface ServiceProviderSerialization<SP extends ServiceProvider<?>> extends Serializable {
//   /**
//    * Serializes a {@link ServiceProvider} into a byte array
//    * 
//    * @param serviceProvider
//    *          The service provider to serialize
//    * @return The serialized service provider
//    */
//   byte[] serialize(SP serviceProvider);
// 
//   /**
//    * Deserializes a {@link ServiceProvider} from a byte array
//    * 
//    * @param bytes
//    *          The serialized service provider
//    * @return The deserialized service provider
//    */
//   SP deserialize(byte[] bytes);
// }


// Path: flume-spout/src/main/java/com/comcast/viper/flume2storm/spout/FlumeSpoutConfiguration.java
import com.google.common.base.Preconditions;
import com.google.common.base.Supplier;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.MapConfiguration;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import com.comcast.viper.flume2storm.F2SConfigurationException;
import com.comcast.viper.flume2storm.connection.receptor.EventReceptorFactory;
import com.comcast.viper.flume2storm.location.LocationServiceFactory;
import com.comcast.viper.flume2storm.location.ServiceProviderSerialization;

  }

  /**
   * Copy constructor
   * 
   * @param other
   *          the configuration to copy
   */
  public FlumeSpoutConfiguration(final FlumeSpoutConfiguration other) {
    locationServiceFactoryClassName = other.locationServiceFactoryClassName;
    serviceProviderSerializationClassName = other.serviceProviderSerializationClassName;
    eventReceptorFactoryClassName = other.eventReceptorFactoryClassName;
    configuration = new HashMap<String, Object>(other.configuration);
  }

  /**
   * @return The class name of the location service factory
   */
  public String getLocationServiceFactoryClassName() {
    return locationServiceFactoryClassName;
  }

  /**
   * @param locationServiceFactoryClassName
   *          See {@link #getLocationServiceFactoryClassName()}
   * @throws ClassNotFoundException
   *           If the class specified is not found in the classpath
   */
  public void setLocationServiceFactoryClassName(String locationServiceFactoryClassName) throws ClassNotFoundException {
    Class<?> locationServiceFactoryClass = Class.forName(locationServiceFactoryClassName);
    Preconditions.checkArgument(LocationServiceFactory.class.isAssignableFrom(locationServiceFactoryClass),