diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-05-16 08:44:44 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-05-16 08:44:44 +0000 |
commit | 3d3b8834b93b98cc7d7534e693e937179067eb58 (patch) | |
tree | 1c31b939872ea8455118a16009a2abb96179ecf1 /branches/sca-java-1.5/tutorials/store/www-services/catalog-amazon/cart-amazon/src/main/java/shoppingstore | |
parent | 86101a456fb21b25abc09533769805911efd1c7f (diff) |
Delete previous 1.5 branch thats now old and unused and will be replaced with the current 1.x trunk
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@775435 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.5/tutorials/store/www-services/catalog-amazon/cart-amazon/src/main/java/shoppingstore')
5 files changed, 0 insertions, 283 deletions
diff --git a/branches/sca-java-1.5/tutorials/store/www-services/catalog-amazon/cart-amazon/src/main/java/shoppingstore/server/ShoppingStoreServer.java b/branches/sca-java-1.5/tutorials/store/www-services/catalog-amazon/cart-amazon/src/main/java/shoppingstore/server/ShoppingStoreServer.java deleted file mode 100644 index 486946b2fc..0000000000 --- a/branches/sca-java-1.5/tutorials/store/www-services/catalog-amazon/cart-amazon/src/main/java/shoppingstore/server/ShoppingStoreServer.java +++ /dev/null @@ -1,25 +0,0 @@ -package shoppingstore.server; - -import java.io.IOException; - -import org.apache.tuscany.sca.host.embedded.SCADomain; - -public class ShoppingStoreServer { - - public static void main(String[] args) { - - SCADomain scaDomain = SCADomain.newInstance("shoppingstore.composite"); - - try { - System.out.println("ToyApp server started (press enter to shutdown)"); - System.in.read(); - } catch (IOException e) { - e.printStackTrace(); - } - - scaDomain.close(); - System.out.println("ToyApp server stopped"); - } - - -} diff --git a/branches/sca-java-1.5/tutorials/store/www-services/catalog-amazon/cart-amazon/src/main/java/shoppingstore/services/cart/CartService.java b/branches/sca-java-1.5/tutorials/store/www-services/catalog-amazon/cart-amazon/src/main/java/shoppingstore/services/cart/CartService.java deleted file mode 100644 index e8f383c3e1..0000000000 --- a/branches/sca-java-1.5/tutorials/store/www-services/catalog-amazon/cart-amazon/src/main/java/shoppingstore/services/cart/CartService.java +++ /dev/null @@ -1,35 +0,0 @@ -package shoppingstore.services.cart; - -import org.osoa.sca.annotations.Remotable; - -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartAdd; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartAddResponse; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartClear; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartClearResponse; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartCreate; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartCreateResponse; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartGet; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartGetResponse; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartModify; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartModifyResponse; - -@Remotable -public interface CartService { - - public CartCreateResponse CartCreate(CartCreate cartCreate); - - public CartAddResponse CartAdd(CartAdd cartAdd); - - public CartModifyResponse CartModify(CartModify cartModify); - - public CartClearResponse CartClear(CartClear cartClear); - - public CartGetResponse CartGet(CartGet cartGet); - - //@Init - //public void start(); - - //@Destroy - //public void stop(); - -} diff --git a/branches/sca-java-1.5/tutorials/store/www-services/catalog-amazon/cart-amazon/src/main/java/shoppingstore/services/cart/CartServiceImpl.java b/branches/sca-java-1.5/tutorials/store/www-services/catalog-amazon/cart-amazon/src/main/java/shoppingstore/services/cart/CartServiceImpl.java deleted file mode 100644 index 1579dbd60d..0000000000 --- a/branches/sca-java-1.5/tutorials/store/www-services/catalog-amazon/cart-amazon/src/main/java/shoppingstore/services/cart/CartServiceImpl.java +++ /dev/null @@ -1,144 +0,0 @@ -package shoppingstore.services.cart; - -import java.util.HashMap; - -import org.osoa.sca.annotations.Scope; - -import com.amazon.webservices.awsecommerceservice._2007_05_14.Cart; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartAdd; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartAddRequest; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartAddResponse; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartClear; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartClearResponse; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartCreate; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartCreateResponse; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartGet; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartGetResponse; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartItem; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartItems; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartModify; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartModifyResponse; - -@Scope("COMPOSITE") -public class CartServiceImpl implements CartService { - - private static long ID = 0; - - private HashMap<String, Cart> cartsHash = new HashMap<String, Cart>(); - - public CartAddResponse CartAdd(CartAdd cartAdd) { - System.out.println("Entering cartAdd..."); - System.out.println("CartServiceID: " + this.toString()); - CartAddResponse cartAddResponse = new CartAddResponse(); - - CartAddRequest cartAddRequest = cartAdd.getRequest().get(0); - - //Cart cart = getCart(cartAddRequest.getCartId()); - Cart cart = getCart(cartAdd.getAWSAccessKeyId()); - if(cart == null){ - cartAddResponse.getCart().add(new Cart()); - return cartAddResponse; - } - - CartItem cartItem = new CartItem(); - cartItem.setASIN(cartAddRequest.getItems().getItem().get(0).getASIN()); - cartItem.setQuantity(cartAddRequest.getItems().getItem().get(0).getQuantity().toString()); - cart.getCartItems().getCartItem().add(cartItem); - cartAddResponse.getCart().add(cart); - System.out.println("Exiting cartAdd..."); - return cartAddResponse; - } - - public CartClearResponse CartClear(CartClear cartClear) { - System.out.println("CartServiceID: " + this.toString()); - System.out.println("Entering cartClear..."); - CartClearResponse cartClearResponse = new CartClearResponse(); - - //CartClearRequest cartClearRequest = cartClear.getRequest().get(0); - - //Cart cart = getCart(cartClearRequest.getCartId()); - Cart cart = getCart(cartClear.getAWSAccessKeyId()); - if(cart == null) { - cartClearResponse.getCart().add(new Cart()); - return cartClearResponse; - } - - cart.getCartItems().getCartItem().clear(); - - cartClearResponse.getCart().add(cart); - System.out.println("Exiting cartClear..."); - return cartClearResponse; - } - - public CartCreateResponse CartCreate(CartCreate cartCreate) { - System.out.println("CartServiceID: " + this.toString()); - System.out.println("Entering cartCreate..."); - CartCreateResponse cartCreateResponse = new CartCreateResponse(); - - Cart cart = getCart(cartCreate.getAWSAccessKeyId()); - if(cart != null){ - cartCreateResponse.getCart().add(cart); - System.out.println("User " + cartCreate.getAWSAccessKeyId() + " has already created a cart with ID: " + cart.getCartId()); - return cartCreateResponse; - } - - cart = new Cart(); - cart.setCartId(this.generateID()); - cart.setCartItems(new CartItems()); - addCart(cartCreate.getAWSAccessKeyId(), cart); - - cartCreateResponse.getCart().add(cart); - System.out.println("Exiting cartCreate..."); - return cartCreateResponse; - } - - public CartGetResponse CartGet(CartGet cartGet) { - System.out.println("CartServiceID: " + this.toString()); - System.out.println("Entering cartGet..."); - CartGetResponse cartGetResponse = new CartGetResponse(); - - //CartGetRequest cartGetRequest = cartGet.getRequest().get(0); - - //Cart cart = getCart(cartGetRequest.getCartId()); - Cart cart = getCart(cartGet.getAWSAccessKeyId()); - if(cart == null){ - cartGetResponse.getCart().add(new Cart()); - return cartGetResponse; - } - - cartGetResponse.getCart().add(cart); - System.out.println("Exiting cartGet..."); - return cartGetResponse; - } - - public CartModifyResponse CartModify(CartModify cartModify) { - // TODO Auto-generated method stub - return null; - } - - private synchronized String generateID(){ - ID++; - return String.valueOf(ID); - } - - - private Cart getCart(String cartId){ - Cart cart = null; - System.out.println(this.cartsHash.toString()); - cart = this.cartsHash.get(cartId); - return cart; - } - - private void addCart(String cartId, Cart cart){ - this.cartsHash.put(cartId, cart); - } -/* - public void start() { - System.out.println("Start CartService..."); - } - - public void stop() { - System.out.println("Stop CartService..."); - } -*/ -} diff --git a/branches/sca-java-1.5/tutorials/store/www-services/catalog-amazon/cart-amazon/src/main/java/shoppingstore/services/proxy/ShoppingStoreService.java b/branches/sca-java-1.5/tutorials/store/www-services/catalog-amazon/cart-amazon/src/main/java/shoppingstore/services/proxy/ShoppingStoreService.java deleted file mode 100644 index 207125ac75..0000000000 --- a/branches/sca-java-1.5/tutorials/store/www-services/catalog-amazon/cart-amazon/src/main/java/shoppingstore/services/proxy/ShoppingStoreService.java +++ /dev/null @@ -1,30 +0,0 @@ -package shoppingstore.services.proxy; - -import org.osoa.sca.annotations.Remotable; - -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartAdd; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartAddResponse; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartClear; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartClearResponse; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartCreate; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartCreateResponse; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartGet; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartGetResponse; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartModify; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartModifyResponse; - - -@Remotable -public interface ShoppingStoreService{ - - public CartCreateResponse CartCreate(CartCreate cartCreate); - - public CartAddResponse CartAdd(CartAdd cartAdd); - - public CartModifyResponse CartModify(CartModify cartModify); - - public CartClearResponse CartClear(CartClear cartClear); - - public CartGetResponse CartGet(CartGet cartGet); - -} diff --git a/branches/sca-java-1.5/tutorials/store/www-services/catalog-amazon/cart-amazon/src/main/java/shoppingstore/services/proxy/ShoppingStoreServiceImpl.java b/branches/sca-java-1.5/tutorials/store/www-services/catalog-amazon/cart-amazon/src/main/java/shoppingstore/services/proxy/ShoppingStoreServiceImpl.java deleted file mode 100644 index 8a73631cbb..0000000000 --- a/branches/sca-java-1.5/tutorials/store/www-services/catalog-amazon/cart-amazon/src/main/java/shoppingstore/services/proxy/ShoppingStoreServiceImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -package shoppingstore.services.proxy; - -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.Scope; - -import shoppingstore.services.cart.CartService; - -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartAddResponse; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartClearResponse; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartCreateResponse; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartGetResponse; -import com.amazon.webservices.awsecommerceservice._2007_05_14.CartModifyResponse; - -@Scope("COMPOSITE") -public class ShoppingStoreServiceImpl implements ShoppingStoreService { - - private CartService cartService; - - @Reference - public void setCartService(CartService cartService) { - this.cartService = cartService; - } - - public CartAddResponse CartAdd( - com.amazon.webservices.awsecommerceservice._2007_05_14.CartAdd cartAdd) { - return cartService.CartAdd(cartAdd); - } - - public CartClearResponse CartClear( - com.amazon.webservices.awsecommerceservice._2007_05_14.CartClear cartClear) { - return cartService.CartClear(cartClear); - } - - public CartCreateResponse CartCreate( - com.amazon.webservices.awsecommerceservice._2007_05_14.CartCreate cartCreate) { - return cartService.CartCreate(cartCreate); - } - - public CartGetResponse CartGet( - com.amazon.webservices.awsecommerceservice._2007_05_14.CartGet cartGet) { - return cartService.CartGet(cartGet); - } - - public CartModifyResponse CartModify( - com.amazon.webservices.awsecommerceservice._2007_05_14.CartModify cartModify) { - return cartService.CartModify(cartModify); - } - -} |