// Path: core/src/main/java/edu/jhuapl/dorset/users/User.java
// public class User {
// 
//     public static String ID = "Dorset-id";
//     public static String USERNAME = "Dorset-userName";
//     public static String FIRSTNAME = "Dorset-firstName";
//     public static String LASTNAME = "Dorset-lastName";
//     public static String LOCATION = "Dorset-location";
//     public static String EMAIL = "Dorset-email";
//     public static String DOB = "Dorset-dob";
// 
//     protected Map<String, String> userInformation = new HashMap<String, String>();
// 
//     public String getId() {
//         return userInformation.get(ID);
//     }
// 
//     public void setId(String id) {
//         this.setUserInformation(ID, id);
//     }
// 
//     public String getUserName() {
//         return userInformation.get(USERNAME);
//     }
// 
//     public void setUserName(String userName) {
//         this.setUserInformation(USERNAME, userName);
//     }
// 
//     public String getFirstName() {
//         return userInformation.get(FIRSTNAME);
//     }
// 
//     public void setFirstName(String firstName) {
//         this.setUserInformation(FIRSTNAME, firstName);
//     }
// 
//     public String getLastName() {
//         return userInformation.get(LASTNAME);
//     }
// 
//     public void setLastName(String lastName) {
//         this.setUserInformation(LASTNAME, lastName);
//     }
// 
//     public String getLocation() {
//         return userInformation.get(LOCATION);
//     }
// 
//     public void setLocation(String location) {
//         this.setUserInformation(LOCATION, location);
//     }
// 
//     public String getEmail() {
//         return userInformation.get(EMAIL);
//     }
// 
//     public void setEmail(String email) {
//         this.setUserInformation(EMAIL, email);
//     }
// 
//     public String getDob() {
//         return userInformation.get(DOB);
//     }
// 
//     public void setDob(String dob) {
//         this.setUserInformation(DOB, dob);
//     }
// 
//     public void setUserInformation(String key, String value) {
//         userInformation.put(key, value);
//     }
// 
//     public String getUserInformation(String key) {
//         return userInformation.get(key);
//     }
// 
//     public Set<String> getUserInformationKeys() {
//         return userInformation.keySet();
//     }
//     
//     public void removeUserInformation(String key) {
//         userInformation.remove(key);
//     }
// }
// 
// Path: core/src/main/java/edu/jhuapl/dorset/users/UserException.java
// public class UserException extends Exception {
// 
//     private static final long serialVersionUID = 1L;
// 
//     public UserException(String errorMessage) {
//         super(errorMessage);
//     }
// 
// }
// 
// Path: core/src/main/java/edu/jhuapl/dorset/users/UserService.java
// public interface UserService {
// 
//     public String create(User user) throws UserException;
// 
//     public String retrieve(Properties properties) throws UserException;
//     
//     public void update(String id, User user) throws UserException;
// 
//     public void delete(String id);
//     
//     public User getUser(String id);
//     
// }


import java.util.HashMap;
import java.util.Hashtable;
import java.util.Map;
import java.util.Properties;
import javax.naming.Context;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.directory.Attribute;
import javax.naming.directory.Attributes;
import javax.naming.directory.DirContext;
import javax.naming.directory.InitialDirContext;
import javax.naming.directory.SearchControls;
import javax.naming.directory.SearchResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.typesafe.config.Config;
import edu.jhuapl.dorset.users.User;
import edu.jhuapl.dorset.users.UserException;
import edu.jhuapl.dorset.users.UserService;
        } catch (NamingException ex) {
            throw new NamingException("Context could not be created. " + ex);
        }

        this.setContext(this.ctx);
    }

    /**
     * 
     * LdapUserService
     * 
     * @param context  Context object that is instantiated with LDAP server information
     * @param userAttributes  String array containing User attributes that is used to generate LDAP
     *        search controls
     */
    public LdapUserService(DirContext context, String[] userAttributes) {
        this.ctx = context;

        this.ldapServer = null;
        this.ldapSearchBase = null;
        this.ldapPassword = null;
        this.ldapBindDn = null;
        this.ldapFilterAttribute = null;

        this.userAttributes = userAttributes;

        this.users = new HashMap<String, User>();
    }

    @Override
// Path: core/src/main/java/edu/jhuapl/dorset/users/User.java
// public class User {
// 
//     public static String ID = "Dorset-id";
//     public static String USERNAME = "Dorset-userName";
//     public static String FIRSTNAME = "Dorset-firstName";
//     public static String LASTNAME = "Dorset-lastName";
//     public static String LOCATION = "Dorset-location";
//     public static String EMAIL = "Dorset-email";
//     public static String DOB = "Dorset-dob";
// 
//     protected Map<String, String> userInformation = new HashMap<String, String>();
// 
//     public String getId() {
//         return userInformation.get(ID);
//     }
// 
//     public void setId(String id) {
//         this.setUserInformation(ID, id);
//     }
// 
//     public String getUserName() {
//         return userInformation.get(USERNAME);
//     }
// 
//     public void setUserName(String userName) {
//         this.setUserInformation(USERNAME, userName);
//     }
// 
//     public String getFirstName() {
//         return userInformation.get(FIRSTNAME);
//     }
// 
//     public void setFirstName(String firstName) {
//         this.setUserInformation(FIRSTNAME, firstName);
//     }
// 
//     public String getLastName() {
//         return userInformation.get(LASTNAME);
//     }
// 
//     public void setLastName(String lastName) {
//         this.setUserInformation(LASTNAME, lastName);
//     }
// 
//     public String getLocation() {
//         return userInformation.get(LOCATION);
//     }
// 
//     public void setLocation(String location) {
//         this.setUserInformation(LOCATION, location);
//     }
// 
//     public String getEmail() {
//         return userInformation.get(EMAIL);
//     }
// 
//     public void setEmail(String email) {
//         this.setUserInformation(EMAIL, email);
//     }
// 
//     public String getDob() {
//         return userInformation.get(DOB);
//     }
// 
//     public void setDob(String dob) {
//         this.setUserInformation(DOB, dob);
//     }
// 
//     public void setUserInformation(String key, String value) {
//         userInformation.put(key, value);
//     }
// 
//     public String getUserInformation(String key) {
//         return userInformation.get(key);
//     }
// 
//     public Set<String> getUserInformationKeys() {
//         return userInformation.keySet();
//     }
//     
//     public void removeUserInformation(String key) {
//         userInformation.remove(key);
//     }
// }
// 
// Path: core/src/main/java/edu/jhuapl/dorset/users/UserException.java
// public class UserException extends Exception {
// 
//     private static final long serialVersionUID = 1L;
// 
//     public UserException(String errorMessage) {
//         super(errorMessage);
//     }
// 
// }
// 
// Path: core/src/main/java/edu/jhuapl/dorset/users/UserService.java
// public interface UserService {
// 
//     public String create(User user) throws UserException;
// 
//     public String retrieve(Properties properties) throws UserException;
//     
//     public void update(String id, User user) throws UserException;
// 
//     public void delete(String id);
//     
//     public User getUser(String id);
//     
// }


// Path: components/user-service/src/main/java/edu/jhuapl/dorset/ldapuserservice/LdapUserService.java
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Map;
import java.util.Properties;
import javax.naming.Context;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.directory.Attribute;
import javax.naming.directory.Attributes;
import javax.naming.directory.DirContext;
import javax.naming.directory.InitialDirContext;
import javax.naming.directory.SearchControls;
import javax.naming.directory.SearchResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.typesafe.config.Config;
import edu.jhuapl.dorset.users.User;
import edu.jhuapl.dorset.users.UserException;
import edu.jhuapl.dorset.users.UserService;

        } catch (NamingException ex) {
            throw new NamingException("Context could not be created. " + ex);
        }

        this.setContext(this.ctx);
    }

    /**
     * 
     * LdapUserService
     * 
     * @param context  Context object that is instantiated with LDAP server information
     * @param userAttributes  String array containing User attributes that is used to generate LDAP
     *        search controls
     */
    public LdapUserService(DirContext context, String[] userAttributes) {
        this.ctx = context;

        this.ldapServer = null;
        this.ldapSearchBase = null;
        this.ldapPassword = null;
        this.ldapBindDn = null;
        this.ldapFilterAttribute = null;

        this.userAttributes = userAttributes;

        this.users = new HashMap<String, User>();
    }

    @Override
    public String create(User user) throws UserException {