jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [4/7] jena git commit: JENA-778 : Updates for deprecation of TripleMatch
Date Fri, 02 Jan 2015 19:36:28 GMT
JENA-778 : Updates for deprecation of TripleMatch

Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/eb0ac769
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/eb0ac769
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/eb0ac769

Branch: refs/heads/master
Commit: eb0ac769ab87d8a734b2ce136e34b61129898d4c
Parents: 3d1336d
Author: Andy Seaborne <andy@apache.org>
Authored: Fri Jan 2 17:48:42 2015 +0000
Committer: Andy Seaborne <andy@apache.org>
Committed: Fri Jan 2 17:48:42 2015 +0000

----------------------------------------------------------------------
 .../jena/security/graph/SecuredGraph.java       | 38 +++++++-----
 .../security/graph/impl/SecuredGraphImpl.java   | 64 ++++++++++----------
 2 files changed, 56 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/eb0ac769/jena-security/src/main/java/org/apache/jena/security/graph/SecuredGraph.java
----------------------------------------------------------------------
diff --git a/jena-security/src/main/java/org/apache/jena/security/graph/SecuredGraph.java
b/jena-security/src/main/java/org/apache/jena/security/graph/SecuredGraph.java
index 4aca683..d9ec257 100644
--- a/jena-security/src/main/java/org/apache/jena/security/graph/SecuredGraph.java
+++ b/jena-security/src/main/java/org/apache/jena/security/graph/SecuredGraph.java
@@ -17,18 +17,17 @@
  */
 package org.apache.jena.security.graph;
 
-import com.hp.hpl.jena.graph.Graph;
-import com.hp.hpl.jena.graph.GraphStatisticsHandler;
-import com.hp.hpl.jena.graph.Node;
-import com.hp.hpl.jena.graph.Triple;
-import com.hp.hpl.jena.graph.TripleMatch;
-import com.hp.hpl.jena.shared.AddDeniedException;
-import com.hp.hpl.jena.shared.DeleteDeniedException;
-import com.hp.hpl.jena.util.iterator.ExtendedIterator;
-
-import org.apache.jena.security.AccessDeniedException;
-import org.apache.jena.security.SecurityEvaluator;
-import org.apache.jena.security.SecurityEvaluator.SecNode;
+import org.apache.jena.security.AccessDeniedException ;
+import org.apache.jena.security.SecurityEvaluator ;
+import org.apache.jena.security.SecurityEvaluator.SecNode ;
+
+import com.hp.hpl.jena.graph.Graph ;
+import com.hp.hpl.jena.graph.GraphStatisticsHandler ;
+import com.hp.hpl.jena.graph.Node ;
+import com.hp.hpl.jena.graph.Triple ;
+import com.hp.hpl.jena.shared.AddDeniedException ;
+import com.hp.hpl.jena.shared.DeleteDeniedException ;
+import com.hp.hpl.jena.util.iterator.ExtendedIterator ;
 
 /**
  * The interface for secured Graph instances.
@@ -91,13 +90,24 @@ public interface SecuredGraph extends Graph
 	public ExtendedIterator<Triple> find( final Node s, final Node p,
 			final Node o ) throws AccessDeniedException;
 
-	/**
+    /**
+     * @sec.graph Read
+     * @sec.triple Read, otherwise filtered from iterator.
+     * @throws AccessDeniedException
+     * @deprecated Use {@link #find(Triple)}
+     */
+	@Deprecated
+    @Override
+    public ExtendedIterator<Triple> find( final com.hp.hpl.jena.graph.TripleMatch triple
)
+            throws AccessDeniedException;
+
+    /**
 	 * @sec.graph Read
 	 * @sec.triple Read, otherwise filtered from iterator.
 	 * @throws AccessDeniedException
 	 */
 	@Override
-	public ExtendedIterator<Triple> find( final TripleMatch m )
+	public ExtendedIterator<Triple> find( final Triple triple )
 			throws AccessDeniedException;
 
 	@Override

http://git-wip-us.apache.org/repos/asf/jena/blob/eb0ac769/jena-security/src/main/java/org/apache/jena/security/graph/impl/SecuredGraphImpl.java
----------------------------------------------------------------------
diff --git a/jena-security/src/main/java/org/apache/jena/security/graph/impl/SecuredGraphImpl.java
b/jena-security/src/main/java/org/apache/jena/security/graph/impl/SecuredGraphImpl.java
index 1f5a5af..bcb3857 100644
--- a/jena-security/src/main/java/org/apache/jena/security/graph/impl/SecuredGraphImpl.java
+++ b/jena-security/src/main/java/org/apache/jena/security/graph/impl/SecuredGraphImpl.java
@@ -17,27 +17,18 @@
  */
 package org.apache.jena.security.graph.impl;
 
-import com.hp.hpl.jena.graph.Graph;
-import com.hp.hpl.jena.graph.GraphStatisticsHandler;
-import com.hp.hpl.jena.graph.Node;
-import com.hp.hpl.jena.graph.TransactionHandler;
-import com.hp.hpl.jena.graph.Triple;
-import com.hp.hpl.jena.graph.TripleMatch;
-import com.hp.hpl.jena.shared.AddDeniedException;
-import com.hp.hpl.jena.shared.DeleteDeniedException;
-import com.hp.hpl.jena.util.iterator.ExtendedIterator;
+import org.apache.jena.security.SecurityEvaluator ;
+import org.apache.jena.security.SecurityEvaluator.Action ;
+import org.apache.jena.security.graph.* ;
+import org.apache.jena.security.impl.ItemHolder ;
+import org.apache.jena.security.impl.SecuredItem ;
+import org.apache.jena.security.impl.SecuredItemImpl ;
+import org.apache.jena.security.utils.PermTripleFilter ;
 
-import org.apache.jena.security.SecurityEvaluator;
-import org.apache.jena.security.SecurityEvaluator.Action;
-import org.apache.jena.security.graph.SecuredBulkUpdateHandler;
-import org.apache.jena.security.graph.SecuredCapabilities;
-import org.apache.jena.security.graph.SecuredGraph;
-import org.apache.jena.security.graph.SecuredGraphEventManager;
-import org.apache.jena.security.graph.SecuredPrefixMapping;
-import org.apache.jena.security.impl.ItemHolder;
-import org.apache.jena.security.impl.SecuredItem;
-import org.apache.jena.security.impl.SecuredItemImpl;
-import org.apache.jena.security.utils.PermTripleFilter;
+import com.hp.hpl.jena.graph.* ;
+import com.hp.hpl.jena.shared.AddDeniedException ;
+import com.hp.hpl.jena.shared.DeleteDeniedException ;
+import com.hp.hpl.jena.util.iterator.ExtendedIterator ;
 
 /**
  * Implementation of SecuredGraph to be used by a SecuredItemInvoker proxy.
@@ -169,19 +160,28 @@ public class SecuredGraphImpl extends SecuredItemImpl implements SecuredGraph
 		return retval;
 	}
 
-	@Override
-	public ExtendedIterator<Triple> find( final TripleMatch m )
-	{
-		checkRead();
-		ExtendedIterator<Triple> retval = holder.getBaseItem().find(m);
-		if (!canRead(Triple.ANY))
-		{
-			retval = retval.filterKeep(new PermTripleFilter(Action.Read, this));
-		}
-		return retval;
-	}
+	/** @deprecated Use/implement {@link #find(Triple)} */
+	@Deprecated
+    @Override
+    public ExtendedIterator<Triple> find( final TripleMatch m ) {
+	    return find(Triple.createMatch(m.getMatchSubject(),
+	                                   m.getMatchPredicate(),
+	                                   m.getMatchObject())) ;
+    }
+	
+    @Override
+    public ExtendedIterator<Triple> find( final Triple m )
+    {
+        checkRead();
+        ExtendedIterator<Triple> retval = holder.getBaseItem().find(m);
+        if (!canRead(Triple.ANY))
+        {
+            retval = retval.filterKeep(new PermTripleFilter(Action.Read, this));
+        }
+        return retval;
+    }
 
-	@SuppressWarnings("deprecation")
+    @SuppressWarnings("deprecation")
     @Override
 	public SecuredBulkUpdateHandler getBulkUpdateHandler()
 	{


Mime
View raw message