* @param domainName the domain name to be configured.
*/
public static void runAccountSettings(String adminEmail, String password, String domainName) {
System.out.println("Intiating demo run");
try {
DomainSettingsService client =
new DomainSettingsService(adminEmail, password, domainName, "test");
System.out.println("Enter full path to logo file");
Scanner in = new Scanner(System.in);
String file = in.nextLine();
client.setDomainLogo(EncodeUtil.encodeBinaryFile(file));
String countryCode = client.getCountryCodeForDomain();
LOGGER.log(Level.INFO, "Retrieved CountryCode: " + countryCode);
String customerPIN = client.getCustomerPIN();
LOGGER.log(Level.INFO, "Retrieved customerPIN: " + customerPIN);
String defaultLanguage = client.getDefaultLanguage();
LOGGER.log(Level.INFO, "Retrieved defaultLanguage: " + defaultLanguage);
String domainCreationTime = client.getDomainCreationTime();
LOGGER.log(Level.INFO, "Retrieved domainCreationTime: " + domainCreationTime);
String domainEdition = client.getDomainEdition();
LOGGER.log(Level.INFO, "Retrieved domainEdition: " + domainEdition);
String domainSecondaryEmailAddress = client.getDomainSecondaryEmailAddress();
LOGGER.log(Level.INFO, "Retrieved domainSecondaryEmailAddress: "
+ domainSecondaryEmailAddress);
String domainVerificationStatus = client.getDomainVerificationStatus();
LOGGER.log(Level.INFO, "Retrieved domainVerificationStatus: " + domainVerificationStatus);
int maxUserCount = client.getMaxUserCount();
LOGGER.log(Level.INFO, "Retrieved maxUserCount: " + maxUserCount);
String organizationName = client.getOrganizationName();
LOGGER.log(Level.INFO, "Retrieved organizationName: " + organizationName);
String supportPin = client.getSupportPIN();
LOGGER.log(Level.INFO, "Retrieved supportPin: " + supportPin);
System.out.println("Enter a secondary email ID for your domain:");
String secondaryEmail = in.nextLine();
LOGGER.log(Level.INFO, "Changing secondary email address to admin email: " + secondaryEmail);
client.setDomainSecondaryEmailAddress(secondaryEmail);
LOGGER.log(Level.INFO, "Changed secondary email address to : "
+ client.getDomainSecondaryEmailAddress());
LOGGER.log(Level.INFO, "Changing organization name to newOrg:");
client.setOrganizationName("newOrg");
LOGGER.log(Level.INFO, "Changed organization name: " + client.getOrganizationName());
LOGGER.log(Level.INFO, "Changing default language to fr:");
client.setDefaultLanguage("fr");
LOGGER.log(Level.INFO, "Changed default language: " + client.getDefaultLanguage());
// Restore original values
client.setDefaultLanguage(defaultLanguage);
client.setDomainSecondaryEmailAddress(domainSecondaryEmailAddress);
client.setOrganizationName(organizationName);
} catch (AuthenticationException e) {
LOGGER.log(Level.SEVERE, e.getMessage(), e);
} catch (IllegalArgumentException e) {
LOGGER.log(Level.SEVERE, e.getMessage(), e);