incubator-nuvem-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rf...@apache.org
Subject svn commit: r998349 - /incubator/nuvem/trunk/store-assets/src/main/java/services/Cart.java
Date Fri, 17 Sep 2010 22:04:34 GMT
Author: rfeng
Date: Fri Sep 17 22:04:33 2010
New Revision: 998349

URL: http://svn.apache.org/viewvc?rev=998349&view=rev
Log:
Work around the ClassCastException

Modified:
    incubator/nuvem/trunk/store-assets/src/main/java/services/Cart.java

Modified: incubator/nuvem/trunk/store-assets/src/main/java/services/Cart.java
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/store-assets/src/main/java/services/Cart.java?rev=998349&r1=998348&r2=998349&view=diff
==============================================================================
--- incubator/nuvem/trunk/store-assets/src/main/java/services/Cart.java (original)
+++ incubator/nuvem/trunk/store-assets/src/main/java/services/Cart.java Fri Sep 17 22:04:33
2010
@@ -19,10 +19,59 @@
 
 package services;
 
-import org.apache.tuscany.sca.data.collection.Collection;
+import org.apache.tuscany.sca.data.collection.Entry;
+import org.apache.tuscany.sca.data.collection.NotFoundException;
 import org.oasisopen.sca.annotation.Remotable;
 
 @Remotable
-public interface Cart extends Collection<String, Item> {
+/**
+ * [rfeng] Tuscany cannot handle subclassing Collection<String, Item> to resolve the
type variable. As a workaround, we copy all the methods into this interface directly 
+ */
+public interface Cart {
+    /**
+     * Get the whole collection.
+     * 
+     * @return the whole collection.
+     */
+    Entry<String, Item>[] getAll();
 
+    /**
+     * Returns a collection resulting from a query.
+     * 
+     * @return the collection.
+     */
+    Entry<String, Item>[] query(String queryString);
+
+    /**
+     * Creates a new item.
+     * 
+     * @param key
+     * @param item
+     * @return
+     */
+    String post(String key, Item item);
+
+    /**
+     * Retrieves an item.
+     * 
+     * @param key
+     * @return
+     */
+    Item get(String key) throws NotFoundException;
+
+    /**
+     * Updates an item.
+     * 
+     * @param key
+     * @param item
+     * @return
+     */
+    void put(String key, Item item) throws NotFoundException;
+
+    /**
+     * Delete an item.
+     * 
+     * @param key
+     */
+    void delete(String key) throws NotFoundException;
 }



Mime
View raw message