Author: jsdelfino
Date: Thu Nov  1 18:23:54 2007
New Revision: 591186

URL: http://svn.apache.org/viewvc?rev=591186&view=rev
Log:
Adding an interface that can be implemented by components that return 
collections of data items.

Added:
    
incubator/tuscany/java/sca/modules/implementation-data/src/main/java/org/apache/tuscany/sca/implementation/data/collection/
    
incubator/tuscany/java/sca/modules/implementation-data/src/main/java/org/apache/tuscany/sca/implementation/data/collection/Collection.java
   (with props)
    
incubator/tuscany/java/sca/modules/implementation-data/src/main/java/org/apache/tuscany/sca/implementation/data/collection/NotFoundException.java
   (with props)

Added: 
incubator/tuscany/java/sca/modules/implementation-data/src/main/java/org/apache/tuscany/sca/implementation/data/collection/Collection.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-data/src/main/java/org/apache/tuscany/sca/implementation/data/collection/Collection.java?rev=591186&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/modules/implementation-data/src/main/java/org/apache/tuscany/sca/implementation/data/collection/Collection.java
 (added)
+++ 
incubator/tuscany/java/sca/modules/implementation-data/src/main/java/org/apache/tuscany/sca/implementation/data/collection/Collection.java
 Thu Nov  1 18:23:54 2007
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+package org.apache.tuscany.sca.implementation.data.collection;
+
+import java.util.Map;
+
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * Provides access to a collection of data items.
+ * 
+ * @version $Rev$ $Date$
+ */
[EMAIL PROTECTED]
+public interface Collection <K, D> {
+
+    /**
+     * Get the whole collection.
+     * 
+     * @return the whole collection.
+     */
+    Map<K, D> getAll();
+
+    /**
+     * Returns a collection resulting from a query.
+     * 
+     * @return the collection.
+     */
+    Map<K, D> query(String queryString);
+
+    /**
+     * Creates a new item.
+     * 
+     * @param item
+     * @return
+     */
+    D post(D item);
+
+    /**
+     * Retrieves an item.
+     * 
+     * @param key
+     * @return
+     */
+    D get(K key) throws NotFoundException;
+
+    /**
+     * Updates an item.
+     * 
+     * @param key
+     * @param item
+     * @return
+     */
+    D put(K key, D item) throws NotFoundException;
+
+    /**
+     * Delete an item.
+     * 
+     * @param key
+     */
+    void delete(K key) throws NotFoundException;
+
+}

Propchange: 
incubator/tuscany/java/sca/modules/implementation-data/src/main/java/org/apache/tuscany/sca/implementation/data/collection/Collection.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
incubator/tuscany/java/sca/modules/implementation-data/src/main/java/org/apache/tuscany/sca/implementation/data/collection/Collection.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 
incubator/tuscany/java/sca/modules/implementation-data/src/main/java/org/apache/tuscany/sca/implementation/data/collection/NotFoundException.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-data/src/main/java/org/apache/tuscany/sca/implementation/data/collection/NotFoundException.java?rev=591186&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/modules/implementation-data/src/main/java/org/apache/tuscany/sca/implementation/data/collection/NotFoundException.java
 (added)
+++ 
incubator/tuscany/java/sca/modules/implementation-data/src/main/java/org/apache/tuscany/sca/implementation/data/collection/NotFoundException.java
 Thu Nov  1 18:23:54 2007
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package org.apache.tuscany.sca.implementation.data.collection;
+
+/**
+ * Indicates that an item could not be found in a collection.
+ * 
+ * @version $Rev$ $Date$
+ */
+public class NotFoundException extends Exception {
+    private static final long serialVersionUID = 6792367409396084646L;
+
+    public NotFoundException() {
+    }
+
+    public NotFoundException(String message) {
+        super(message);
+    }
+
+    public NotFoundException(Throwable cause) {
+        super(cause);
+    }
+
+    public NotFoundException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+}

Propchange: 
incubator/tuscany/java/sca/modules/implementation-data/src/main/java/org/apache/tuscany/sca/implementation/data/collection/NotFoundException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
incubator/tuscany/java/sca/modules/implementation-data/src/main/java/org/apache/tuscany/sca/implementation/data/collection/NotFoundException.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to