You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by lr...@apache.org on 2008/01/03 15:54:56 UTC
svn commit: r608510 - in
/incubator/tuscany/java/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/collection:
./ Collection.java NotFoundException.java
Author: lresende
Date: Thu Jan 3 06:54:55 2008
New Revision: 608510
URL: http://svn.apache.org/viewvc?rev=608510&view=rev
Log:
[Work-in-progress] implementation-data-pojo based on implementation-openjpa
Added:
incubator/tuscany/java/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/collection/
incubator/tuscany/java/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/collection/Collection.java (with props)
incubator/tuscany/java/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/collection/NotFoundException.java (with props)
Added: incubator/tuscany/java/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/collection/Collection.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/collection/Collection.java?rev=608510&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/collection/Collection.java (added)
+++ incubator/tuscany/java/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/collection/Collection.java Thu Jan 3 06:54:55 2008
@@ -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.openjpa.collection;
+
+import java.util.Map;
+
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * Provides access to a collection of data items.
+ *
+ * @version $Rev$ $Date$
+ */
+@Remotable
+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
+ */
+ K post(D item);
+
+ /**
+ * Retrieves an item.
+ *
+ * @param key
+ * @return
+ */
+ D get(K key) throws NotFoundException;
+
+ /**
+ * Updates an item.
+ *
+ * @param key
+ * @param item
+ * @return
+ */
+ void 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-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/collection/Collection.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/collection/Collection.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/collection/NotFoundException.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/collection/NotFoundException.java?rev=608510&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/collection/NotFoundException.java (added)
+++ incubator/tuscany/java/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/collection/NotFoundException.java Thu Jan 3 06:54:55 2008
@@ -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.openjpa.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-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/collection/NotFoundException.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/modules/implementation-data-pojo/src/main/java/org/apache/tuscany/sca/implementation/openjpa/collection/NotFoundException.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org