You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2015/03/07 17:41:39 UTC

[4/4] jena git commit: Initialization for admin tasks (specifically, backup).

Initialization for admin tasks (specifically, backup).

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

Branch: refs/heads/master
Commit: 6d17e32dca1aa4c98b44c868b4d4efd2062fbb6b
Parents: 2fce000
Author: Andy Seaborne <an...@apache.org>
Authored: Sat Mar 7 16:34:06 2015 +0000
Committer: Andy Seaborne <an...@apache.org>
Committed: Sat Mar 7 16:34:06 2015 +0000

----------------------------------------------------------------------
 .../apache/jena/fuseki/servlets/HttpAction.java | 35 ++++++++++++++++++--
 1 file changed, 33 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/6d17e32d/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/HttpAction.java
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/HttpAction.java b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/HttpAction.java
index 245ed0f..7c69924 100644
--- a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/HttpAction.java
+++ b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/HttpAction.java
@@ -138,8 +138,22 @@ public class HttpAction
         if ( dService == null || dService.getDataset() == null )
             // Null does not happens for service requests, (it does for admin requests - call setControlRequest) 
             throw new FusekiException("Null DataService in the request action") ;
-        
-        this.dsg = dService.getDataset() ;
+        setDataset(dService.getDataset()) ;
+    }
+    
+    /** Minimum initialization using just a dataset.
+     * <p>
+     * the HTTP Action will change its transactional state and
+     * {@link Transactional} instance according to its base dataset graph.
+     * </p>
+     * <p>There is no associated DataAccessPoint or DataService set by this operation.</p>
+     *  
+     * @param dsg DatasetGraph
+     */
+    private void setDataset(DatasetGraph dsg) {
+        this.dsg = dsg ;
+        if ( dsg == null )
+            return ;
         DatasetGraph basedsg = unwrap(dsg) ;
 
         if ( isTransactional(basedsg) && isTransactional(dsg) ) {
@@ -154,13 +168,30 @@ public class HttpAction
         }
     }
     
+    /** Return the dataset, if any (may be null) */
+    public DatasetGraph getDataset() {
+        return dsg ;
+    }
+
     public void setControlRequest(DataAccessPoint dataAccessPoint, String datasetUri) {
         this.dataAccessPoint = dataAccessPoint ;
         this.dataService = null ;
+        if ( dataAccessPoint != null )
+            this.dataService = dataAccessPoint.getDataService() ;
         this.datasetName = datasetUri ;
+        if ( dataService != null )
+            setDataset(dataAccessPoint.getDataService().getDataset()) ; 
     }
     
     /**
+     * Return the "Transactional" for this HttpAction.
+     */
+    
+    public Transactional getTransactional() {
+        return transactional ;
+    }
+
+    /**
      * Returns <code>true</code> iff the given {@link DatasetGraph} is an instance of {@link Transactional},
      * <code>false otherwise</code>.
      *