// Path: src/main/java/mx/nic/rdap/server/catalog/PrivacyStatus.java
// public enum PrivacyStatus {
// 	OWNER, AUTHENTICATED, ANY, NONE;
// 
// 	private PrivacyStatus() {
// 	}
// 
// }
// 
// Path: src/main/java/mx/nic/rdap/server/privacy/PrivacySettingsFactory.java
// public class PrivacySettingsFactory {
// 	private static Map<String, PrivacySetting> singlePoolMap;
// 
// 	private static Map<Set<String>, PrivacySetting> privacyCombinationPoolMap;
// 
// 	private static Map<Set<String>, Set<String>> setCombinationPoolMap;
// 
// 	private final static String ANY = "any";
// 	private final static String NONE = "none";
// 	private final static String OWNER = "owner";
// 	private final static String AUTHENTICATED = "authenticated";
// 
// 	public static void initializePool(String... serverRoles) {
// 		singlePoolMap = new HashMap<>();
// 
// 		singlePoolMap.put(ANY, new AnyPrivacySetting());
// 		singlePoolMap.put(NONE, new NonePrivacySetting());
// 		singlePoolMap.put(OWNER, new OwnerPrivacySetting());
// 		singlePoolMap.put(AUTHENTICATED, new AuthenticatedPrivacySetting());
// 
// 		if (serverRoles != null && serverRoles.length > 0) {
// 			addRolesToSinglePoolMap(serverRoles);
// 		}
// 
// 		privacyCombinationPoolMap = new HashMap<>();
// 		setCombinationPoolMap = new HashMap<>();
// 	}
// 
// 	private static void addRolesToSinglePoolMap(String... roles) {
// 		for (String role : roles) {
// 			role = role.trim().toLowerCase();
// 			Set<String> set = new HashSet<>();
// 			set.add(role);
// 			set = Collections.unmodifiableSet(set);
// 
// 			PrivacySetting privacySetting = new RolesPrivacySetting(false, set);
// 			singlePoolMap.put(role, privacySetting);
// 		}
// 	}
// 
// 	public static PrivacySetting getSetForRoles(String... roles) {
// 		if (roles == null || roles.length <= 0) {
// 			throw new NullPointerException("Roles are null or empty.");
// 		}
// 
// 		PrivacySetting privacySetting = null;
// 		if (roles.length == 1) {
// 			return getSetForSingleValue(roles[0].trim().toLowerCase());
// 		}
// 
// 		Set<String> set = new HashSet<>();
// 		for (String role : roles) {
// 			set.add(role.trim().toLowerCase());
// 		}
// 
// 		if (set.size() == 1) {
// 			for (String role : set) {
// 				privacySetting = getSetForSingleValue(role);
// 				break;
// 			}
// 		} else {
// 			privacySetting = getSetForCombination(set);
// 		}
// 
// 		return privacySetting;
// 	}
// 
// 	private static PrivacySetting getSetForSingleValue(String s) {
// 		return singlePoolMap.get(s);
// 	}
// 
// 	private static PrivacySetting getSetForCombination(Set<String> set) {
// 
// 		Set<String> originalSet = setCombinationPoolMap.get(set);
// 		if (originalSet != null) {
// 			return privacyCombinationPoolMap.get(originalSet);
// 		}
// 
// 		RolesPrivacySetting rolesPrivacySetting;
// 		if (set.contains(OWNER)) {
// 			Set<String> key = new HashSet<>(set);
// 			key = Collections.unmodifiableSet(key);
// 			setCombinationPoolMap.put(key, key);
// 
// 			set.remove(OWNER);
// 			set = Collections.unmodifiableSet(set);
// 			rolesPrivacySetting = new RolesPrivacySetting(true, set);
// 			privacyCombinationPoolMap.put(key, rolesPrivacySetting);
// 		} else {
// 			set = Collections.unmodifiableSet(set);
// 			rolesPrivacySetting = new RolesPrivacySetting(false, set);
// 			privacyCombinationPoolMap.put(set, rolesPrivacySetting);
// 		}
// 
// 		return rolesPrivacySetting;
// 	}
// }


import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import mx.nic.rdap.core.catalog.Role;
import mx.nic.rdap.core.db.Autnum;
import mx.nic.rdap.core.db.Domain;
import mx.nic.rdap.core.db.IpNetwork;
import mx.nic.rdap.core.db.Nameserver;
import mx.nic.rdap.db.RdapUser;
import mx.nic.rdap.db.exception.InitializationException;
import mx.nic.rdap.db.exception.RdapDataAccessException;
import mx.nic.rdap.db.service.DataAccessService;
import mx.nic.rdap.db.spi.RdapUserDAO;
import mx.nic.rdap.server.catalog.PrivacyStatus;
import mx.nic.rdap.server.privacy.PrivacySettingsFactory;
			String addEmailRemarkString = systemProperties.getProperty(ADD_EMAIL_REMARK_KEY).trim();
			if (addEmailRemarkString.equalsIgnoreCase("true")) {
				addEmailRemark = true;
			} else if (addEmailRemarkString.equalsIgnoreCase("false")) {
				addEmailRemark = false;
			} else {
				invalidProperties.add(ADD_EMAIL_REMARK_KEY);
			}
		}

		if (isPropertyNullOrEmpty(ADD_CC_KEY)) {
			invalidProperties.add(ADD_CC_KEY);
		} else {
			String addCCKey = systemProperties.getProperty(ADD_CC_KEY).trim();
			if (addCCKey.equalsIgnoreCase("true")) {
				isCountryCodeReleased = true;
			} else if (addCCKey.equalsIgnoreCase("false")) {
				isCountryCodeReleased = false;
			} else {
				invalidProperties.add(ADD_CC_KEY);
			}
		}

		if (isPropertyNullOrEmpty(ALLOW_LABELS_MIXTURE)) {
			invalidProperties.add(ALLOW_LABELS_MIXTURE);
		} else {
			String allowDomainLabelsMixture = systemProperties.getProperty(ALLOW_LABELS_MIXTURE).trim();
			if (allowDomainLabelsMixture.equalsIgnoreCase("true")) {
				allowLabelsMixture = true;
			} else if (allowDomainLabelsMixture.equalsIgnoreCase("false")) {
// Path: src/main/java/mx/nic/rdap/server/catalog/PrivacyStatus.java
// public enum PrivacyStatus {
// 	OWNER, AUTHENTICATED, ANY, NONE;
// 
// 	private PrivacyStatus() {
// 	}
// 
// }
// 
// Path: src/main/java/mx/nic/rdap/server/privacy/PrivacySettingsFactory.java
// public class PrivacySettingsFactory {
// 	private static Map<String, PrivacySetting> singlePoolMap;
// 
// 	private static Map<Set<String>, PrivacySetting> privacyCombinationPoolMap;
// 
// 	private static Map<Set<String>, Set<String>> setCombinationPoolMap;
// 
// 	private final static String ANY = "any";
// 	private final static String NONE = "none";
// 	private final static String OWNER = "owner";
// 	private final static String AUTHENTICATED = "authenticated";
// 
// 	public static void initializePool(String... serverRoles) {
// 		singlePoolMap = new HashMap<>();
// 
// 		singlePoolMap.put(ANY, new AnyPrivacySetting());
// 		singlePoolMap.put(NONE, new NonePrivacySetting());
// 		singlePoolMap.put(OWNER, new OwnerPrivacySetting());
// 		singlePoolMap.put(AUTHENTICATED, new AuthenticatedPrivacySetting());
// 
// 		if (serverRoles != null && serverRoles.length > 0) {
// 			addRolesToSinglePoolMap(serverRoles);
// 		}
// 
// 		privacyCombinationPoolMap = new HashMap<>();
// 		setCombinationPoolMap = new HashMap<>();
// 	}
// 
// 	private static void addRolesToSinglePoolMap(String... roles) {
// 		for (String role : roles) {
// 			role = role.trim().toLowerCase();
// 			Set<String> set = new HashSet<>();
// 			set.add(role);
// 			set = Collections.unmodifiableSet(set);
// 
// 			PrivacySetting privacySetting = new RolesPrivacySetting(false, set);
// 			singlePoolMap.put(role, privacySetting);
// 		}
// 	}
// 
// 	public static PrivacySetting getSetForRoles(String... roles) {
// 		if (roles == null || roles.length <= 0) {
// 			throw new NullPointerException("Roles are null or empty.");
// 		}
// 
// 		PrivacySetting privacySetting = null;
// 		if (roles.length == 1) {
// 			return getSetForSingleValue(roles[0].trim().toLowerCase());
// 		}
// 
// 		Set<String> set = new HashSet<>();
// 		for (String role : roles) {
// 			set.add(role.trim().toLowerCase());
// 		}
// 
// 		if (set.size() == 1) {
// 			for (String role : set) {
// 				privacySetting = getSetForSingleValue(role);
// 				break;
// 			}
// 		} else {
// 			privacySetting = getSetForCombination(set);
// 		}
// 
// 		return privacySetting;
// 	}
// 
// 	private static PrivacySetting getSetForSingleValue(String s) {
// 		return singlePoolMap.get(s);
// 	}
// 
// 	private static PrivacySetting getSetForCombination(Set<String> set) {
// 
// 		Set<String> originalSet = setCombinationPoolMap.get(set);
// 		if (originalSet != null) {
// 			return privacyCombinationPoolMap.get(originalSet);
// 		}
// 
// 		RolesPrivacySetting rolesPrivacySetting;
// 		if (set.contains(OWNER)) {
// 			Set<String> key = new HashSet<>(set);
// 			key = Collections.unmodifiableSet(key);
// 			setCombinationPoolMap.put(key, key);
// 
// 			set.remove(OWNER);
// 			set = Collections.unmodifiableSet(set);
// 			rolesPrivacySetting = new RolesPrivacySetting(true, set);
// 			privacyCombinationPoolMap.put(key, rolesPrivacySetting);
// 		} else {
// 			set = Collections.unmodifiableSet(set);
// 			rolesPrivacySetting = new RolesPrivacySetting(false, set);
// 			privacyCombinationPoolMap.put(set, rolesPrivacySetting);
// 		}
// 
// 		return rolesPrivacySetting;
// 	}
// }


// Path: src/main/java/mx/nic/rdap/server/configuration/RdapConfiguration.java
import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import mx.nic.rdap.core.catalog.Role;
import mx.nic.rdap.core.db.Autnum;
import mx.nic.rdap.core.db.Domain;
import mx.nic.rdap.core.db.IpNetwork;
import mx.nic.rdap.core.db.Nameserver;
import mx.nic.rdap.db.RdapUser;
import mx.nic.rdap.db.exception.InitializationException;
import mx.nic.rdap.db.exception.RdapDataAccessException;
import mx.nic.rdap.db.service.DataAccessService;
import mx.nic.rdap.db.spi.RdapUserDAO;
import mx.nic.rdap.server.catalog.PrivacyStatus;
import mx.nic.rdap.server.privacy.PrivacySettingsFactory;

			String addEmailRemarkString = systemProperties.getProperty(ADD_EMAIL_REMARK_KEY).trim();
			if (addEmailRemarkString.equalsIgnoreCase("true")) {
				addEmailRemark = true;
			} else if (addEmailRemarkString.equalsIgnoreCase("false")) {
				addEmailRemark = false;
			} else {
				invalidProperties.add(ADD_EMAIL_REMARK_KEY);
			}
		}

		if (isPropertyNullOrEmpty(ADD_CC_KEY)) {
			invalidProperties.add(ADD_CC_KEY);
		} else {
			String addCCKey = systemProperties.getProperty(ADD_CC_KEY).trim();
			if (addCCKey.equalsIgnoreCase("true")) {
				isCountryCodeReleased = true;
			} else if (addCCKey.equalsIgnoreCase("false")) {
				isCountryCodeReleased = false;
			} else {
				invalidProperties.add(ADD_CC_KEY);
			}
		}

		if (isPropertyNullOrEmpty(ALLOW_LABELS_MIXTURE)) {
			invalidProperties.add(ALLOW_LABELS_MIXTURE);
		} else {
			String allowDomainLabelsMixture = systemProperties.getProperty(ALLOW_LABELS_MIXTURE).trim();
			if (allowDomainLabelsMixture.equalsIgnoreCase("true")) {
				allowLabelsMixture = true;
			} else if (allowDomainLabelsMixture.equalsIgnoreCase("false")) {
				allowLabelsMixture = false;