| <!DOCTYPE HTML> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (19) --> |
| <title>DataStoreProvider (Apache SIS 1.3 API)</title> |
| <meta name="viewport" content="width=device-width, initial-scale=1"> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="description" content="declaration: package: org.apache.sis.storage, class: DataStoreProvider"> |
| <meta name="generator" content="javadoc/ClassWriterImpl"> |
| <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="../../../../script-dir/jquery-ui.min.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../jquery-ui.overrides.css" title="Style"> |
| <script type="text/javascript" src="../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../script-dir/jquery-3.6.0.min.js"></script> |
| <script type="text/javascript" src="../../../../script-dir/jquery-ui.min.js"></script> |
| </head> |
| <body class="class-declaration-page"> |
| <script type="text/javascript">var pathtoroot = "../../../../"; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <div class="flex-box"> |
| <header role="banner" class="flex-header"> |
| <nav role="navigation"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span></button> |
| <div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div> |
| <ul id="navbar-top-firstrow" class="nav-list" title="Navigation"> |
| <li><a href="../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="nav-bar-cell1-rev">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#class">Help</a></li> |
| </ul> |
| <ul class="sub-nav-list-small"> |
| <li> |
| <p>Summary:</p> |
| <ul> |
| <li><a href="#nested-class-summary">Nested</a></li> |
| <li><a href="#field-summary">Field</a></li> |
| <li><a href="#constructor-summary">Constr</a></li> |
| <li><a href="#method-summary">Method</a></li> |
| </ul> |
| </li> |
| <li> |
| <p>Detail:</p> |
| <ul> |
| <li><a href="#field-detail">Field</a></li> |
| <li><a href="#constructor-detail">Constr</a></li> |
| <li><a href="#method-detail">Method</a></li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="sub-nav"> |
| <div id="navbar-sub-list"> |
| <ul class="sub-nav-list"> |
| <li>Summary: </li> |
| <li><a href="#nested-class-summary">Nested</a> | </li> |
| <li><a href="#field-summary">Field</a> | </li> |
| <li><a href="#constructor-summary">Constr</a> | </li> |
| <li><a href="#method-summary">Method</a></li> |
| </ul> |
| <ul class="sub-nav-list"> |
| <li>Detail: </li> |
| <li><a href="#field-detail">Field</a> | </li> |
| <li><a href="#constructor-detail">Constr</a> | </li> |
| <li><a href="#method-detail">Method</a></li> |
| </ul> |
| </div> |
| <div class="nav-list-search"><a href="../../../../search.html">SEARCH</a> |
| <input type="text" id="search-input" disabled placeholder="Search"> |
| <input type="reset" id="reset-button" disabled value="reset"> |
| </div> |
| </div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <span class="skip-nav" id="skip-navbar-top"></span></nav> |
| </header> |
| <div class="flex-content"> |
| <main role="main"> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="sub-title"><span class="package-label-in-type">Package</span> <a href="package-summary.html">org.apache.sis.storage</a></div> |
| <h1 title="Class DataStoreProvider" class="title">Class DataStoreProvider</h1> |
| </div> |
| <div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> |
| <div class="inheritance">DataStoreProvider</div> |
| </div> |
| <section class="class-description" id="class-description"> |
| <dl class="notes"> |
| <dt>Direct Known Subclasses:</dt> |
| <dd><code><a href="geotiff/GeoTiffStoreProvider.html" title="class in org.apache.sis.storage.geotiff">GeoTiffStoreProvider</a></code>, <code><a href="landsat/LandsatStoreProvider.html" title="class in org.apache.sis.storage.landsat">LandsatStoreProvider</a></code>, <code><a href="netcdf/NetcdfStoreProvider.html" title="class in org.apache.sis.storage.netcdf">NetcdfStoreProvider</a></code>, <code><a href="sql/SQLStoreProvider.html" title="class in org.apache.sis.storage.sql">SQLStoreProvider</a></code></dd> |
| </dl> |
| <hr> |
| <div class="type-signature"><span class="modifiers">public abstract class </span><span class="element-name type-name-label">DataStoreProvider</span> |
| <span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></span></div> |
| <div class="block">Provides information about a specific <a href="DataStore.html" title="class in org.apache.sis.storage"><code>DataStore</code></a> implementation. |
| There is typically one <code>DataStoreProvider</code> instance for each format supported by a library. |
| Each <code>DataStoreProvider</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>DataStore</code></a> implementation described by this provider.</li> |
| <li>Test if a <code>DataStore</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>StorageConnector</code></a>.</li> |
| </ul> |
| |
| <h2>Packaging data stores</h2> |
| 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>DataStoreProvider</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/en/java/javase/16/docs/api/java.base/java/util/ServiceLoader.html" title="class or interface in java.util" class="external-link"><code>ServiceLoader</code></a> for more general discussion about this lookup mechanism. |
| |
| <h2>Thread safety</h2> |
| All <code>DataStoreProvider</code> implementations shall be thread-safe. |
| However, the <code>DataStore</code> instances created by the providers do not need to be thread-safe.</div> |
| <dl class="notes"> |
| <dt>Since:</dt> |
| <dd>0.3</dd> |
| |
| <p><font size="-1">Defined in the <code>sis-storage</code> module</font></p> |
| </dl> |
| </section> |
| <section class="summary"> |
| <ul class="summary-list"> |
| <!-- ======== NESTED CLASS SUMMARY ======== --> |
| <li> |
| <section class="nested-class-summary" id="nested-class-summary"> |
| <h2>Nested Class Summary</h2> |
| <div class="caption"><span>Nested Classes</span></div> |
| <div class="summary-table three-column-summary"> |
| <div class="table-header col-first">Modifier and Type</div> |
| <div class="table-header col-second">Class</div> |
| <div class="table-header col-last">Description</div> |
| <div class="col-first even-row-color"><code>protected static interface </code></div> |
| <div class="col-second even-row-color"><code><a href="DataStoreProvider.Prober.html" class="type-name-link" title="interface in org.apache.sis.storage">DataStoreProvider.Prober</a><<a href="DataStoreProvider.Prober.html" title="type parameter in DataStoreProvider.Prober">S</a>></code></div> |
| <div class="col-last even-row-color"> |
| <div class="block">An action to execute for testing if a <a href="StorageConnector.html" title="class in org.apache.sis.storage"><code>StorageConnector</code></a> input can be read.</div> |
| </div> |
| </div> |
| </section> |
| </li> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <li> |
| <section class="field-summary" id="field-summary"> |
| <h2>Field Summary</h2> |
| <div class="caption"><span>Fields</span></div> |
| <div class="summary-table three-column-summary"> |
| <div class="table-header col-first">Modifier and Type</div> |
| <div class="table-header col-second">Field</div> |
| <div class="table-header col-last">Description</div> |
| <div class="col-first even-row-color"><code>static final <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div> |
| <div class="col-second even-row-color"><code><a href="#CREATE" class="member-name-link">CREATE</a></code></div> |
| <div class="col-last even-row-color"> |
| <div class="block">Name of the parameter that specifies whether to allow creation of a new <code>DataStore</code> if none exist |
| at the given location.</div> |
| </div> |
| <div class="col-first odd-row-color"><code>static final <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div> |
| <div class="col-second odd-row-color"><code><a href="#LOCATION" class="member-name-link">LOCATION</a></code></div> |
| <div class="col-last odd-row-color"> |
| <div class="block">Name of the parameter that specifies the data store location.</div> |
| </div> |
| </div> |
| </section> |
| </li> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <li> |
| <section class="constructor-summary" id="constructor-summary"> |
| <h2>Constructor Summary</h2> |
| <div class="caption"><span>Constructors</span></div> |
| <div class="summary-table three-column-summary"> |
| <div class="table-header col-first">Modifier</div> |
| <div class="table-header col-second">Constructor</div> |
| <div class="table-header col-last">Description</div> |
| <div class="col-first even-row-color"><code>protected </code></div> |
| <div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E()" class="member-name-link">DataStoreProvider</a>()</code></div> |
| <div class="col-last even-row-color"> |
| <div class="block">Creates a new provider.</div> |
| </div> |
| </div> |
| </section> |
| </li> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <li> |
| <section class="method-summary" id="method-summary"> |
| <h2>Method Summary</h2> |
| <div id="method-summary-table"> |
| <div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab3" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab3', 3)" class="table-tab">Abstract Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div> |
| <div id="method-summary-table.tabpanel" role="tabpanel"> |
| <div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0"> |
| <div class="table-header col-first">Modifier and Type</div> |
| <div class="table-header col-second">Method</div> |
| <div class="table-header col-last">Description</div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/distribution/Format.html" title="class or interface in org.opengis.metadata.distribution" class="external-link">Format</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getFormat()" class="member-name-link">getFormat</a>()</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns a description of the data format.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.logging/java/util/logging/Logger.html" title="class or interface in java.util.logging" class="external-link">Logger</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getLogger()" class="member-name-link">getLogger</a>()</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns the logger where to report warnings or loading operations.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>abstract <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/parameter/ParameterDescriptorGroup.html" title="class or interface in org.opengis.parameter" class="external-link">ParameterDescriptorGroup</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getOpenParameters()" class="member-name-link">getOpenParameters</a>()</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"> |
| <div class="block">Returns a description of all parameters accepted by this provider for opening a data store.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>abstract <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getShortName()" class="member-name-link">getShortName</a>()</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"> |
| <div class="block">Returns a short name or abbreviation for the data format.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../measure/Range.html" title="class in org.apache.sis.measure">Range</a><<a href="../util/Version.html" title="class in org.apache.sis.util">Version</a>></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getSupportedVersions()" class="member-name-link">getSupportedVersions</a>()</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns the range of versions supported by the data store, or <code>null</code> if unspecified.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>abstract <a href="DataStore.html" title="class in org.apache.sis.storage">DataStore</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#open(org.apache.sis.storage.StorageConnector)" class="member-name-link">open</a><wbr>(<a href="StorageConnector.html" title="class in org.apache.sis.storage">StorageConnector</a> connector)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"> |
| <div class="block">Returns a data store implementation associated with this provider.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="DataStore.html" title="class in org.apache.sis.storage">DataStore</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#open(org.opengis.parameter.ParameterValueGroup)" class="member-name-link">open</a><wbr>(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/parameter/ParameterValueGroup.html" title="class or interface in org.opengis.parameter" class="external-link">ParameterValueGroup</a> parameters)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns a data store implementation associated with this provider for the given parameters.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>abstract <a href="ProbeResult.html" title="class in org.apache.sis.storage">ProbeResult</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#probeContent(org.apache.sis.storage.StorageConnector)" class="member-name-link">probeContent</a><wbr>(<a href="StorageConnector.html" title="class in org.apache.sis.storage">StorageConnector</a> connector)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"> |
| <div class="block">Indicates if the given storage appears to be supported by the <code>DataStore</code>s created by this provider.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>protected <S> <a href="ProbeResult.html" title="class in org.apache.sis.storage">ProbeResult</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#probeContent(org.apache.sis.storage.StorageConnector,java.lang.Class,org.apache.sis.storage.DataStoreProvider.Prober)" class="member-name-link">probeContent</a><wbr>(<a href="StorageConnector.html" title="class in org.apache.sis.storage">StorageConnector</a> connector, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><S> type, |
| <a href="DataStoreProvider.Prober.html" title="interface in org.apache.sis.storage">DataStoreProvider.Prober</a><? super S> prober)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Applies the specified test on the storage content without modifying buffer or input stream position.</div> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="inherited-list"> |
| <h3 id="methods-inherited-from-class-Object">Methods inherited from class <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3> |
| <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div> |
| </section> |
| </li> |
| </ul> |
| </section> |
| <section class="details"> |
| <ul class="details-list"> |
| <!-- ============ FIELD DETAIL =========== --> |
| <li> |
| <section class="field-details" id="field-detail"> |
| <h2>Field Details</h2> |
| <ul class="member-list"> |
| <li> |
| <section class="detail" id="LOCATION"> |
| <h3>LOCATION</h3> |
| <div class="member-signature"><span class="modifiers">public static final</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span> <span class="element-name">LOCATION</span></div> |
| <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>getOpenParameters()</code></a>. |
| The parameter value is often a <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/net/URI.html" title="class or interface in java.net" class="external-link"><code>URI</code></a> or a <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/file/Path.html" title="class or interface in java.nio.file" class="external-link"><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/en/java/javase/16/docs/api/java.base/java/net/URI.html" title="class or interface in java.net" class="external-link"><code>URI</code></a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/file/Path.html" title="class or interface in java.nio.file" class="external-link"><code>Path</code></a>, JDBC <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.sql/javax/sql/DataSource.html" title="class or interface in javax.sql" class="external-link">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/en/java/javase/16/docs/api/java.base/java/io/InputStream.html" title="class or interface in java.io" class="external-link"><code>InputStream</code></a> and <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/channels/Channel.html" title="class or interface in java.nio.channels" class="external-link"><code>Channel</code></a> should be avoided.</p></div> |
| <dl class="notes"> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="#CREATE"><code>CREATE</code></a></li> |
| <li><a href="#getOpenParameters()"><code>getOpenParameters()</code></a></li> |
| <li><a href="../../../../constant-values.html#org.apache.sis.storage.DataStoreProvider.LOCATION">Constant Field Values</a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="CREATE"> |
| <h3>CREATE</h3> |
| <div class="member-signature"><span class="modifiers">public static final</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span> <span class="element-name">CREATE</span></div> |
| <div class="block">Name of the parameter that specifies whether to allow creation of a new <code>DataStore</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>getOpenParameters()</code></a> if the data store supports write operations. The parameter value is often a |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Boolean.html" title="class or interface in java.lang" class="external-link"><code>Boolean</code></a> and the default value should be <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Boolean.html#FALSE" title="class or interface in java.lang" class="external-link"><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(ParameterValueGroup)</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/en/java/javase/16/docs/api/java.base/java/nio/file/StandardOpenOption.html#CREATE" title="class or interface in java.nio.file" class="external-link"><code>StandardOpenOption.CREATE</code></a> and <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/file/StandardOpenOption.html#APPEND" title="class or interface in java.nio.file" class="external-link"><code>APPEND</code></a>. |
| The other file standard options like <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/file/StandardOpenOption.html#CREATE_NEW" title="class or interface in java.nio.file" class="external-link"><code>CREATE_NEW</code></a> and |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/file/StandardOpenOption.html#TRUNCATE_EXISTING" title="class or interface in java.nio.file" class="external-link"><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.geoapi/org/opengis/parameter/ParameterValueGroup.html" title="class or interface in org.opengis.parameter" class="external-link"><code>ParameterValueGroup</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>DataStore</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 class="notes"> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="#LOCATION"><code>LOCATION</code></a></li> |
| <li><a href="#getOpenParameters()"><code>getOpenParameters()</code></a></li> |
| <li><a href="../../../../constant-values.html#org.apache.sis.storage.DataStoreProvider.CREATE">Constant Field Values</a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <li> |
| <section class="constructor-details" id="constructor-detail"> |
| <h2>Constructor Details</h2> |
| <ul class="member-list"> |
| <li> |
| <section class="detail" id="<init>()"> |
| <h3>DataStoreProvider</h3> |
| <div class="member-signature"><span class="modifiers">protected</span> <span class="element-name">DataStoreProvider</span>()</div> |
| <div class="block">Creates a new provider.</div> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| <!-- ============ METHOD DETAIL ========== --> |
| <li> |
| <section class="method-details" id="method-detail"> |
| <h2>Method Details</h2> |
| <ul class="member-list"> |
| <li> |
| <section class="detail" id="getShortName()"> |
| <h3>getShortName</h3> |
| <div class="member-signature"><span class="modifiers">public abstract</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span> <span class="element-name">getShortName</span>()</div> |
| <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>"GeoTIFF"</code>, <code>"GML"</code>, <code>"GPX"</code>, <code>"JPEG"</code>, <code>"JPEG 2000"</code>, |
| <code>"NetCDF"</code>, <code>"PNG"</code>, <code>"Shapefile"</code>. |
| </div> |
| |
| For a more comprehensive format name, see <a href="#getFormat()"><code>getFormat()</code></a>.</div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>a short name or abbreviation for the data format.</dd> |
| <dt>Since:</dt> |
| <dd>0.8</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="#getFormat()"><code>getFormat()</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getFormat()"> |
| <h3>getFormat</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/distribution/Format.html" title="class or interface in org.opengis.metadata.distribution" class="external-link">Format</a></span> <span class="element-name">getFormat</span>()</div> |
| <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>getShortName()</code></a>. |
| Subclasses are encouraged to override this method for providing a more complete description, if available.</div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>a description of the data format.</dd> |
| <dt>Since:</dt> |
| <dd>0.8</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="#getShortName()"><code>getShortName()</code></a></li> |
| <li><a href="../metadata/iso/distribution/DefaultFormat.html" title="class in org.apache.sis.metadata.iso.distribution"><code>DefaultFormat</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getSupportedVersions()"> |
| <h3>getSupportedVersions</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="../measure/Range.html" title="class in org.apache.sis.measure">Range</a><<a href="../util/Version.html" title="class in org.apache.sis.util">Version</a>></span> <span class="element-name">getSupportedVersions</span>()</div> |
| <div class="block">Returns the range of versions supported by the data store, or <code>null</code> if unspecified.</div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>the range of supported versions, or <code>null</code> if unspecified.</dd> |
| <dt>Since:</dt> |
| <dd>0.8</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getOpenParameters()"> |
| <h3>getOpenParameters</h3> |
| <div class="member-signature"><span class="modifiers">public abstract</span> <span class="return-type"><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/parameter/ParameterDescriptorGroup.html" title="class or interface in org.opengis.parameter" class="external-link">ParameterDescriptorGroup</a></span> <span class="element-name">getOpenParameters</span>()</div> |
| <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>StorageConnector</code></a> for opening a <a href="DataStore.html" title="class in org.apache.sis.storage"><code>DataStore</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>DataStoreProvider</code> methods and used whenever a |
| <a href="StorageConnector.html" title="class in org.apache.sis.storage"><code>StorageConnector</code></a> is required.</p> |
| |
| <div class="note"><b>Alternative:</b> |
| the main differences between the use of <code>StorageConnector</code> and parameters are: |
| <ul class="verbose"> |
| <li><code>StorageConnector</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>DataStoreProvider</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 class="notes"> |
| <dt>Returns:</dt> |
| <dd>description of the parameters required or accepted for opening a <a href="DataStore.html" title="class in org.apache.sis.storage"><code>DataStore</code></a>.</dd> |
| <dt>Since:</dt> |
| <dd>0.8</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="#LOCATION"><code>LOCATION</code></a></li> |
| <li><a href="#CREATE"><code>CREATE</code></a></li> |
| <li><a href="#open(org.opengis.parameter.ParameterValueGroup)"><code>open(ParameterValueGroup)</code></a></li> |
| <li><a href="DataStore.html#getOpenParameters()"><code>DataStore.getOpenParameters()</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="probeContent(org.apache.sis.storage.StorageConnector)"> |
| <h3>probeContent</h3> |
| <div class="member-signature"><span class="modifiers">public abstract</span> <span class="return-type"><a href="ProbeResult.html" title="class in org.apache.sis.storage">ProbeResult</a></span> <span class="element-name">probeContent</span><wbr><span class="parameters">(<a href="StorageConnector.html" title="class in org.apache.sis.storage">StorageConnector</a> connector)</span> |
| throws <span class="exceptions"><a href="DataStoreException.html" title="class in org.apache.sis.storage">DataStoreException</a></span></div> |
| <div class="block">Indicates if the given storage appears to be supported by the <code>DataStore</code>s created by this provider. |
| Implementations will typically check the first bytes of the input stream for a "magic number" associated |
| with the format. The most typical return values are: |
| |
| <ul> |
| <li><a href="ProbeResult.html#SUPPORTED"><code>ProbeResult.SUPPORTED</code></a> or another instance with <a href="ProbeResult.html#isSupported()">supported</a> |
| status if the <code>DataStore</code>s created by this provider can open the given storage.</li> |
| <li><a href="ProbeResult.html#UNSUPPORTED_STORAGE"><code>ProbeResult.UNSUPPORTED_STORAGE</code></a> if the given storage does not appear to be in a format |
| supported by this <code>DataStoreProvider</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. |
| |
| <div class="note"><b>Note for implementers</b>: |
| Implementations are responsible for restoring the storage object to its original position |
| on return of this method. Implementers can use the mark/reset mechanism for this purpose. |
| Marks are available as <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/ByteBuffer.html#mark()" title="class or interface in java.nio" class="external-link"><code>ByteBuffer.mark()</code></a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/InputStream.html#mark(int)" title="class or interface in java.io" class="external-link"><code>InputStream.mark(int)</code></a> |
| and <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/javax/imageio/stream/ImageInputStream.html#mark()" title="class or interface in javax.imageio.stream" class="external-link"><code>ImageInputStream.mark()</code></a>. |
| Alternatively, the <a href="#probeContent(org.apache.sis.storage.StorageConnector,java.lang.Class,org.apache.sis.storage.DataStoreProvider.Prober)"><code>probeContent(StorageConnector, Class, Prober)</code></a> |
| helper method manages automatically the marks for a set of known types. |
| </div></div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>connector</code> - information about the storage (URL, stream, JDBC connection, <i>etc</i>).</dd> |
| <dt>Returns:</dt> |
| <dd>a <a href="ProbeResult.html#isSupported()">supported</a> status if the given storage |
| seems to be readable by the <code>DataStore</code> instances created by this provider.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="DataStoreException.html" title="class in org.apache.sis.storage">DataStoreException</a></code> - if an I/O or SQL error occurred. The error shall be unrelated to the logical |
| structure of the storage.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="probeContent(org.apache.sis.storage.StorageConnector,java.lang.Class,org.apache.sis.storage.DataStoreProvider.Prober)"> |
| <h3>probeContent</h3> |
| <div class="member-signature"><span class="modifiers">protected</span> <span class="type-parameters"><S></span> <span class="return-type"><a href="ProbeResult.html" title="class in org.apache.sis.storage">ProbeResult</a></span> <span class="element-name">probeContent</span><wbr><span class="parameters">(<a href="StorageConnector.html" title="class in org.apache.sis.storage">StorageConnector</a> connector, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><S> type, |
| <a href="DataStoreProvider.Prober.html" title="interface in org.apache.sis.storage">DataStoreProvider.Prober</a><? super S> prober)</span> |
| throws <span class="exceptions"><a href="DataStoreException.html" title="class in org.apache.sis.storage">DataStoreException</a></span></div> |
| <div class="block">Applies the specified test on the storage content without modifying buffer or input stream position. |
| This is a helper method for <a href="#probeContent(org.apache.sis.storage.StorageConnector)"><code>probeContent(StorageConnector)</code></a> implementations, |
| providing an alternative safer than <a href="StorageConnector.html#getStorageAs(java.lang.Class)"><code>StorageConnector.getStorageAs(Class)</code></a> |
| for performing an arbitrary number of independent tests on the same <code>StorageConnector</code>. |
| Current implementation accepts the following types (this list may be expanded in future versions): |
| |
| <blockquote> |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="external-link"><code>ByteBuffer</code></a> (default byte order fixed to <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/ByteOrder.html#BIG_ENDIAN" title="class or interface in java.nio" class="external-link"><code>BIG_ENDIAN</code></a>), |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/InputStream.html" title="class or interface in java.io" class="external-link"><code>InputStream</code></a>, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/DataInput.html" title="class or interface in java.io" class="external-link"><code>DataInput</code></a>, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.desktop/javax/imageio/stream/ImageInputStream.html" title="class or interface in javax.imageio.stream" class="external-link"><code>ImageInputStream</code></a> and |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/Reader.html" title="class or interface in java.io" class="external-link"><code>Reader</code></a>. |
| </blockquote> |
| |
| The following types are also accepted for completeness but provide no additional safety |
| compared to direct use of <a href="StorageConnector.html#getStorageAs(java.lang.Class)"><code>StorageConnector.getStorageAs(Class)</code></a>: |
| |
| <blockquote> |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/net/URI.html" title="class or interface in java.net" class="external-link"><code>URI</code></a>, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/net/URL.html" title="class or interface in java.net" class="external-link"><code>URL</code></a>, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/File.html" title="class or interface in java.io" class="external-link"><code>File</code></a>, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/file/Path.html" title="class or interface in java.nio.file" class="external-link"><code>Path</code></a> and |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link"><code>String</code></a> (interpreted as a file path). |
| </blockquote> |
| |
| This method <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/InputStream.html#mark(int)" title="class or interface in java.io" class="external-link">marks</a> and <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/InputStream.html#reset()" title="class or interface in java.io" class="external-link">resets</a> |
| streams automatically with an arbitrary read-ahead limit (typically okay for the first 8 kilobytes). |
| |
| <h4>Usage example</h4> |
| <a href="#probeContent(org.apache.sis.storage.StorageConnector)"><code>probeContent(StorageConnector)</code></a> implementations often check the first bytes of the |
| input stream for a "magic number" associated with the format, as in the following example: |
| |
| <blockquote><pre>@Override |
| <font color="green">public</font> ProbeResult <b>probeContent</b>(StorageConnector connector) <font color="green">throws</font> DataStoreException { |
| <font color="green">return</font> <b>probeContent</b>(connector, ByteBuffer.<font color="green">class</font>, (buffer) -> { |
| <font color="green">if</font> (buffer.<b>remaining</b>() >= Integer.BYTES) { |
| <font color="green">if</font> (buffer.<b>getInt</b>() == MAGIC_NUMBER) { |
| <font color="green">return</font> ProbeResult.SUPPORTED; |
| } |
| <font color="green">return</font> ProbeResult.UNSUPPORTED_STORAGE; |
| } |
| <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; |
| }); |
| }</pre></blockquote></div> |
| <dl class="notes"> |
| <dt>Type Parameters:</dt> |
| <dd><code>S</code> - the compile-time type of the <code>type</code> argument (the source or storage type).</dd> |
| <dt>Parameters:</dt> |
| <dd><code>connector</code> - information about the storage (URL, stream, JDBC connection, <i>etc</i>).</dd> |
| <dd><code>type</code> - the desired type as one of <code>ByteBuffer</code>, <code>DataInput</code>, <code>Connection</code> |
| class or other <a href="StorageConnector.html#getStorageAs(java.lang.Class)">documented types</a>.</dd> |
| <dd><code>prober</code> - the test to apply on the source of the given type.</dd> |
| <dt>Returns:</dt> |
| <dd>the result of executing the probe action with a source of the given type, |
| or <a href="ProbeResult.html#UNSUPPORTED_STORAGE"><code>ProbeResult.UNSUPPORTED_STORAGE</code></a> if the given type is supported |
| but no view can be created for the source given at construction time.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></code> - if the given <code>type</code> argument is not one of the supported types.</dd> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link">IllegalStateException</a></code> - if this <code>StorageConnector</code> has been <a href="StorageConnector.html#closeAllExcept(java.lang.Object)">closed</a>.</dd> |
| <dd><code><a href="DataStoreException.html" title="class in org.apache.sis.storage">DataStoreException</a></code> - if an error occurred while opening a stream or database connection, |
| or during the execution of the probe action.</dd> |
| <dt>Since:</dt> |
| <dd>1.2</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list-long"> |
| <li><a href="#probeContent(org.apache.sis.storage.StorageConnector)"><code>probeContent(StorageConnector)</code></a></li> |
| <li><a href="StorageConnector.html#getStorageAs(java.lang.Class)"><code>StorageConnector.getStorageAs(Class)</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="open(org.apache.sis.storage.StorageConnector)"> |
| <h3>open</h3> |
| <div class="member-signature"><span class="modifiers">public abstract</span> <span class="return-type"><a href="DataStore.html" title="class in org.apache.sis.storage">DataStore</a></span> <span class="element-name">open</span><wbr><span class="parameters">(<a href="StorageConnector.html" title="class in org.apache.sis.storage">StorageConnector</a> connector)</span> |
| throws <span class="exceptions"><a href="DataStoreException.html" title="class in org.apache.sis.storage">DataStoreException</a></span></div> |
| <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>probeContent(StorageConnector)</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(ParameterValueGroup)</code></a> |
| (for example an <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/InputStream.html" title="class or interface in java.io" class="external-link"><code>InputStream</code></a>). |
| |
| <h4>Implementation note</h4> |
| Implementers shall invoke <a href="StorageConnector.html#closeAllExcept(java.lang.Object)"><code>StorageConnector.closeAllExcept(Object)</code></a> after <code>DataStore</code> |
| creation, keeping open only the needed resource.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>connector</code> - information about the storage (URL, stream, JDBC connection, <i>etc</i>).</dd> |
| <dt>Returns:</dt> |
| <dd>a data store implementation associated with this provider for the given storage.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="DataStoreException.html" title="class in org.apache.sis.storage">DataStoreException</a></code> - if an error occurred while creating the data store instance.</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="DataStores.html#open(java.lang.Object)"><code>DataStores.open(Object)</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="open(org.opengis.parameter.ParameterValueGroup)"> |
| <h3>open</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="DataStore.html" title="class in org.apache.sis.storage">DataStore</a></span> <span class="element-name">open</span><wbr><span class="parameters">(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/parameter/ParameterValueGroup.html" title="class or interface in org.opengis.parameter" class="external-link">ParameterValueGroup</a> parameters)</span> |
| throws <span class="exceptions"><a href="DataStoreException.html" title="class in org.apache.sis.storage">DataStoreException</a></span></div> |
| <div class="block">Returns a data store implementation associated with this provider for the given parameters. |
| The <code>DataStoreProvider</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> |
| |
| <h4>Implementation note</h4> |
| 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>StorageConnector</code></a> constructor, |
| which is then passed to <a href="#open(org.apache.sis.storage.StorageConnector)"><code>open(StorageConnector)</code></a>.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>parameters</code> - opening parameters as defined by <a href="#getOpenParameters()"><code>getOpenParameters()</code></a>.</dd> |
| <dt>Returns:</dt> |
| <dd>a data store implementation associated with this provider for the given parameters.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="DataStoreException.html" title="class in org.apache.sis.storage">DataStoreException</a></code> - if an error occurred while creating the data store instance.</dd> |
| <dt>Since:</dt> |
| <dd>0.8</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="#LOCATION"><code>LOCATION</code></a></li> |
| <li><a href="#CREATE"><code>CREATE</code></a></li> |
| <li><a href="#getOpenParameters()"><code>getOpenParameters()</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getLogger()"> |
| <h3>getLogger</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.logging/java/util/logging/Logger.html" title="class or interface in java.util.logging" class="external-link">Logger</a></span> <span class="element-name">getLogger</span>()</div> |
| <div class="block">Returns the logger where to report warnings or loading operations. |
| This logger is used only if no <a href="event/StoreListener.html" title="interface in org.apache.sis.storage.event"><code>StoreListener</code></a> |
| has been registered for <a href="event/WarningEvent.html" title="class in org.apache.sis.storage.event"><code>WarningEvent</code></a>. |
| |
| <p>The default implementation returns a logger with the same name as the package name |
| of the subclass of this <code>DataStoreProvider</code> instance. Subclasses should override |
| this method if they can provide a more specific logger.</p></div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>the logger to use as a fallback (when there are no listeners) for warning messages.</dd> |
| <dt>Since:</dt> |
| <dd>1.0</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="event/StoreListeners.html#getLogger()"><code>StoreListeners.getLogger()</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </section> |
| <!-- ========= END OF CLASS DATA ========= --> |
| </main> |
| <footer role="contentinfo"> |
| <hr> |
| <p class="legal-copy"><small>Copyright © 2010–2022 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </footer> |
| </div> |
| </div> |
| </body> |
| </html> |