package com.alexrnl.jbetaseries;

import java.io.IOException;
import java.nio.charset.Charset;
import java.util.logging.Logger;

import com.alexrnl.commons.error.ExceptionUtils;
import com.alexrnl.jbetaseries.request.Format;
import com.alexrnl.jbetaseries.request.RequestManager;
import com.alexrnl.jbetaseries.request.members.MemberAuth;
import com.alexrnl.jbetaseries.request.members.MemberNotifications;

/**
 * Entry point of the interface to the BetaSeries API.<br />
 * @author Alex
 */
public final class JBetaSeries {
	/** Logger */
	private static Logger			lg	= Logger.getLogger(JBetaSeries.class.getName());
	
	/** The request manager */
	private final RequestManager	requestManager;
	
	/**
	 * Constructor #1.<br />
	 * This will use the {@link Format#XML XML} format of the API.
	 * @param key
	 *        the API key to use.
	 */
	public JBetaSeries (final String key) {
		this(key, Format.XML);
	}
	
	/**
	 * Constructor #2.<br />
	 * @param key
	 *        the API key to use.
	 * @param format
	 *        the data type required for the API.
	 */
	public JBetaSeries (final String key, final Format format) {
		this(key, format, JBetaSeries.class.getSimpleName());
	}
	
	/**
	 * Constructor #2.<br />
	 * This constructor will use the default JVM charset (probably UTF-8).
	 * @param key
	 *        the API key to use.
	 * @param format
	 *        the data type required for the API.
	 * @param userAgent
	 *        the user-agent to use with the application.
	 */
	public JBetaSeries (final String key, final Format format, final String userAgent) {
		this(key, format, userAgent, Charset.defaultCharset());
	}
	
	/**
	 * Constructor #2.<br />
	 * @param key
	 *        the API key to use.
	 * @param format
	 *        the data type required for the API.
	 * @param userAgent
	 *        the user-agent to use with the application.
	 * @param charset
	 *        the charset to use.
	 */
	public JBetaSeries (final String key, final Format format, final String userAgent, final Charset charset) {
		super();
		this.requestManager = new RequestManager(key, format, userAgent, charset);
	}
	
	/**
	 * Entry point of test method.<br />
	 * @param args
	 *        the arguments from the command line.
	 */
	public static void main (final String[] args) {
		final JBetaSeries jBetaSeries = new JBetaSeries("", Format.XML);
		
		try {
			lg.info(jBetaSeries.requestManager.execute(new MemberAuth("Dev001", "developer")));
			//jBetaSeries.requestManager.setToken("XXXXXXXXXXX");
			lg.info(jBetaSeries.requestManager.execute(new MemberNotifications()));
		} catch (final IOException e) {
			lg.warning("Error while processing request: " + ExceptionUtils.display(e));
		}
	}
	
}

@@ -381,32 +381,88 @@
 mbers.Member
-Notifica
+Destroy;%0Aimport com.alexrnl.jbetaseries.request.members.MemberOp
 tions;%0A%0A/**%0A
@@ -2456,27 +2456,12 @@
 th(%22
-Dev001%22, %22developer
+%22, %22
 %22)))
@@ -2469,10 +2469,8 @@
 %0A%09%09%09
-//
 jBet
@@ -2505,21 +2505,12 @@
 ken(
-%22XXXXXXXXXXX%22
+null
 );%0A%09
@@ -2568,23 +2568,76 @@
 mber
-Notifications()
+Options()));%0A%09%09%09jBetaSeries.requestManager.equals(new MemberDestroy(
 ));%0A

Update test in main class