blob: 097b66d54c64e213149b76592ea92a108199a9d3 [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>MetadataSource (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.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="addWarningListener()">
<meta name="keywords" content="removeWarningListener()">
<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="../../../../../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="MetadataSource (Apache SIS 1.0 API)";
}
}
catch(err) {
}
//-->
var data = {"i0":42,"i1":10,"i2":9,"i3":10,"i4":42,"i5":10};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated 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/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">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.metadata.sql</a></div>
<h2 title="Class MetadataSource" class="title">Class MetadataSource</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>MetadataSource</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html?is-external=true" title="class or interface in java.lang" class="externalLink">Auto­Closeable</a></code></dd>
</dl>
<dl>
<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>
<pre>public class <span class="typeNameLabel">MetadataSource</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>
implements <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html?is-external=true" title="class or interface in java.lang" class="externalLink">AutoCloseable</a></pre>
<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 pre-defined 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.
<div class="section">Properties</div>
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/javase/8/docs/api/javax/sql/DataSource.html?is-external=true" title="class or interface in javax.sql" class="externalLink">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/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink"><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/javase/8/docs/api/java/lang/ClassLoader.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>ClassLoader</code></a></td> <td>The class loader to use for creating <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Proxy.html?is-external=true" title="class or interface in java.lang.reflect" class="externalLink"><code>Proxy</code></a> instances.</td></tr>
<tr><td><code>"maxStatements"</code></td> <td><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>Integer</code></a></td> <td>Maximal number of <a href="https://docs.oracle.com/javase/8/docs/api/java/sql/PreparedStatement.html?is-external=true" title="class or interface in java.sql" class="externalLink"><code>Prepared­Statement</code></a>s that can be kept simultaneously open.</td></tr>
</table>
<div class="section">Concurrency</div>
<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/javase/8/docs/api/javax/sql/DataSource.html?is-external=true" title="class or interface in javax.sql" class="externalLink"><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>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>0.8</dd>
<p><font size="-1">Defined in the <code>sis-metadata</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>protected <a href="../MetadataStandard.html" title="class in org.apache.sis.metadata">MetadataStandard</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#standard">standard</a></span></code></th>
<td class="colLast">
<div class="block">The metadata standard to be used for constructing the database schema.</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">Constructor</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(org.apache.sis.metadata.MetadataStandard,javax.sql.DataSource,java.lang.String,java.util.Map)">MetadataSource</a></span>&#8203;(<a href="../MetadataStandard.html" title="class in org.apache.sis.metadata">MetadataStandard</a>&nbsp;standard,
<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>&nbsp;dataSource,
<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;schema,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink">Map</a>&lt;<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>,&#8203;?&gt;&nbsp;properties)</code></th>
<td class="colLast">
<div class="block">Creates a new metadata source.</div>
</td>
</tr>
<tr class="rowColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(org.apache.sis.metadata.sql.MetadataSource)">MetadataSource</a></span>&#8203;(<a href="MetadataSource.html" title="class in org.apache.sis.metadata.sql">MetadataSource</a>&nbsp;source)</code></th>
<td class="colLast">
<div class="block">Creates a new metadata source with the same configuration than the given source.</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="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></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="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated 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>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#addWarningListener(org.apache.sis.util.logging.WarningListener)">addWarningListener</a></span>&#8203;(<a href="../../util/logging/WarningListener.html" title="interface in org.apache.sis.util.logging">WarningListener</a>&lt;? super <a href="MetadataSource.html" title="class in org.apache.sis.metadata.sql">MetadataSource</a>&gt;&nbsp;listener)</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment"><code>Warning­Listener</code> to be replaced by <a href="https://docs.oracle.com/javase/8/docs/api/java/util/logging/Filter.html?is-external=true" title="class or interface in java.util.logging" class="externalLink"><code>Filter</code></a>.</div>
</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#close()">close</a></span>()</code></th>
<td class="colLast">
<div class="block">Closes the database connection used by this object.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>static <a href="MetadataSource.html" title="class in org.apache.sis.metadata.sql">MetadataSource</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getProvided()">getProvided</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the metadata source connected to the <code>"jdbc/Spatial­Metadata"</code> database.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>&lt;T&gt;&nbsp;T</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#lookup(java.lang.Class,java.lang.String)">lookup</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang" class="externalLink">Class</a>&lt;T&gt;&nbsp;type,
<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;identifier)</code></th>
<td class="colLast">
<div class="block">Returns an implementation of the specified metadata interface filled with the data referenced
by the specified identifier.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#removeWarningListener(org.apache.sis.util.logging.WarningListener)">removeWarningListener</a></span>&#8203;(<a href="../../util/logging/WarningListener.html" title="interface in org.apache.sis.util.logging">WarningListener</a>&lt;? super <a href="MetadataSource.html" title="class in org.apache.sis.metadata.sql">MetadataSource</a>&gt;&nbsp;listener)</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment"><code>Warning­Listener</code> to be replaced by <a href="https://docs.oracle.com/javase/8/docs/api/java/util/logging/Filter.html?is-external=true" title="class or interface in java.util.logging" class="externalLink"><code>Filter</code></a>.</div>
</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><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="#search(java.lang.Object)">search</a></span>&#8203;(<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>&nbsp;metadata)</code></th>
<td class="colLast">
<div class="block">Searches for the given metadata in the database.</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="standard">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>standard</h4>
<pre>protected final&nbsp;<a href="../MetadataStandard.html" title="class in org.apache.sis.metadata">MetadataStandard</a> standard</pre>
<div class="block">The metadata standard to be used for constructing the database schema.</div>
</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;(org.apache.sis.metadata.MetadataStandard,javax.sql.DataSource,java.lang.String,java.util.Map)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>MetadataSource</h4>
<pre>public&nbsp;MetadataSource&#8203;(<a href="../MetadataStandard.html" title="class in org.apache.sis.metadata">MetadataStandard</a>&nbsp;standard,
<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>&nbsp;dataSource,
<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;schema,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink">Map</a>&lt;<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>,&#8203;?&gt;&nbsp;properties)</pre>
<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>
<dt><span class="paramLabel">Parameters:</span></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>
</li>
</ul>
<a id="&lt;init&gt;(org.apache.sis.metadata.sql.MetadataSource)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>MetadataSource</h4>
<pre>public&nbsp;MetadataSource&#8203;(<a href="MetadataSource.html" title="class in org.apache.sis.metadata.sql">MetadataSource</a>&nbsp;source)</pre>
<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/javase/8/docs/api/java/sql/Connection.html?is-external=true" title="class or interface in java.sql" class="externalLink"><code>Connection</code></a>.
This constructor is useful when concurrency is desired.
<p>The new <code>Metadata­Source</code> initially contains all <a href="#addWarningListener(org.apache.sis.util.logging.WarningListener)">warning listeners</a>
declared in the given <code>source</code>. But listeners added or removed in a <code>Metadata­Source</code> after the
construction will not impact the other <code>Metadata­Source</code> instance.</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>source</code> - the source from which to copy the configuration.</dd>
</dl>
</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="getProvided()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getProvided</h4>
<pre class="methodSignature">public static&nbsp;<a href="MetadataSource.html" title="class in org.apache.sis.metadata.sql">MetadataSource</a>&nbsp;getProvided()</pre>
<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 pre-defined 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 can not be established, then this method returns
a fallback with a few hard-coded values.</p></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>source of pre-defined metadata records from the <code>"jdbc/Spatial­Metadata"</code> database.</dd>
</dl>
</li>
</ul>
<a id="search(java.lang.Object)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>search</h4>
<pre class="methodSignature">public&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;search&#8203;(<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>&nbsp;metadata)
throws <a href="MetadataStoreException.html" title="class in org.apache.sis.metadata.sql">MetadataStoreException</a></pre>
<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>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>metadata</code> - the metadata to search for.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the identifier of the given metadata, or <code>null</code> if none.</dd>
<dt><span class="throwsLabel">Throws:</span></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>
</li>
</ul>
<a id="lookup(java.lang.Class,java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>lookup</h4>
<pre class="methodSignature">public&nbsp;&lt;T&gt;&nbsp;T&nbsp;lookup&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang" class="externalLink">Class</a>&lt;T&gt;&nbsp;type,
<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;identifier)
throws <a href="MetadataStoreException.html" title="class in org.apache.sis.metadata.sql">MetadataStoreException</a></pre>
<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/util/CodeList.html?is-external=true" title="class or interface in org.opengis.util" class="externalLink"><code>Code­List</code></a> or
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>Enum</code></a> element.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - the parameterized type of the <code>type</code> argument.</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>type</code> - the interface to implement (e.g. <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/metadata/citation/Citation.html?is-external=true" title="class or interface in org.opengis.metadata.citation" class="externalLink"><code>Citation</code></a>),
or the <code>Controlled­Vocabulary</code> type (<a href="http://www.geoapi.org/3.0/javadoc/org/opengis/util/CodeList.html?is-external=true" title="class or interface in org.opengis.util" class="externalLink"><code>Code­List</code></a> or some <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang" class="externalLink"><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><span class="returnLabel">Returns:</span></dt>
<dd>an implementation of the required interface, or the code list element.</dd>
<dt><span class="throwsLabel">Throws:</span></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.</dd>
</dl>
</li>
</ul>
<a id="addWarningListener(org.apache.sis.util.logging.WarningListener)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addWarningListener</h4>
<pre class="methodSignature"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang" class="externalLink">@Deprecated</a>
public&nbsp;void&nbsp;addWarningListener&#8203;(<a href="../../util/logging/WarningListener.html" title="interface in org.apache.sis.util.logging">WarningListener</a>&lt;? super <a href="MetadataSource.html" title="class in org.apache.sis.metadata.sql">MetadataSource</a>&gt;&nbsp;listener)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalArgumentException</a></pre>
<div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment"><code>Warning­Listener</code> to be replaced by <a href="https://docs.oracle.com/javase/8/docs/api/java/util/logging/Filter.html?is-external=true" title="class or interface in java.util.logging" class="externalLink"><code>Filter</code></a>.</div>
</div>
<div class="block">Adds a listener 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 listener, then the warning is logged at <a href="https://docs.oracle.com/javase/8/docs/api/java/util/logging/Level.html?is-external=true#WARNING" title="class or interface in java.util.logging" class="externalLink"><code>Level​.WARNING</code></a>.</li>
<li>If this metadata source has at least one warning listener, then all listeners are notified
and the warning is <strong>not</strong> logged by this metadata source instance.</li>
</ul>
Consider invoking this method in a <code>try</code><code>finally</code> block if the <code>Metadata­Source</code>
lifetime is longer than the listener lifetime, as below:
<blockquote><pre>source.<b>addWarningListener</b>(listener);
<font color="green">try</font> {
<i><font color="gray">// Do some work...</font></i>
} <font color="green">finally</font> {
source.<b>removeWarningListener</b>(listener);
}</pre></blockquote></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>listener</code> - the listener to add.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">Illegal­Argument­Exception</a></code> - if the given listener is already registered in this metadata source.</dd>
</dl>
</li>
</ul>
<a id="removeWarningListener(org.apache.sis.util.logging.WarningListener)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removeWarningListener</h4>
<pre class="methodSignature"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang" class="externalLink">@Deprecated</a>
public&nbsp;void&nbsp;removeWarningListener&#8203;(<a href="../../util/logging/WarningListener.html" title="interface in org.apache.sis.util.logging">WarningListener</a>&lt;? super <a href="MetadataSource.html" title="class in org.apache.sis.metadata.sql">MetadataSource</a>&gt;&nbsp;listener)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/util/NoSuchElementException.html?is-external=true" title="class or interface in java.util" class="externalLink">NoSuchElementException</a></pre>
<div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment"><code>Warning­Listener</code> to be replaced by <a href="https://docs.oracle.com/javase/8/docs/api/java/util/logging/Filter.html?is-external=true" title="class or interface in java.util.logging" class="externalLink"><code>Filter</code></a>.</div>
</div>
<div class="block">Removes a previously registered listener.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>listener</code> - the listener to remove.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/NoSuchElementException.html?is-external=true" title="class or interface in java.util" class="externalLink">No­Such­Element­Exception</a></code> - if the given listener is not registered in this metadata source.</dd>
</dl>
</li>
</ul>
<a id="close()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>close</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;close()
throws <a href="MetadataStoreException.html" title="class in org.apache.sis.metadata.sql">MetadataStoreException</a></pre>
<div class="block">Closes the database connection used by this object.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html?is-external=true#close()" title="class or interface in java.lang" class="externalLink">close</a></code>&nbsp;in interface&nbsp;<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html?is-external=true" title="class or interface in java.lang" class="externalLink">Auto­Closeable</a></code></dd>
<dt><span class="throwsLabel">Throws:</span></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>
</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/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">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>