You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by rw...@apache.org on 2012/07/25 16:29:02 UTC
svn commit: r1365601 - in
/incubator/stanbol/branches/contenthub-two-layered-structure:
commons/semanticindex/servicesapi/src/main/java/org/apache/stanbol/commons/semanticindex/store/
contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/l...
Author: rwesten
Date: Wed Jul 25 14:29:02 2012
New Revision: 1365601
URL: http://svn.apache.org/viewvc?rev=1365601&view=rev
Log:
STANBOL-471,STANBOL-498: Added IndexingSource interface - the minimal interface required for indexing . Store now extends IndexingSource and extend it by create, remove functionalities.
The Idea is the SemanticIndexes do only require the IndexingSource interface as the do not need modify items.
Added:
incubator/stanbol/branches/contenthub-two-layered-structure/commons/semanticindex/servicesapi/src/main/java/org/apache/stanbol/commons/semanticindex/store/IndexingSource.java (with props)
Modified:
incubator/stanbol/branches/contenthub-two-layered-structure/commons/semanticindex/servicesapi/src/main/java/org/apache/stanbol/commons/semanticindex/store/Store.java
incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/ldpath/LDPathSemanticIndex.java
Added: incubator/stanbol/branches/contenthub-two-layered-structure/commons/semanticindex/servicesapi/src/main/java/org/apache/stanbol/commons/semanticindex/store/IndexingSource.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/commons/semanticindex/servicesapi/src/main/java/org/apache/stanbol/commons/semanticindex/store/IndexingSource.java?rev=1365601&view=auto
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/commons/semanticindex/servicesapi/src/main/java/org/apache/stanbol/commons/semanticindex/store/IndexingSource.java (added)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/commons/semanticindex/servicesapi/src/main/java/org/apache/stanbol/commons/semanticindex/store/IndexingSource.java Wed Jul 25 14:29:02 2012
@@ -0,0 +1,42 @@
+package org.apache.stanbol.commons.semanticindex.store;
+
+
+/**
+ * Minimal interface required by the Semantic Index as an indexing source.
+ *
+ * @param <Item>
+ */
+public interface IndexingSource<Item> {
+
+ /**
+ * Getter for the type of Items managed by this Store
+ * @return
+ */
+ Class<Item> getItemType();
+
+ /**
+ * Gets a Item by uri, null if non-existing
+ * @param uri the uri of the item
+ * @return the item or <code>null</code> if not present
+ * @throws StoreException on any error while retrieving the item
+ */
+ Item get(String uri) throws StoreException;
+
+ /**
+ * Requests the next <code>batchSize</code> changes starting from <code>revision</code>. If there are no
+ * more revisions that a {@link ChangeSet} with an empty {@link ChangeSet#changed()} set. There can be
+ * more changes in the results than the given <code>batchSize</code> not to return a subset of changes
+ * regarding a specific revision. For instance, if the batch size is 5, given revision is 9 and there 15
+ * changes regarding revision 10. As a result, there will be 10 changed items in the returned change set.
+ *
+ * @param revision
+ * Starting revision number for the returned {@link ChangeSet}
+ * @param batchSize
+ * Maximum number of changes to be returned
+ * @return the {@link ChangeSet} with a maximum of <code>batchSize</code> changes
+ * @throws StoreException
+ * On any error while accessing the store.
+ * @see ChangeSet
+ */
+ ChangeSet<Item> changes(long revision, int batchSize) throws StoreException;
+}
Propchange: incubator/stanbol/branches/contenthub-two-layered-structure/commons/semanticindex/servicesapi/src/main/java/org/apache/stanbol/commons/semanticindex/store/IndexingSource.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/commons/semanticindex/servicesapi/src/main/java/org/apache/stanbol/commons/semanticindex/store/Store.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/commons/semanticindex/servicesapi/src/main/java/org/apache/stanbol/commons/semanticindex/store/Store.java?rev=1365601&r1=1365600&r2=1365601&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/commons/semanticindex/servicesapi/src/main/java/org/apache/stanbol/commons/semanticindex/store/Store.java (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/commons/semanticindex/servicesapi/src/main/java/org/apache/stanbol/commons/semanticindex/store/Store.java Wed Jul 25 14:29:02 2012
@@ -18,14 +18,11 @@ package org.apache.stanbol.commons.seman
/**
* Interface to store and retrieve Items instances persistently.
+ * This extends the {@link IndexingSource} interface to support
+ * full CRUD operations
*/
-public interface Store<Item> {
+public interface Store<Item> extends IndexingSource<Item>{
- /**
- * Getter for the type of Items managed by this Store
- * @return
- */
- Class<Item> getItemType();
/**
* Removes an item with the given uri from the store
@@ -46,29 +43,4 @@ public interface Store<Item> {
*/
String put(Item item) throws StoreException;
- /**
- * Gets a Item by uri, null if non-existing
- * @param uri the uri of the item
- * @return the item or <code>null</code> if not present
- * @throws StoreException on any error while retrieving the item
- */
- Item get(String uri) throws StoreException;
-
- /**
- * Requests the next <code>batchSize</code> changes starting from <code>revision</code>. If there are no
- * more revisions that a {@link ChangeSet} with an empty {@link ChangeSet#changed()} set. There can be
- * more changes in the results than the given <code>batchSize</code> not to return a subset of changes
- * regarding a specific revision. For instance, if the batch size is 5, given revision is 9 and there 15
- * changes regarding revision 10. As a result, there will be 10 changed items in the returned change set.
- *
- * @param revision
- * Starting revision number for the returned {@link ChangeSet}
- * @param batchSize
- * Maximum number of changes to be returned
- * @return the {@link ChangeSet} with a maximum of <code>batchSize</code> changes
- * @throws StoreException
- * On any error while accessing the store.
- * @see ChangeSet
- */
- ChangeSet<Item> changes(long revision, int batchSize) throws StoreException;
}
Modified: incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/ldpath/LDPathSemanticIndex.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/ldpath/LDPathSemanticIndex.java?rev=1365601&r1=1365600&r2=1365601&view=diff
==============================================================================
--- incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/ldpath/LDPathSemanticIndex.java (original)
+++ incubator/stanbol/branches/contenthub-two-layered-structure/contenthub/index/src/main/java/org/apache/stanbol/contenthub/index/ldpath/LDPathSemanticIndex.java Wed Jul 25 14:29:02 2012
@@ -53,7 +53,7 @@ import org.apache.stanbol.commons.semant
import org.apache.stanbol.commons.semanticindex.index.IndexState;
import org.apache.stanbol.commons.semanticindex.index.SemanticIndex;
import org.apache.stanbol.commons.semanticindex.store.ChangeSet;
-import org.apache.stanbol.commons.semanticindex.store.Store;
+import org.apache.stanbol.commons.semanticindex.store.IndexingSource;
import org.apache.stanbol.commons.semanticindex.store.StoreException;
import org.apache.stanbol.commons.solr.IndexReference;
import org.apache.stanbol.commons.solr.RegisteredSolrServerTracker;
@@ -147,7 +147,7 @@ public class LDPathSemanticIndex impleme
// Semantic Indexes should be connected to stores based on the
// name of the Store!
@Reference
- private Store<ContentItem> store;
+ private IndexingSource<ContentItem> store;
@Reference
private SiteManager siteManager;