blob: 1c135db0857bdef5f68a14b8ee3864d70b30f73d [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (19) -->
<title>MetadataSource (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.metadata.sql, class: MetadataSource">
<meta name="generator" content="javadoc/ClassWriterImpl">
<meta name="keywords" content="org.apache.sis.metadata.sql.MetadataSource class">
<meta name="keywords" content="standard">
<meta name="keywords" content="getProvided()">
<meta name="keywords" content="search()">
<meta name="keywords" content="lookup()">
<meta name="keywords" content="setWarningFilter()">
<meta name="keywords" content="getWarningFilter()">
<meta name="keywords" content="close()">
<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">&nbsp;</span><span class="nav-bar-toggle-icon">&nbsp;</span><span class="nav-bar-toggle-icon">&nbsp;</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/MetadataSource.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>Nested</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:&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="sub-nav-list">
<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>
<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>&nbsp;<a href="package-summary.html">org.apache.sis.metadata.sql</a></div>
<h1 title="Class MetadataSource" class="title">Class MetadataSource</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">MetadataSource</div>
</div>
<section class="class-description" id="class-description">
<dl class="notes">
<dt>All Implemented Interfaces:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/AutoCloseable.html" title="class or interface in java.lang" class="external-link">Auto­Closeable</a></code></dd>
</dl>
<dl class="notes">
<dt>Direct Known Subclasses:</dt>
<dd><code><a href="MetadataWriter.html" title="class in org.apache.sis.metadata.sql">Metadata­Writer</a></code></dd>
</dl>
<hr>
<div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">MetadataSource</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>
implements <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/AutoCloseable.html" title="class or interface in java.lang" class="external-link">AutoCloseable</a></span></div>
<div class="block">A connection to a metadata database in read-only mode. It can be either the database
<a href="#getProvided()">provided by Apache SIS</a> with predefined ISO 19115 metadata,
or another database specified at construction time.
Metadata instances can be obtained as in the example below:
<blockquote><pre>MetadataSource metadata = MetadataSource.<b>getProvided</b>();
Format format = source.<b>lookup</b>(Format.<font color="green">class</font>, <font color="orangered">"PNG"</font>);</pre></blockquote>
where <code>id</code> is the primary key value for the desired record in the <code>Format</code> table.
<h2>Properties</h2>
The constructor expects three Java arguments (the <a href="../MetadataStandard.html" title="class in org.apache.sis.metadata">metadata standard</a>,
the <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">data source</a> and the database schema) completed by an arbitrary amount
of optional arguments given as a map of properties.
The following keys are recognized by <code>Metadata­Source</code> and all other entries are ignored:
<table class="sis">
<caption>Optional properties at construction time</caption>
<tr><th>Key</th> <th>Value type</th> <th>Description</th></tr>
<tr><td><code>"catalog"</code></td> <td><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></td> <td>The database catalog where the metadata schema is stored.</td></tr>
<tr><td><code>"classloader"</code></td> <td><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/ClassLoader.html" title="class or interface in java.lang" class="external-link"><code>ClassLoader</code></a></td> <td>The class loader to use for creating <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/reflect/Proxy.html" title="class or interface in java.lang.reflect" class="external-link"><code>Proxy</code></a> instances.</td></tr>
<tr><td><code>"maxStatements"</code></td> <td><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Integer.html" title="class or interface in java.lang" class="external-link"><code>Integer</code></a></td> <td>Maximal number of <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.sql/java/sql/PreparedStatement.html" title="class or interface in java.sql" class="external-link"><code>Prepared­Statement</code></a>s that can be kept simultaneously open.</td></tr>
</table>
<h2>Concurrency</h2>
<code>Metadata­Source</code> is thread-safe but is not concurrent. If concurrency is desired,
multiple instances of <code>Metadata­Source</code> can be created for the same <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"><code>Data­Source</code></a>.
The <a href="#%3Cinit%3E(org.apache.sis.metadata.sql.MetadataSource)"><code>Metadata­Source(Metadata­Source)</code></a> convenience constructor can be used for this purpose.</div>
<dl class="notes">
<dt>Since:</dt>
<dd>0.8</dd>
<p><font size="-1">Defined in the <code>sis-metadata</code> module</font></p>
</dl>
</section>
<section class="summary">
<ul class="summary-list">
<!-- =========== 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>protected final <a href="../MetadataStandard.html" title="class in org.apache.sis.metadata">Metadata­Standard</a></code></div>
<div class="col-second even-row-color"><code><a href="#standard" class="member-name-link">standard</a></code></div>
<div class="col-last even-row-color">
<div class="block">The metadata standard to be used for constructing the database schema.</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 two-column-summary">
<div class="table-header col-first">Constructor</div>
<div class="table-header col-last">Description</div>
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(org.apache.sis.metadata.MetadataStandard,javax.sql.DataSource,java.lang.String,java.util.Map)" class="member-name-link">Metadata­Source</a><wbr>(<a href="../MetadataStandard.html" title="class in org.apache.sis.metadata">Metadata­Standard</a>&nbsp;standard,
<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">Data­Source</a>&nbsp;data­Source,
<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>&nbsp;schema,
<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;<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>,<wbr>?&gt;&nbsp;properties)</code></div>
<div class="col-last even-row-color">
<div class="block">Creates a new metadata source.</div>
</div>
<div class="col-constructor-name odd-row-color"><code><a href="#%3Cinit%3E(org.apache.sis.metadata.sql.MetadataSource)" class="member-name-link">Metadata­Source</a><wbr>(<a href="MetadataSource.html" title="class in org.apache.sis.metadata.sql">Metadata­Source</a>&nbsp;source)</code></div>
<div class="col-last odd-row-color">
<div class="block">Creates a new metadata source with the same configuration than the given source.</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-tab1" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab1', 3)" class="table-tab">Static 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-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>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#close()" class="member-name-link">close</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Closes the database connection used by this object.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="MetadataSource.html" title="class in org.apache.sis.metadata.sql">Metadata­Source</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#getProvided()" class="member-name-link">get­Provided</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns the metadata source connected to the <code>"jdbc/Spatial­Metadata"</code> database.</div>
</div>
<div class="col-first even-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/Filter.html" title="class or interface in java.util.logging" class="external-link">Filter</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getWarningFilter()" class="member-name-link">get­Warning­Filter</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 current warning filter.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>&lt;T&gt;&nbsp;T</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#lookup(java.lang.Class,java.lang.String)" class="member-name-link">lookup</a><wbr>(<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>&lt;T&gt;&nbsp;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>&nbsp;identifier)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns an implementation of the specified metadata interface filled with the data referenced
by the specified identifier.</div>
</div>
<div class="col-first even-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.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 method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#search(java.lang.Object)" class="member-name-link">search</a><wbr>(<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>&nbsp;metadata)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Searches for the given metadata in the database.</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/Filter.html" title="class or interface in java.util.logging" class="external-link">Filter</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setWarningFilter(java.util.logging.Filter)" class="member-name-link">set­Warning­Filter</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.logging/java/util/logging/Filter.html" title="class or interface in java.util.logging" class="external-link">Filter</a>&nbsp;filter)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Sets a filter to be notified when a warning occurred while reading from or writing metadata.</div>
</div>
</div>
</div>
</div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-Object">Methods inherited from class&nbsp;<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">get­Class</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">hash­Code</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">notify­All</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">to­String</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="standard">
<h3>standard</h3>
<div class="member-signature"><span class="modifiers">protected final</span>&nbsp;<span class="return-type"><a href="../MetadataStandard.html" title="class in org.apache.sis.metadata">MetadataStandard</a></span>&nbsp;<span class="element-name">standard</span></div>
<div class="block">The metadata standard to be used for constructing the database schema.</div>
</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="&lt;init&gt;(org.apache.sis.metadata.MetadataStandard,javax.sql.DataSource,java.lang.String,java.util.Map)">
<h3>MetadataSource</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">MetadataSource</span><wbr><span class="parameters">(<a href="../MetadataStandard.html" title="class in org.apache.sis.metadata">MetadataStandard</a>&nbsp;standard,
<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>&nbsp;dataSource,
<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>&nbsp;schema,
<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;<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>,<wbr>?&gt;&nbsp;properties)</span></div>
<div class="block">Creates a new metadata source. The metadata standard to implement (typically
<a href="../MetadataStandard.html#ISO_19115">ISO 19115</a>, but not necessarily) and
the database source are mandatory information.
All other information are optional and can be <code>null</code>.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>standard</code> - the metadata standard to implement.</dd>
<dd><code>data­Source</code> - the source for getting a connection to the database.</dd>
<dd><code>schema</code> - the database schema were metadata tables are stored, or <code>null</code> if none.</dd>
<dd><code>properties</code> - additional options, or <code>null</code> if none. See class javadoc for a description.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="&lt;init&gt;(org.apache.sis.metadata.sql.MetadataSource)">
<h3>MetadataSource</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">MetadataSource</span><wbr><span class="parameters">(<a href="MetadataSource.html" title="class in org.apache.sis.metadata.sql">MetadataSource</a>&nbsp;source)</span></div>
<div class="block">Creates a new metadata source with the same configuration than the given source.
The two <code>Metadata­Source</code> instances will share the same <code>Data­Source</code>
but will use their own <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.sql/java/sql/Connection.html" title="class or interface in java.sql" class="external-link"><code>Connection</code></a>.
This constructor is useful when concurrency is desired.
<p>The new <code>Metadata­Source</code> initially contains the <a href="#setWarningFilter(java.util.logging.Filter)">warning filter</a>
declared in the given <code>source</code>.</p></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>source</code> - the source from which to copy the configuration.</dd>
</dl>
</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="getProvided()">
<h3>getProvided</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="MetadataSource.html" title="class in org.apache.sis.metadata.sql">MetadataSource</a></span>&nbsp;<span class="element-name">getProvided</span>()</div>
<div class="block">Returns the metadata source connected to the <code>"jdbc/Spatial­Metadata"</code> database.
In a default Apache SIS installation, this metadata source contains predefined records
for some commonly used <a href="../iso/citation/DefaultCitation.html" title="class in org.apache.sis.metadata.iso.citation">citations</a> and <a href="../iso/distribution/DefaultFormat.html" title="class in org.apache.sis.metadata.iso.distribution">formats</a>
among others.
<p>If connection to the metadata database cannot be established, then this method returns
a fallback with a few hard-coded values.</p></div>
<dl class="notes">
<dt>Returns:</dt>
<dd>source of predefined metadata records from the <code>"jdbc/Spatial­Metadata"</code> database.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="search(java.lang.Object)">
<h3>search</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<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>&nbsp;<span class="element-name">search</span><wbr><span class="parameters">(<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>&nbsp;metadata)</span>
throws <span class="exceptions"><a href="MetadataStoreException.html" title="class in org.apache.sis.metadata.sql">MetadataStoreException</a></span></div>
<div class="block">Searches for the given metadata in the database. If such metadata is found, then its
identifier (primary key) is returned. Otherwise this method returns <code>null</code>.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>metadata</code> - the metadata to search for.</dd>
<dt>Returns:</dt>
<dd>the identifier of the given metadata, or <code>null</code> if none.</dd>
<dt>Throws:</dt>
<dd><code><a href="MetadataStoreException.html" title="class in org.apache.sis.metadata.sql">Metadata­Store­Exception</a></code> - if the metadata object does not implement a metadata interface
of the expected package, or if an error occurred while searching in the database.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="lookup(java.lang.Class,java.lang.String)">
<h3>lookup</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="type-parameters">&lt;T&gt;</span>&nbsp;<span class="return-type">T</span>&nbsp;<span class="element-name">lookup</span><wbr><span class="parameters">(<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>&lt;T&gt;&nbsp;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>&nbsp;identifier)</span>
throws <span class="exceptions"><a href="MetadataStoreException.html" title="class in org.apache.sis.metadata.sql">MetadataStoreException</a></span></div>
<div class="block">Returns an implementation of the specified metadata interface filled with the data referenced
by the specified identifier. Alternatively, this method can also return a <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/util/CodeList.html" title="class or interface in org.opengis.util" class="external-link"><code>Code­List</code></a> or
<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Enum.html" title="class or interface in java.lang" class="external-link"><code>Enum</code></a> element.</div>
<dl class="notes">
<dt>Type Parameters:</dt>
<dd><code>T</code> - the parameterized type of the <code>type</code> argument.</dd>
<dt>Parameters:</dt>
<dd><code>type</code> - the interface to implement (e.g. <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/citation/Citation.html" title="class or interface in org.opengis.metadata.citation" class="external-link"><code>Citation</code></a>),
or the <code>Controlled­Vocabulary</code> type (<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/util/CodeList.html" title="class or interface in org.opengis.util" class="external-link"><code>Code­List</code></a> or some <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Enum.html" title="class or interface in java.lang" class="external-link"><code>Enum</code></a>).</dd>
<dd><code>identifier</code> - the identifier of the record for the metadata entity to be created.
This is usually the primary key of the record to search for.</dd>
<dt>Returns:</dt>
<dd>an implementation of the required interface, or the code list element.</dd>
<dt>Throws:</dt>
<dd><code><a href="MetadataStoreException.html" title="class in org.apache.sis.metadata.sql">Metadata­Store­Exception</a></code> - if a SQL query failed or if the metadata has not been found.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="setWarningFilter(java.util.logging.Filter)">
<h3>setWarningFilter</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.logging/java/util/logging/Filter.html" title="class or interface in java.util.logging" class="external-link">Filter</a></span>&nbsp;<span class="element-name">setWarningFilter</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.logging/java/util/logging/Filter.html" title="class or interface in java.util.logging" class="external-link">Filter</a>&nbsp;filter)</span></div>
<div class="block">Sets a filter to be notified when a warning occurred while reading from or writing metadata.
When a warning occurs, there is a choice:
<ul>
<li>If this metadata source has no warning filter, or if the filter returns <code>true</code>,
then the warning is logged at <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.logging/java/util/logging/Level.html#WARNING" title="class or interface in java.util.logging" class="external-link"><code>Level​.WARNING</code></a>.</li>
<li>Otherwise the warning is not logged by this metadata source instance.
The filter implementation is free to keep a reference to the given record,
for example in order to display it in a graphical user interface.</li>
</ul></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>filter</code> - the filter to set, or <code>null</code> for removing the filter.</dd>
<dt>Returns:</dt>
<dd>the previous filter, or <code>null</code> if none.</dd>
<dt>Since:</dt>
<dd>1.1</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getWarningFilter()">
<h3>getWarningFilter</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.logging/java/util/logging/Filter.html" title="class or interface in java.util.logging" class="external-link">Filter</a></span>&nbsp;<span class="element-name">getWarningFilter</span>()</div>
<div class="block">Returns the current warning filter.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the current filter, or <code>null</code> if none.</dd>
<dt>Since:</dt>
<dd>1.1</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="close()">
<h3>close</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">close</span>()
throws <span class="exceptions"><a href="MetadataStoreException.html" title="class in org.apache.sis.metadata.sql">MetadataStoreException</a></span></div>
<div class="block">Closes the database connection used by this object.</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/AutoCloseable.html#close()" title="class or interface in java.lang" class="external-link">close</a></code>&nbsp;in interface&nbsp;<code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/AutoCloseable.html" title="class or interface in java.lang" class="external-link">Auto­Closeable</a></code></dd>
<dt>Throws:</dt>
<dd><code><a href="MetadataStoreException.html" title="class in org.apache.sis.metadata.sql">Metadata­Store­Exception</a></code> - if an error occurred while closing the connection.</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
<!-- ========= END OF CLASS DATA ========= -->
</main>
<footer role="contentinfo">
<hr>
<p class="legal-copy"><small>Copyright &#169; 2010&#x2013;2022 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</footer>
</div>
</div>
</body>
</html>