blob: 674e3271743c8d20bb4ab9b0e401c9ce8bf9dd8c [file] [log] [blame]
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (11.0.4) on Fri Sep 20 12:10:30 CEST 2019 -->
<title>DataStoreProvider (Apache SIS 1.0 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2019-09-20">
<meta name="keywords" content="org.apache.sis.storage.DataStoreProvider class">
<meta name="keywords" content="LOCATION">
<meta name="keywords" content="CREATE">
<meta name="keywords" content="getShortName()">
<meta name="keywords" content="getFormat()">
<meta name="keywords" content="getSupportedVersions()">
<meta name="keywords" content="getOpenParameters()">
<meta name="keywords" content="probeContent()">
<meta name="keywords" content="open()">
<meta name="keywords" content="getLogger()">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../sis.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
<script type="text/javascript" src="../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../jquery/jquery-3.3.1.js"></script>
<script type="text/javascript" src="../../../../jquery/jquery-migrate-3.0.1.js"></script>
<script type="text/javascript" src="../../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="DataStoreProvider (Apache SIS 1.0 API)";
}
}
catch(err) {
}
//-->
var data = {"i0":10,"i1":10,"i2":6,"i3":6,"i4":10,"i5":6,"i6":10,"i7":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../../";
var useModuleDirectories = false;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/DataStoreProvider.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding">&nbsp;</div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<!-- ======== START OF CLASS DATA ======== -->
<main role="main">
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">org.apache.sis.storage</a></div>
<h2 title="Class DataStoreProvider" class="title">Class DataStoreProvider</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></li>
<li>
<ul class="inheritance">
<li>DataStoreProvider</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><code><a href="geotiff/GeoTiffStoreProvider.html" title="class in org.apache.sis.storage.geotiff">Geo­Tiff­Store­Provider</a></code>, <code><a href="earthobservation/LandsatStoreProvider.html" title="class in org.apache.sis.storage.earthobservation">Landsat­Store­Provider</a></code>, <code><a href="netcdf/NetcdfStoreProvider.html" title="class in org.apache.sis.storage.netcdf">Netcdf­Store­Provider</a></code>, <code><a href="sql/SQLStoreProvider.html" title="class in org.apache.sis.storage.sql">SQLStore­Provider</a></code></dd>
</dl>
<hr>
<pre>public abstract class <span class="typeNameLabel">DataStoreProvider</span>
extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></pre>
<div class="block">Provides information about a specific <a href="DataStore.html" title="class in org.apache.sis.storage"><code>Data­Store</code></a> implementation.
There is typically one <code>Data­Store­Provider</code> instance for each format supported by a library.
Each <code>Data­Store­Provider</code> instances provides the following services:
<ul>
<li>Provide generic information about the storage (name, <i>etc.</i>).</li>
<li>Create instances of the <a href="DataStore.html" title="class in org.apache.sis.storage"><code>Data­Store</code></a> implementation described by this provider.</li>
<li>Test if a <code>Data­Store</code> instance created by this provider would have reasonable chances
to open a given <a href="StorageConnector.html" title="class in org.apache.sis.storage"><code>Storage­Connector</code></a>.</li>
</ul>
<div class="section">Packaging data stores</div>
JAR files that provide implementations of this class shall contain an entry with exactly the following path:
<blockquote><pre>META-INF/services/org.apache.sis.storage.DataStoreProvider</pre></blockquote>
The above entry shall contain one line for each <code>Data­Store­Provider</code> implementation provided in the JAR file,
where each line is the fully qualified name of the implementation class.
See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/ServiceLoader.html?is-external=true" title="class or interface in java.util" class="externalLink"><code>Service­Loader</code></a> for more general discussion about this lookup mechanism.
<div class="section">Thread safety</div>
All <code>Data­Store­Provider</code> implementations shall be thread-safe.
However the <code>Data­Store</code> instances created by the providers do not need to be thread-safe.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>0.3</dd>
<p><font size="-1">Defined in the <code>sis-storage</code> module</font></p>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Field</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#CREATE">CREATE</a></span></code></th>
<td class="colLast">
<div class="block">Name of the parameter that specifies whether to allow creation of a new <code>Data­Store</code> if none exist
at the given location.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#LOCATION">LOCATION</a></span></code></th>
<td class="colLast">
<div class="block">Name of the parameter that specifies the data store location.</div>
</td>
</tr>
</table>
</li>
</ul>
</section>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier</th>
<th class="colSecond" scope="col">Constructor</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected </code></td>
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E()">DataStoreProvider</a></span>()</code></th>
<td class="colLast">
<div class="block">Creates a new provider.</div>
</td>
</tr>
</table>
</li>
</ul>
</section>
<!-- ========== METHOD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code><a href="http://www.geoapi.org/3.0/javadoc/org/opengis/metadata/distribution/Format.html?is-external=true" title="class or interface in org.opengis.metadata.distribution" class="externalLink">Format</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getFormat()">getFormat</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns a description of the data format.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/logging/Logger.html?is-external=true" title="class or interface in java.util.logging" class="externalLink">Logger</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getLogger()">getLogger</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the logger where to report warnings.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>abstract <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/parameter/ParameterDescriptorGroup.html?is-external=true" title="class or interface in org.opengis.parameter" class="externalLink">ParameterDescriptorGroup</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getOpenParameters()">getOpenParameters</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns a description of all parameters accepted by this provider for opening a data store.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>abstract <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getShortName()">getShortName</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns a short name or abbreviation for the data format.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="../measure/Range.html" title="class in org.apache.sis.measure">Range</a>&lt;<a href="../util/Version.html" title="class in org.apache.sis.util">Version</a>&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getSupportedVersions()">getSupportedVersions</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the range of versions supported by the data store, or <code>null</code> if unspecified.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>abstract <a href="DataStore.html" title="class in org.apache.sis.storage">DataStore</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#open(org.apache.sis.storage.StorageConnector)">open</a></span>&#8203;(<a href="StorageConnector.html" title="class in org.apache.sis.storage">StorageConnector</a>&nbsp;connector)</code></th>
<td class="colLast">
<div class="block">Returns a data store implementation associated with this provider.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code><a href="DataStore.html" title="class in org.apache.sis.storage">DataStore</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#open(org.opengis.parameter.ParameterValueGroup)">open</a></span>&#8203;(<a href="http://www.geoapi.org/3.0/javadoc/org/opengis/parameter/ParameterValueGroup.html?is-external=true" title="class or interface in org.opengis.parameter" class="externalLink">ParameterValueGroup</a>&nbsp;parameters)</code></th>
<td class="colLast">
<div class="block">Returns a data store implementation associated with this provider for the given parameters.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>abstract <a href="ProbeResult.html" title="class in org.apache.sis.storage">ProbeResult</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#probeContent(org.apache.sis.storage.StorageConnector)">probeContent</a></span>&#8203;(<a href="StorageConnector.html" title="class in org.apache.sis.storage">StorageConnector</a>&nbsp;connector)</code></th>
<td class="colLast">
<div class="block">Indicates if the given storage appears to be supported by the <code>Data­Store</code>s created by this provider.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang" class="externalLink">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang" class="externalLink">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang" class="externalLink">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang" class="externalLink">get­Class</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang" class="externalLink">hash­Code</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang" class="externalLink">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang" class="externalLink">notify­All</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang" class="externalLink">to­String</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait(long,int)" title="class or interface in java.lang" class="externalLink">wait</a></code></li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a id="LOCATION">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>LOCATION</h4>
<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> LOCATION</pre>
<div class="block">Name of the parameter that specifies the data store location.
A parameter named "location" should be included in the group of parameters returned by <a href="#getOpenParameters()"><code>get­Open­Parameters()</code></a>.
The parameter value is often a <a href="https://docs.oracle.com/javase/8/docs/api/java/net/URI.html?is-external=true" title="class or interface in java.net" class="externalLink"><code>URI</code></a> or a <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file" class="externalLink"><code>Path</code></a>, but other types are allowed.
<p>Implementers are encouraged to define a parameter with this name
to ensure a common and consistent definition among providers.
The parameter should be defined as mandatory and typed with a well-known Java class such as
<a href="https://docs.oracle.com/javase/8/docs/api/java/net/URI.html?is-external=true" title="class or interface in java.net" class="externalLink"><code>URI</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file" class="externalLink"><code>Path</code></a>, JDBC <a href="https://docs.oracle.com/javase/8/docs/api/javax/sql/DataSource.html?is-external=true" title="class or interface in javax.sql" class="externalLink">DataSource</a>, <i>etc</i>.
The type should have a compact textual representation, for serialization in XML or configuration files.
Consequently <a href="https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io" class="externalLink"><code>Input­Stream</code></a> and <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/channels/Channel.html?is-external=true" title="class or interface in java.nio.channels" class="externalLink"><code>Channel</code></a> should be avoided.</p></div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="#CREATE"><code>CREATE</code></a>,
<a href="#getOpenParameters()"><code>get­Open­Parameters()</code></a>,
<a href="../../../../constant-values.html#org.apache.sis.storage.DataStoreProvider.LOCATION">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a id="CREATE">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>CREATE</h4>
<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> CREATE</pre>
<div class="block">Name of the parameter that specifies whether to allow creation of a new <code>Data­Store</code> if none exist
at the given location. A parameter named "create" may be included in the group of parameters returned by
<a href="#getOpenParameters()"><code>get­Open­Parameters()</code></a> if the data store supports write operations. The parameter value is often a
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>Boolean</code></a> and the default value should be <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html?is-external=true#FALSE" title="class or interface in java.lang" class="externalLink"><code>Boolean​.FALSE</code></a> or equivalent.
<p>Implementers are encouraged to define an <em>optional</em> parameter with this name in complement to the
<a href="#LOCATION">"location"</a> parameter <em>only if</em> write operations are supported. If this parameter value is not
set or is set to <code>false</code>, then the <a href="#open(org.opengis.parameter.ParameterValueGroup)"><code>open(Parameter­Value­Group)</code></a> method should fail if no file or
database exists at the URL or path given by the <a href="#LOCATION">"location"</a> parameter. Otherwise if this parameter is
set to <code>true</code>, then the <code>open(…)</code> method may create files, a directory or a database at the given
location.</p>
<div class="note"><b>Relationship with standard file open options</b>
<p>For data stores on file systems, a <code>"create" = true</code> parameter value is equivalent to opening a file
with <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/StandardOpenOption.html?is-external=true#CREATE" title="class or interface in java.nio.file" class="externalLink"><code>Standard­Open­Option​.CREATE</code></a> and <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/StandardOpenOption.html?is-external=true#APPEND" title="class or interface in java.nio.file" class="externalLink"><code>APPEND</code></a>.
The other file standard options like <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/StandardOpenOption.html?is-external=true#CREATE_NEW" title="class or interface in java.nio.file" class="externalLink"><code>CREATE_NEW</code></a> and
<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/StandardOpenOption.html?is-external=true#TRUNCATE_EXISTING" title="class or interface in java.nio.file" class="externalLink"><code>TRUNCATE_EXISTING</code></a> should not be accessible through
this "create" parameter. The reason is that <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/parameter/ParameterValueGroup.html?is-external=true" title="class or interface in org.opengis.parameter" class="externalLink"><code>Parameter­Value­Group</code></a> may be used for storing parameters
permanently (for example in a configuration file or in a database) for reopening the same <a href="DataStore.html" title="class in org.apache.sis.storage"><code>Data­Store</code></a>
many times. File options designed for being used only once like <code>CREATE_NEW</code> and <code>TRUNCATE_EXISTING</code>
are incompatible with this usage.</p></div></div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="#LOCATION"><code>LOCATION</code></a>,
<a href="#getOpenParameters()"><code>get­Open­Parameters()</code></a>,
<a href="../../../../constant-values.html#org.apache.sis.storage.DataStoreProvider.CREATE">Constant Field Values</a></dd>
</dl>
</li>
</ul>
</li>
</ul>
</section>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a id="&lt;init&gt;()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>DataStoreProvider</h4>
<pre>protected&nbsp;DataStoreProvider()</pre>
<div class="block">Creates a new provider.</div>
</li>
</ul>
</li>
</ul>
</section>
<!-- ============ METHOD DETAIL ========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a id="getShortName()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getShortName</h4>
<pre class="methodSignature">public abstract&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;getShortName()</pre>
<div class="block">Returns a short name or abbreviation for the data format.
This name is used in some warnings or exception messages.
It may contain any characters, including white spaces
(i.e. this short name is <strong>not</strong> a format identifier).
<div class="note"><b>Examples:</b>
<code>"CSV"</code>, <code>"Geo­TIFF"</code>, <code>"GML"</code>, <code>"GPX"</code>, <code>"JPEG"</code>, <code>"JPEG 2000"</code>,
<code>"Net­CDF"</code>, <code>"PNG"</code>, <code>"Shapefile"</code>.
</div>
For a more comprehensive format name, see <a href="#getFormat()"><code>get­Format()</code></a>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a short name or abbreviation for the data format.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>0.8</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="#getFormat()"><code>get­Format()</code></a></dd>
</dl>
</li>
</ul>
<a id="getFormat()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getFormat</h4>
<pre class="methodSignature">public&nbsp;<a href="http://www.geoapi.org/3.0/javadoc/org/opengis/metadata/distribution/Format.html?is-external=true" title="class or interface in org.opengis.metadata.distribution" class="externalLink">Format</a>&nbsp;getFormat()</pre>
<div class="block">Returns a description of the data format. The description should contain (if available):
<ul>
<li>A reference to the <a href="../metadata/iso/distribution/DefaultFormat.html#getFormatSpecificationCitation()">format specification citation</a>, including:
<ul>
<li>a format specification <a href="../metadata/iso/citation/DefaultCitation.html#getTitle()">title</a>
(example: <cite>“PNG (Portable Network Graphics) Specification”</cite>),</li>
<li>the format <a href="#getShortName()">short name</a> as a citation
<a href="../metadata/iso/citation/DefaultCitation.html#getAlternateTitles()">alternate title</a>
(example: <cite>“PNG”</cite>),</li>
<li>the format version as the citation <a href="../metadata/iso/citation/DefaultCitation.html#getEdition()">edition</a>,</li>
<li>link to an <a href="../metadata/iso/citation/DefaultCitation.html#getOnlineResources()">online</a> version of the specification.</li>
</ul>
</li>
<li>The title of the <a href="../metadata/iso/distribution/DefaultFormat.html#getFileDecompressionTechnique()">file decompression technique</a>
used for reading the data.</li>
</ul>
The default implementation returns a format containing only the value returned by <a href="#getShortName()"><code>get­Short­Name()</code></a>.
Subclasses are encouraged to override this method for providing a more complete description, if available.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a description of the data format.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>0.8</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="#getShortName()"><code>get­Short­Name()</code></a>,
<a href="../metadata/iso/distribution/DefaultFormat.html" title="class in org.apache.sis.metadata.iso.distribution"><code>Default­Format</code></a></dd>
</dl>
</li>
</ul>
<a id="getSupportedVersions()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSupportedVersions</h4>
<pre class="methodSignature">public&nbsp;<a href="../measure/Range.html" title="class in org.apache.sis.measure">Range</a>&lt;<a href="../util/Version.html" title="class in org.apache.sis.util">Version</a>&gt;&nbsp;getSupportedVersions()</pre>
<div class="block">Returns the range of versions supported by the data store, or <code>null</code> if unspecified.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the range of supported versions, or <code>null</code> if unspecified.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>0.8</dd>
</dl>
</li>
</ul>
<a id="getOpenParameters()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getOpenParameters</h4>
<pre class="methodSignature">public abstract&nbsp;<a href="http://www.geoapi.org/3.0/javadoc/org/opengis/parameter/ParameterDescriptorGroup.html?is-external=true" title="class or interface in org.opengis.parameter" class="externalLink">ParameterDescriptorGroup</a>&nbsp;getOpenParameters()</pre>
<div class="block">Returns a description of all parameters accepted by this provider for opening a data store.
Those parameters provide an alternative to <a href="StorageConnector.html" title="class in org.apache.sis.storage"><code>Storage­Connector</code></a> for opening a <a href="DataStore.html" title="class in org.apache.sis.storage"><code>Data­Store</code></a>
from a path or URL, together with additional information like character encoding.
<p>Implementers are responsible for declaring all parameters and whether they are mandatory or optional.
It is recommended to define at least a parameter named <a href="#LOCATION">"location"</a>, completed by <a href="#CREATE">"create"</a>
if the data store supports write operations.
Those parameters will be recognized by the default <code>Data­Store­Provider</code> methods and used whenever a
<a href="StorageConnector.html" title="class in org.apache.sis.storage"><code>Storage­Connector</code></a> is required.</p>
<div class="note"><b>Alternative:</b>
the main differences between the use of <code>Storage­Connector</code> and parameters are:
<ul class="verbose">
<li><code>Storage­Connector</code> is designed for use with file or stream of unknown format;
the format is automatically detected. By contrast, the use of parameters require to
determine the format first (i.e. select a <code>Data­Store­Provider</code>).</li>
<li>Parameters can be used to dynamically generate user configuration interfaces
and provide fine grain control over the store general behavior such as caching,
time-outs, encoding, <i>etc</i>.</li>
<li>Parameters can more easily be serialized in XML or configuration files.</li>
</ul></div></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>description of the parameters required or accepted for opening a <a href="DataStore.html" title="class in org.apache.sis.storage"><code>Data­Store</code></a>.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>0.8</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="#LOCATION"><code>LOCATION</code></a>,
<a href="#CREATE"><code>CREATE</code></a>,
<a href="#open(org.opengis.parameter.ParameterValueGroup)"><code>open(Parameter­Value­Group)</code></a>,
<a href="DataStore.html#getOpenParameters()"><code>Data­Store​.get­Open­Parameters()</code></a></dd>
</dl>
</li>
</ul>
<a id="probeContent(org.apache.sis.storage.StorageConnector)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>probeContent</h4>
<pre class="methodSignature">public abstract&nbsp;<a href="ProbeResult.html" title="class in org.apache.sis.storage">ProbeResult</a>&nbsp;probeContent&#8203;(<a href="StorageConnector.html" title="class in org.apache.sis.storage">StorageConnector</a>&nbsp;connector)
throws <a href="DataStoreException.html" title="class in org.apache.sis.storage">DataStoreException</a></pre>
<div class="block">Indicates if the given storage appears to be supported by the <code>Data­Store</code>s created by this provider.
The most typical return values are:
<ul>
<li><a href="ProbeResult.html#SUPPORTED"><code>Probe­Result​.SUPPORTED</code></a> if the <code>Data­Store</code>s created by this provider
can open the given storage.</li>
<li><a href="ProbeResult.html#UNSUPPORTED_STORAGE"><code>Probe­Result​.UNSUPPORTED_STORAGE</code></a> if the given storage does not appear to be in a format
supported by this <code>Data­Store­Provider</code>.</li>
</ul>
Note that the <code>SUPPORTED</code> value does not guarantee that reading or writing will succeed,
only that there appears to be a reasonable chance of success based on a brief inspection of the
<a href="StorageConnector.html#getStorage()">storage object</a> or contents.
<p>Implementers are responsible for restoring the input to its original stream position on return of this method.
Implementers can use a mark/reset pair for this purpose. Marks are available as
<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html?is-external=true#mark()" title="class or interface in java.nio" class="externalLink"><code>Byte­Buffer​.mark()</code></a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html?is-external=true#mark(int)" title="class or interface in java.io" class="externalLink"><code>Input­Stream​.mark(int)</code></a> and
<a href="https://docs.oracle.com/javase/8/docs/api/javax/imageio/stream/ImageInputStream.html?is-external=true#mark()" title="class or interface in javax.imageio.stream" class="externalLink"><code>Image­Input­Stream​.mark()</code></a>.</p>
<div class="note"><b>Implementation example</b><br>
Implementations will typically check the first bytes of the stream for a "magic number" associated
with the format, as in the following example:
<blockquote><pre><font color="green">public</font> ProbeResult <b>probeContent</b>(StorageConnector storage) <font color="green">throws</font> DataStoreException {
<font color="green">final</font> ByteBuffer buffer = storage.<b>getStorageAs</b>(ByteBuffer.<font color="green">class</font>);
<font color="green">if</font> (buffer == <font color="green">null</font>) {
<i><font color="gray">// If StorageConnector can not provide a ByteBuffer, then the storage is</font></i>
<i><font color="gray">// probably not a File, URL, URI, InputStream neither a ReadableChannel.</font></i>
<font color="green">return</font> ProbeResult.UNSUPPORTED_STORAGE;
}
<font color="green">if</font> (buffer.<b>remaining</b>() &lt; Integer.BYTES) {
<i><font color="gray">// If the buffer does not contain enough bytes for the integer type, this is not</font></i>
<i><font color="gray">// necessarily because the file is truncated. It may be because the data were not</font></i>
<i><font color="gray">// yet available at the time this method has been invoked.</font></i>
<font color="green">return</font> ProbeResult.INSUFFICIENT_BYTES;
}
<font color="green">if</font> (buffer.<b>getInt</b>(buffer.<b>position</b>()) != MAGIC_NUMBER) {
<i><font color="gray">// We used ByteBuffer.getInt(int) instead than ByteBuffer.getInt() above</font></i>
<i><font color="gray">// in order to keep the buffer position unchanged after this method call.</font></i>
<font color="green">return</font> ProbeResult.UNSUPPORTED_STORAGE;
}
<font color="green">return</font> ProbeResult.SUPPORTED;
}</pre></blockquote>
</div></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>connector</code> - information about the storage (URL, stream, JDBC connection, <i>etc</i>).</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><a href="ProbeResult.html#SUPPORTED"><code>Probe­Result​.SUPPORTED</code></a> if the given storage seems to be readable by the <code>Data­Store</code>
instances created by this provider.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="DataStoreException.html" title="class in org.apache.sis.storage">Data­Store­Exception</a></code> - if an I/O or SQL error occurred. The error shall be unrelated to the logical
structure of the storage.</dd>
</dl>
</li>
</ul>
<a id="open(org.apache.sis.storage.StorageConnector)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>open</h4>
<pre class="methodSignature">public abstract&nbsp;<a href="DataStore.html" title="class in org.apache.sis.storage">DataStore</a>&nbsp;open&#8203;(<a href="StorageConnector.html" title="class in org.apache.sis.storage">StorageConnector</a>&nbsp;connector)
throws <a href="DataStoreException.html" title="class in org.apache.sis.storage">DataStoreException</a></pre>
<div class="block">Returns a data store implementation associated with this provider.
This method is typically invoked when the format is not known in advance
(the <a href="#probeContent(org.apache.sis.storage.StorageConnector)"><code>probe­Content(Storage­Connector)</code></a> method can be tested on many providers)
or when the input is not a type accepted by <a href="#open(org.opengis.parameter.ParameterValueGroup)"><code>open(Parameter­Value­Group)</code></a>
(for example an <a href="https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io" class="externalLink"><code>Input­Stream</code></a>).
<div class="section">Implementation note</div>
Implementers shall invoke <a href="StorageConnector.html#closeAllExcept(java.lang.Object)"><code>Storage­Connector​.close­All­Except(Object)</code></a> after <code>Data­Store</code>
creation, keeping open only the needed resource.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>connector</code> - information about the storage (URL, stream, JDBC connection, <i>etc</i>).</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a data store implementation associated with this provider for the given storage.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="DataStoreException.html" title="class in org.apache.sis.storage">Data­Store­Exception</a></code> - if an error occurred while creating the data store instance.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="DataStores.html#open(java.lang.Object)"><code>Data­Stores​.open(Object)</code></a></dd>
</dl>
</li>
</ul>
<a id="open(org.opengis.parameter.ParameterValueGroup)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>open</h4>
<pre class="methodSignature">public&nbsp;<a href="DataStore.html" title="class in org.apache.sis.storage">DataStore</a>&nbsp;open&#8203;(<a href="http://www.geoapi.org/3.0/javadoc/org/opengis/parameter/ParameterValueGroup.html?is-external=true" title="class or interface in org.opengis.parameter" class="externalLink">ParameterValueGroup</a>&nbsp;parameters)
throws <a href="DataStoreException.html" title="class in org.apache.sis.storage">DataStoreException</a></pre>
<div class="block">Returns a data store implementation associated with this provider for the given parameters.
The <code>Data­Store­Provider</code> instance needs to be known before parameters are initialized,
since the parameters are implementation-dependent. Example:
<blockquote><pre>DataStoreProvider provider = ...;
ParameterValueGroup pg = provider.<b>getOpenParameters</b>().<b>createValue</b>();
pg.<b>parameter</b>(DataStoreProvider.LOCATION, myURL);
<i><font color="gray">// Set any other parameters if desired.</font></i>
<font color="green">try</font> (DataStore ds = provider.<b>open</b>(pg)) {
<i><font color="gray">// Use the data store.</font></i>
}</pre></blockquote>
<div class="section">Implementation note</div>
The default implementation gets the value of a parameter named <a href="#LOCATION">"location"</a>.
That value (typically a path or URL) is given to <a href="StorageConnector.html" title="class in org.apache.sis.storage"><code>Storage­Connector</code></a> constructor,
which is then passed to <a href="#open(org.apache.sis.storage.StorageConnector)"><code>open(Storage­Connector)</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>parameters</code> - opening parameters as defined by <a href="#getOpenParameters()"><code>get­Open­Parameters()</code></a>.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a data store implementation associated with this provider for the given parameters.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="DataStoreException.html" title="class in org.apache.sis.storage">Data­Store­Exception</a></code> - if an error occurred while creating the data store instance.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>0.8</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="#LOCATION"><code>LOCATION</code></a>,
<a href="#CREATE"><code>CREATE</code></a>,
<a href="#getOpenParameters()"><code>get­Open­Parameters()</code></a></dd>
</dl>
</li>
</ul>
<a id="getLogger()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getLogger</h4>
<pre class="methodSignature">public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/logging/Logger.html?is-external=true" title="class or interface in java.util.logging" class="externalLink">Logger</a>&nbsp;getLogger()</pre>
<div class="block">Returns the logger where to report warnings. This logger is used only if no
<a href="event/StoreListener.html" title="interface in org.apache.sis.storage.event"><code>Store­Listener</code></a> has been registered for
<a href="event/WarningEvent.html" title="class in org.apache.sis.storage.event"><code>Warning­Event</code></a>.
<p>The default implementation returns a logger with the same name as the package name
of the subclass of this <code>Data­Store­Provider</code> instance. Subclasses should override
this method if they can provide a more specific logger.</p></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the logger to use as a fallback (when there is no listeners) for warning messages.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.0</dd>
</dl>
</li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
</div>
</main>
<!-- ========= END OF CLASS DATA ========= -->
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/DataStoreProvider.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
<p class="legalCopy"><small>Copyright &#169; 2010&#x2013;2019 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</footer>
</body>
</html>