package com.bigcommerce.api;

import java.util.ArrayList;
import java.util.List;

import org.w3c.dom.Element;
import org.w3c.dom.NodeList;

import com.bigcommerce.api.Credentials;
import com.bigcommerce.api.SimpleCredentials;

/**
 * Facade for accessing a Bigcommerce store via the REST API.
 */
public class Store {
	private Connection connection;

	/**
	 * A constructor that accepts any object implementing
	 * {@link com.bigcommerce.api.auth.Credentials Credentials}.
	 * @param storeUrl
	 * @param credentials
	 */
	public Store(String storeUrl, Credentials credentials) {
		this.connection = new Connection(storeUrl, credentials.getUsername(), credentials.getApiKey());
	}
	
	/**
	 * A simple constructor that accepts a username and API key as credentials.
	 * 
	 * @param storeUrl
	 * @param username
	 * @param apiKey
	 */
	public Store(String storeUrl, String username, String apiKey) {
		this(storeUrl, new SimpleCredentials(username, apiKey));
	}

	/**
	 * Gets Orders resource to manage.
	 * 
	 * 
	 * @return
	 */
	public Orders getOrders(){
		return new Orders(this.connection);
	}
	
	/**
	 *  Gets Products resource to manage.
	 * 
	 * @return
	 */
	public Products getProducts(){
		return new Products(this.connection);
	}

}

@@ -27,118 +27,8 @@
 i;%0A%0A
-import java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport org.w3c.dom.Element;%0Aimport org.w3c.dom.NodeList;%0A%0A
 impo
@@ -50,26 +50,31 @@
 rce.api.
-Credential
+resources.Order
 s;%0Aimpor
@@ -95,32 +95,33 @@
 rce.api.
-SimpleCredential
+resources.Product
 s;%0A%0A/**%0A

Update Store.java