You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rave.apache.org by er...@apache.org on 2013/07/26 17:07:09 UTC
svn commit: r1507344 -
/rave/trunk/rave-components/rave-core-api/src/main/java/org/apache/rave/repository/ResourceRepository.java
Author: erinnp
Date: Fri Jul 26 15:07:09 2013
New Revision: 1507344
URL: http://svn.apache.org/r1507344
Log:
Actually commit interface
Added:
rave/trunk/rave-components/rave-core-api/src/main/java/org/apache/rave/repository/ResourceRepository.java
Added: rave/trunk/rave-components/rave-core-api/src/main/java/org/apache/rave/repository/ResourceRepository.java
URL: http://svn.apache.org/viewvc/rave/trunk/rave-components/rave-core-api/src/main/java/org/apache/rave/repository/ResourceRepository.java?rev=1507344&view=auto
==============================================================================
--- rave/trunk/rave-components/rave-core-api/src/main/java/org/apache/rave/repository/ResourceRepository.java (added)
+++ rave/trunk/rave-components/rave-core-api/src/main/java/org/apache/rave/repository/ResourceRepository.java Fri Jul 26 15:07:09 2013
@@ -0,0 +1,48 @@
+/*
+ * 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.rave.repository;
+
+import java.util.List;
+
+/**
+ * Defines generic operations for a repository
+ */
+public interface ResourceRepository<T> {
+ /**
+ * Retrieve all objects from the persistence context.
+ *
+ * @return a list of all objects
+ */
+ List<T> getAll();
+
+ /**
+ * Retrieve a limited list of objects as a SearchResult
+ * @param offset the integer offset from 0 index
+ * @param limit the size limit of the result set
+ * @return
+ */
+ List<T> getLimitedList(int offset, int limit);
+
+ /**
+ * Retrieves the count of all records
+ * @return
+ */
+ int getCountAll();
+}