Author: andy
Date: Thu Jul 4 13:13:00 2013
New Revision: 1499743
URL: http://svn.apache.org/r1499743
Log:
JENA-483 : Javadoc for Fuseki
Modified:
jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/Fuseki.java
jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/server/SPARQLServer.java
jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/server/ServerConfig.java
Modified:
jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/Fuseki.java
URL:
http://svn.apache.org/viewvc/jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/Fuseki.java?rev=1499743&r1=1499742&r2=1499743&view=diff
==============================================================================
--- jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/Fuseki.java
(original)
+++ jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/Fuseki.java Thu
Jul 4 13:13:00 2013
@@ -34,22 +34,47 @@ import com.hp.hpl.jena.sparql.util.Conte
import com.hp.hpl.jena.sparql.util.MappingRegistry ;
import com.hp.hpl.jena.tdb.TDB ;
+/**
+ * <p>The main class enabling us to:</p>
+ * <ol>
+ * <li>create instances of a Fuseki server e.g.
+ * the ARQ, RIOT and TDB server stack</li>
+ * <li>get server global {@link com.hp.hpl.jena.sparql.util.Context} e.g.
+ * named values used to pass implementation-specific parameters across
+ * general interfaces.</li>
+ * <li>get the {@link org.apache.jena.fuseki.server.SPARQLServer}
instance.</li>
+ * <li>set the {@link org.apache.jena.fuseki.server.SPARQLServer}
instance.</li>
+ *
+ */
public class Fuseki
{
- // External log : operations, etc.
+ /** Path to ???*/
static public String PATH = "org.apache.jena.fuseki" ;
+
+ /** a unique IRI for the Fuseki namespace*/
static public String FusekiIRI = "http://jena.apache.org/Fuseki" ;
+
+ /** Fuseki home environment, usually set to $FUSEKI_HOME */
static public String FusekiHomeEnv = "FUSEKI_HOME" ;
+
+ /** a unique IRI including the symbol notation for which properties should
be appended */
static public String FusekiSymbolIRI = "http://jena.apache.org/fuseki#" ;
+ /** ??? */
static public String PagesStatic = "pages" ;
- // TEMPORARY - this enables POST of triples to the dataset URI causing a
graph to be created.
- // POSTing to /dataset?graph=uri is preferred
+ /**
+ * TEMPORARY - this enables POST of triples to the dataset URI causing a
graph to be created.
+ * POSTing to /dataset?graph=uri is preferred
+ */
static public boolean graphStoreProtocolPostCreate = false ;
+ /** an relative path to the location of <code>fuseki-properties.xml</code>
file */
static private String metadataLocation =
"org/apache/jena/fuseki/fuseki-properties.xml" ;
+
+ /** Object which holds metadata specified within {@link
Fuseki#metadataLocation} */
static private Metadata metadata = initMetadata() ;
+
private static Metadata initMetadata()
{
Metadata m = new Metadata() ;
@@ -58,21 +83,39 @@ public class Fuseki
return m ;
}
+ /** The name of the Fuseki server. Set to the string <code>Fuseki</code>
by default.*/
static public final String NAME = "Fuseki" ;
- static public final String VERSION =
metadata.get(PATH+".version", "development") ;
+
+ /** Version of this Fuseki instance */
+ static public final String VERSION =
metadata.get(PATH+".version", "development");
+
+ /** Date when Fuseki was built */
static public final String BUILD_DATE =
metadata.get(PATH+".build.datetime", "unknown") ; // call Date if unavailable.
+
+ /** An identifier for the HTTP Fuseki server instance*/
static public final String serverHttpName = NAME+" ("+VERSION+")" ;
- // Log for operations
+ /** Actual log file for operations */
public static final String requestLogName = PATH+".Fuseki" ;
+
+ /** Instance of log for operations */
public static final Logger requestLog =
LoggerFactory.getLogger(requestLogName) ;
- // Log for general server messages.
+
+ /** Actual log file for general server messages.*/
public static final String serverLogName = PATH+".Server" ;
+
+ /** Instance of log for general server messages */
public static final Logger serverLog =
LoggerFactory.getLogger(serverLogName) ;
- // Log for config server messages.
+
+ /** Actual log file for config server messages. */
public static final String configLogName = PATH+".Config" ;
+
+ /** Instance of log for config server messages*/
public static final Logger configLog =
LoggerFactory.getLogger(configLogName) ;
+ /** An instance of management for stream opening, including redirecting
through a
+ * location mapper whereby a name (e.g. URL) is redirected to another name
(e.g. local file).
+ * */
public static final StreamManager webStreamManager ;
static {
webStreamManager = new StreamManager() ;
@@ -81,6 +124,10 @@ public class Fuseki
}
private static boolean initialized = false ;
+
+ /**
+ * Initialize an instance of the Fuseki server stack.
+ */
public synchronized static void init()
{
if ( initialized )
@@ -95,6 +142,10 @@ public class Fuseki
MappingRegistry.addPrefixMapping("fuseki", FusekiSymbolIRI) ;
}
+ /**
+ * Get server global {@link com.hp.hpl.jena.sparql.util.Context}.
+ * @return {@link com.hp.hpl.jena.query.ARQ#getContext()}
+ */
public static Context getContext()
{
return ARQ.getContext() ;
@@ -102,7 +153,11 @@ public class Fuseki
// Temporary ...
private static SPARQLServer server ;
+
+ /** set/specify the {@link org.apache.jena.fuseki.server.SPARQLServer}
instance.*/
public static void setServer(SPARQLServer _server) { server = _server
; }
+
+ /** get the {@link org.apache.jena.fuseki.server.SPARQLServer} instance. */
public static SPARQLServer getServer() { return server ; }
// Force a call to init.
Modified:
jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/server/SPARQLServer.java
URL:
http://svn.apache.org/viewvc/jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/server/SPARQLServer.java?rev=1499743&r1=1499742&r2=1499743&view=diff
==============================================================================
---
jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/server/SPARQLServer.java
(original)
+++
jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/server/SPARQLServer.java
Thu Jul 4 13:13:00 2013
@@ -54,6 +54,15 @@ import org.eclipse.jetty.xml.XmlConfigur
import com.hp.hpl.jena.sparql.mgt.ARQMgt ;
import com.hp.hpl.jena.sparql.util.Utils ;
+/**
+ * SPARQLServer is the Jena server instance which wraps/utilizes
+ * {@link org.eclipse.jetty.server.Server}. This class provides
+ * immediate access to the {@link org.eclipse.jetty.server.Server#start()} and
+ * {@link org.eclipse.jetty.server.Server#stop()} commands as well as obtaining
+ * instances of the server and server configuration. Finally we can obtain
+ * instances of {@link org.apache.jena.fuseki.server.ServerConfig}.
+ *
+ */
public class SPARQLServer {
static {
Fuseki.init() ;
@@ -67,6 +76,12 @@ public class SPARQLServer {
// private static int ThreadPoolSize = 100 ;
+ /**
+ * Default constructor which requires a {@link
org.apache.jena.fuseki.server.ServerConfig}
+ * object as input. We use this config to specify (verbose) logging,
enable compression
+ * etc.
+ * @param config
+ */
public SPARQLServer(ServerConfig config) {
this.serverConfig = config ;
verboseLogging = config.verboseLogging ;
@@ -82,6 +97,9 @@ public class SPARQLServer {
configureOneDataset(context, dsDesc, config.enableCompression) ;
}
+ /**
+ * Initialize the {@link SPARQLServer} instance.
+ */
public void start() {
String now = Utils.nowAsString() ;
serverLog.info(format("%s %s %s", Fuseki.NAME, Fuseki.VERSION,
Fuseki.BUILD_DATE)) ;
@@ -106,6 +124,9 @@ public class SPARQLServer {
ServletContextHandler context =
(ServletContextHandler)server.getHandler() ;
}
+ /**
+ * Stop the {@link SPARQLServer} instance.
+ */
public void stop() {
String now = Utils.nowAsString() ;
serverLog.info(format("Stopped %s on port %d", now,
server.getConnectors()[0].getPort())) ;
@@ -117,14 +138,26 @@ public class SPARQLServer {
removeJMX() ;
}
+ /**
+ * Get the Jetty instance.
+ * @return Server
+ */
public Server getServer() {
return server ;
}
+ /**
+ * Get the datasets associated with the server.
+ * @return returns the datasets via {@link
org.apache.jena.fuseki.server.ServerConfig#datasets}
+ */
public List<DatasetRef> getDatasets() {
return serverConfig.datasets ;
}
+ /**
+ * Obtain the {@link org.apache.jena.fuseki.server.ServerConfig}
+ * @return ServerConfig
+ */
public ServerConfig getServerConfig() {
return serverConfig ;
}
@@ -244,10 +277,11 @@ public class SPARQLServer {
return context ;
}
- // Experimental - off by default.
- // The überservlet sits on the dataset name and handles all requests.
- // Includes direct naming and quad access to the dataset.
+ /** Experimental - off by default. The überservlet sits on the dataset
name and handles all requests.
+ * Includes direct naming and quad access to the dataset.
+ */
public static boolean überServlet = false ;
+
private static List<String> ListOfEmptyString = Arrays.asList("") ;
private void configureOneDataset(ServletContextHandler context, DatasetRef
dsDesc, boolean enableCompression) {
Modified:
jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/server/ServerConfig.java
URL:
http://svn.apache.org/viewvc/jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/server/ServerConfig.java?rev=1499743&r1=1499742&r2=1499743&view=diff
==============================================================================
---
jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/server/ServerConfig.java
(original)
+++
jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/server/ServerConfig.java
Thu Jul 4 13:13:00 2013
@@ -39,7 +39,7 @@ public class ServerConfig
public String pages ;
/** The list of datasets */
public List<DatasetRef> datasets ;
- /** Enable Accept-Encoding compression */
+ /** Enable Accept-Encoding compression. Set to false by default.*/
public boolean enableCompression = false ;
/** Enable additional logging */