| <!DOCTYPE HTML> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (19) --> |
| <title>Resource (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, interface: Resource"> |
| <meta name="generator" content="javadoc/ClassWriterImpl"> |
| <meta name="keywords" content="org.apache.sis.storage.Resource interface"> |
| <meta name="keywords" content="getIdentifier()"> |
| <meta name="keywords" content="getMetadata()"> |
| <meta name="keywords" content="addListener()"> |
| <meta name="keywords" content="removeListener()"> |
| <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/Resource.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>Field</li> |
| <li>Constr</li> |
| <li><a href="#method-summary">Method</a></li> |
| </ul> |
| </li> |
| <li> |
| <p>Detail:</p> |
| <ul> |
| <li>Field</li> |
| <li>Constr</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>Nested | </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method-summary">Method</a></li> |
| </ul> |
| <ul class="sub-nav-list"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </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="Interface Resource" class="title">Interface Resource</h1> |
| </div> |
| <section class="class-description" id="class-description"> |
| <dl class="notes"> |
| <dt>All Known Subinterfaces:</dt> |
| <dd><code><a href="Aggregate.html" title="interface in org.apache.sis.storage">Aggregate</a></code>, <code><a href="DataSet.html" title="interface in org.apache.sis.storage">DataSet</a></code>, <code><a href="FeatureSet.html" title="interface in org.apache.sis.storage">FeatureSet</a></code>, <code><a href="GridCoverageResource.html" title="interface in org.apache.sis.storage">GridCoverageResource</a></code>, <code><a href="tiling/TiledResource.html" title="interface in org.apache.sis.storage.tiling">TiledResource</a></code>, <code><a href="WritableAggregate.html" title="interface in org.apache.sis.storage">WritableAggregate</a></code>, <code><a href="WritableFeatureSet.html" title="interface in org.apache.sis.storage">WritableFeatureSet</a></code>, <code><a href="WritableGridCoverageResource.html" title="interface in org.apache.sis.storage">WritableGridCoverageResource</a></code>, <code><a href="tiling/WritableTiledResource.html" title="interface in org.apache.sis.storage.tiling">WritableTiledResource</a></code></dd> |
| </dl> |
| <dl class="notes"> |
| <dt>All Known Implementing Classes:</dt> |
| <dd><code><a href="AbstractFeatureSet.html" title="class in org.apache.sis.storage">AbstractFeatureSet</a></code>, <code><a href="AbstractGridCoverageResource.html" title="class in org.apache.sis.storage">AbstractGridCoverageResource</a></code>, <code><a href="AbstractResource.html" title="class in org.apache.sis.storage">AbstractResource</a></code>, <code><a href="aggregate/ConcatenatedFeatureSet.html" title="class in org.apache.sis.storage.aggregate">ConcatenatedFeatureSet</a></code>, <code><a href="DataStore.html" title="class in org.apache.sis.storage">DataStore</a></code>, <code><a href="geotiff/GeoTiffStore.html" title="class in org.apache.sis.storage.geotiff">GeoTiffStore</a></code>, <code><a href="aggregate/JoinFeatureSet.html" title="class in org.apache.sis.storage.aggregate">JoinFeatureSet</a></code>, <code><a href="landsat/LandsatStore.html" title="class in org.apache.sis.storage.landsat">LandsatStore</a></code>, <code><a href="netcdf/NetcdfStore.html" title="class in org.apache.sis.storage.netcdf">NetcdfStore</a></code>, <code><a href="sql/SQLStore.html" title="class in org.apache.sis.storage.sql">SQLStore</a></code></dd> |
| </dl> |
| <hr> |
| <div class="type-signature"><span class="modifiers">public interface </span><span class="element-name type-name-label">Resource</span></div> |
| <div class="block">Provides access to geospatial data in a <code>DataStore</code>. The ISO 19115 specification defines resource as |
| an <cite>“identifiable asset or means that fulfills a requirement”</cite>. For example, a resource can be a |
| coverage of Sea Surface Temperature, or a coverage of water salinity, or the set of all buoys in a harbor, |
| or an aggregation of all the above. A resource is not necessarily digital; it can be a paper document or an |
| organization, in which case only metadata are provided. If the resource is digital, then <code>Resource</code>s |
| should be instances of sub-types like <a href="Aggregate.html" title="interface in org.apache.sis.storage"><code>Aggregate</code></a> or <a href="FeatureSet.html" title="interface in org.apache.sis.storage"><code>FeatureSet</code></a>. |
| |
| <p><code>DataStore</code>s are themselves closeable resources. |
| If the data store contains resources for many feature types or coverages, then the data store will be an |
| instance of <a href="Aggregate.html" title="interface in org.apache.sis.storage"><code>Aggregate</code></a>. The <a href="Aggregate.html#components()">components</a> of an aggregate can be |
| themselves other aggregates, thus forming a tree.</p> |
| |
| <div class="note"><b>Relationship with ISO 19115:</b> |
| this type is closely related to the <code>DS_Resource</code> type defined by ISO 19115. |
| The Apache SIS type differs from the ISO type by being more closely related to data extraction, |
| as can be seen from the checked <a href="DataStoreException.html" title="class in org.apache.sis.storage"><code>DataStoreException</code></a> thrown by most methods. |
| Convenience methods for frequently requested information – for example <a href="DataSet.html#getEnvelope()"><code>DataSet.getEnvelope()</code></a> – were added. |
| The sub-types performing the actual data extraction – for example <a href="FeatureSet.html" title="interface in org.apache.sis.storage"><code>FeatureSet</code></a> – are specific to Apache SIS. |
| </div></div> |
| <dl class="notes"> |
| <dt>Since:</dt> |
| <dd>0.8</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="Aggregate.html#components()"><code>Aggregate.components()</code></a></li> |
| </ul> |
| </dd> |
| |
| <p><font size="-1">Defined in the <code>sis-storage</code> module</font></p> |
| </dl> |
| </section> |
| <section class="summary"> |
| <ul class="summary-list"> |
| <!-- ========== 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></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-tab3"><code><T extends <a href="event/StoreEvent.html" title="class in org.apache.sis.storage.event">StoreEvent</a>><br>void</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#addListener(java.lang.Class,org.apache.sis.storage.event.StoreListener)" class="member-name-link">addListener</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><T> eventType, |
| <a href="event/StoreListener.html" title="interface in org.apache.sis.storage.event">StoreListener</a><? super T> listener)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"> |
| <div class="block">Registers a listener to notify when the specified kind of event occurs in this resource or in children.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Optional.html" title="class or interface in java.util" class="external-link">Optional</a><<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/util/GenericName.html" title="class or interface in org.opengis.util" class="external-link">GenericName</a>></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getIdentifier()" class="member-name-link">getIdentifier</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 the resource persistent identifier.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/Metadata.html" title="class or interface in org.opengis.metadata" class="external-link">Metadata</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getMetadata()" class="member-name-link">getMetadata</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 information about this resource.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><T extends <a href="event/StoreEvent.html" title="class in org.apache.sis.storage.event">StoreEvent</a>><br>void</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#removeListener(java.lang.Class,org.apache.sis.storage.event.StoreListener)" class="member-name-link">removeListener</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><T> eventType, |
| <a href="event/StoreListener.html" title="interface in org.apache.sis.storage.event">StoreListener</a><? super T> listener)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"> |
| <div class="block">Unregisters a listener previously added to this resource for the given type of events.</div> |
| </div> |
| </div> |
| </div> |
| </div> |
| </section> |
| </li> |
| </ul> |
| </section> |
| <section class="details"> |
| <ul class="details-list"> |
| <!-- ============ METHOD DETAIL ========== --> |
| <li> |
| <section class="method-details" id="method-detail"> |
| <h2>Method Details</h2> |
| <ul class="member-list"> |
| <li> |
| <section class="detail" id="getIdentifier()"> |
| <h3>getIdentifier</h3> |
| <div class="member-signature"><span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Optional.html" title="class or interface in java.util" class="external-link">Optional</a><<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/util/GenericName.html" title="class or interface in org.opengis.util" class="external-link">GenericName</a>></span> <span class="element-name">getIdentifier</span>() |
| throws <span class="exceptions"><a href="DataStoreException.html" title="class in org.apache.sis.storage">DataStoreException</a></span></div> |
| <div class="block">Returns the resource persistent identifier. |
| This identifier can be used to uniquely identify a resource in the containing <a href="DataStore.html" title="class in org.apache.sis.storage"><code>DataStore</code></a>. |
| For this identifier to be reliable the following conditions must hold: |
| |
| <ul> |
| <li>It shall be unique in the <a href="DataStore.html" title="class in org.apache.sis.storage"><code>DataStore</code></a> which contains it, if there is one.</li> |
| <li>It's value shall not change after closing and reopening the <a href="DataStore.html" title="class in org.apache.sis.storage"><code>DataStore</code></a> on the same data.</li> |
| <li>It should be consistent with the <code><a href="#getMetadata()">getMetadata()</a>/identificationInfo/citation/identifier</code> value.</li> |
| </ul> |
| |
| If any of above conditions is not met, then this identifier should be absent. |
| This case may happen when a resource is an intermediate result of an ongoing process |
| or is a temporary resource generated on-the-fly, for example a sensor event.</div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>a persistent identifier unique within the data store, or absent if this resource has no such identifier.</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 fetching the identifier.</dd> |
| <dt>Since:</dt> |
| <dd>1.0</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="DataStore.html#getIdentifier()"><code>DataStore.getIdentifier()</code></a></li> |
| <li><a href="DataStore.html#findResource(java.lang.String)"><code>DataStore.findResource(String)</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getMetadata()"> |
| <h3>getMetadata</h3> |
| <div class="member-signature"><span class="return-type"><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/Metadata.html" title="class or interface in org.opengis.metadata" class="external-link">Metadata</a></span> <span class="element-name">getMetadata</span>() |
| throws <span class="exceptions"><a href="DataStoreException.html" title="class in org.apache.sis.storage">DataStoreException</a></span></div> |
| <div class="block">Returns information about this resource. |
| If this resource is an <a href="Aggregate.html" title="interface in org.apache.sis.storage"><code>Aggregate</code></a>, then the metadata may enumerate characteristics |
| (spatiotemporal extents, feature types, range dimensions, <i>etc.</i>) of all |
| <a href="Aggregate.html#components()">components</a> in the aggregate, or summarize them (for example by omitting |
| <a href="../metadata/iso/extent/DefaultExtent.html" title="class in org.apache.sis.metadata.iso.extent">extents</a> that are fully included in larger extents). |
| If this resource is a <a href="DataSet.html" title="interface in org.apache.sis.storage"><code>DataSet</code></a>, then the metadata shall contain only the information that apply to that |
| particular dataset, optionally with a reference to the parent metadata (see below). |
| |
| <p>Some relationships between metadata and resources are:</p> |
| <ul class="verbose"> |
| <li><code>metadata</code> / |
| <a href="../metadata/iso/DefaultMetadata.html#getParentMetadata()"><code>parentMetadata</code></a> / |
| <a href="../metadata/iso/citation/DefaultCitation.html#getTitle()"><code>title</code></a>:<br> |
| a human-readable caption for <a href="DataStore.html#getMetadata()"><code>DataStore.getMetadata()</code></a> (if not redundant with this metadata).</li> |
| <li><code>metadata</code> / |
| <a href="../metadata/iso/DefaultMetadata.html#getIdentificationInfo()"><code>identificationInfo</code></a> / |
| <a href="../metadata/iso/identification/AbstractIdentification.html#getCitation()"><code>citation</code></a> / |
| <a href="../metadata/iso/citation/DefaultCitation.html#getTitle()"><code>title</code></a>:<br> |
| a human-readable designation for this resource.</li> |
| <li><code>metadata</code> / |
| <a href="../metadata/iso/DefaultMetadata.html#getIdentificationInfo()"><code>identificationInfo</code></a> / |
| <a href="../metadata/iso/identification/AbstractIdentification.html#getAssociatedResources()"><code>associatedResource</code></a> / |
| <a href="../metadata/iso/identification/DefaultAssociatedResource.html#getName()"><code>name</code></a> / |
| <a href="../metadata/iso/citation/DefaultCitation.html#getTitle()"><code>title</code></a>:<br> |
| a human-readable designation for parent, children or other related resources. |
| May be omitted if too expensive to compute.</li> |
| <li><code>metadata</code> / |
| <a href="../metadata/iso/DefaultMetadata.html#getMetadataScopes()"><code>metadataScope</code></a> / |
| <a href="../metadata/iso/DefaultMetadataScope.html#getResourceScope()"><code>resourceScope</code></a>:<br> |
| <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/maintenance/ScopeCode.html#DATASET" title="class or interface in org.opengis.metadata.maintenance" class="external-link"><code>ScopeCode.DATASET</code></a> if the resource is a <a href="DataSet.html" title="interface in org.apache.sis.storage"><code>DataSet</code></a>, or |
| <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/maintenance/ScopeCode.html#SERVICE" title="class or interface in org.opengis.metadata.maintenance" class="external-link"><code>ScopeCode.SERVICE</code></a> if the resource is a web service, or |
| <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/maintenance/ScopeCode.html#SERIES" title="class or interface in org.opengis.metadata.maintenance" class="external-link"><code>ScopeCode.SERIES</code></a> or |
| <code>ScopeCode.INITIATIVE</code> |
| if the resource is an <a href="Aggregate.html" title="interface in org.apache.sis.storage"><code>Aggregate</code></a> other than a transfer aggregate.</li> |
| <li><code>metadata</code> / |
| <a href="../metadata/iso/DefaultMetadata.html#getContentInfo()"><code>contentInfo</code></a> / |
| <a href="../metadata/iso/content/DefaultFeatureCatalogueDescription.html#getFeatureTypeInfo()"><code>featureType</code></a> / |
| <a href="../metadata/iso/content/DefaultFeatureTypeInfo.html#getFeatureTypeName()"><code>featureTypeName</code></a>:<br> |
| names of feature types included in this resource. Example: “bridge”, “road”, “river”. <i>etc.</i></li> |
| <li><code>metadata</code> / |
| <a href="../metadata/iso/DefaultMetadata.html#getContentInfo()"><code>contentInfo</code></a> / |
| <a href="../metadata/iso/content/DefaultCoverageDescription.html#getAttributeGroups()"><code>attributeGroup</code></a> / |
| <a href="../metadata/iso/content/DefaultAttributeGroup.html#getAttributes()"><code>attribute</code></a> / |
| <a href="../metadata/iso/content/DefaultRangeDimension.html#getSequenceIdentifier()"><code>sequenceIdentifier</code></a>:<br> |
| sample dimension names (or band numbers in simpler cases) of coverages or rasters included in this resource.</li> |
| </ul> |
| |
| <h4>Metadata edition</h4> |
| This method often returns an <a href="../metadata/ModifiableMetadata.State.html#FINAL">unmodifiable</a> |
| metadata, for making possible to return efficiently a cached instance. |
| If the caller wants to modify some metadata elements, it may be necessary to perform a |
| <a href="../metadata/iso/DefaultMetadata.html#deepCopy(org.opengis.metadata.Metadata)">deep copy</a> first.</div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>information about this resource. Should not be <code>null</code>.</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 reading the metadata.</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list-long"> |
| <li><a href="DataStore.html#getMetadata()"><code>DataStore.getMetadata()</code></a></li> |
| <li><a href="../metadata/iso/DefaultMetadata.html#deepCopy(org.opengis.metadata.Metadata)"><code>DefaultMetadata.deepCopy(Metadata)</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="addListener(java.lang.Class,org.apache.sis.storage.event.StoreListener)"> |
| <h3>addListener</h3> |
| <div class="member-signature"><span class="type-parameters"><T extends <a href="event/StoreEvent.html" title="class in org.apache.sis.storage.event">StoreEvent</a>></span> <span class="return-type">void</span> <span class="element-name">addListener</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><T> eventType, |
| <a href="event/StoreListener.html" title="interface in org.apache.sis.storage.event">StoreListener</a><? super T> listener)</span></div> |
| <div class="block">Registers a listener to notify when the specified kind of event occurs in this resource or in children. |
| The resource will call the <a href="event/StoreListener.html#eventOccured(E)"><code>StoreListener.eventOccured(StoreEvent)</code></a> method when new events matching |
| the <code>eventType</code> occur. An event may be a change in resource content or structure, or a warning that |
| occurred during a read or write operation. |
| |
| <p>Registering a listener for a given <code>eventType</code> also register the listener for all event sub-types. |
| The same listener can be registered many times, but its <a href="event/StoreListener.html#eventOccured(E)"><code>StoreListener.eventOccured(StoreEvent)</code></a> |
| method will be invoked only once per event. This filtering applies even if the listener is registered |
| on different resources in the same tree, for example a parent and its children.</p> |
| |
| <p>If this resource may produce events of the given type, then the given listener is kept by strong reference; |
| it will not be garbage collected unless <a href="#removeListener(java.lang.Class,org.apache.sis.storage.event.StoreListener)">explicitly removed</a> |
| or unless this <code>Resource</code> is itself garbage collected. However if the given type of events can never |
| happen with this resource, then this method is not required to keep a reference to the given listener.</p> |
| |
| <h4>Warning events</h4> |
| If <code>eventType</code> is assignable from <code><a href="event/WarningEvent.html" title="class in org.apache.sis.storage.event">WarningEvent</a>.class</code>, |
| then registering that listener turns off logging of warning messages for this resource. |
| This side-effect is applied on the assumption that the registered listener will handle |
| warnings in its own way, for example by showing warnings in a widget.</div> |
| <dl class="notes"> |
| <dt>Type Parameters:</dt> |
| <dd><code>T</code> - compile-time value of the <code>eventType</code> argument.</dd> |
| <dt>Parameters:</dt> |
| <dd><code>eventType</code> - type of <a href="event/StoreEvent.html" title="class in org.apache.sis.storage.event"><code>StoreEvent</code></a>s to listen (cannot be <code>null</code>).</dd> |
| <dd><code>listener</code> - listener to notify about events.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="removeListener(java.lang.Class,org.apache.sis.storage.event.StoreListener)"> |
| <h3>removeListener</h3> |
| <div class="member-signature"><span class="type-parameters"><T extends <a href="event/StoreEvent.html" title="class in org.apache.sis.storage.event">StoreEvent</a>></span> <span class="return-type">void</span> <span class="element-name">removeListener</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><T> eventType, |
| <a href="event/StoreListener.html" title="interface in org.apache.sis.storage.event">StoreListener</a><? super T> listener)</span></div> |
| <div class="block">Unregisters a listener previously added to this resource for the given type of events. |
| The <code>eventType</code> must be the exact same class than the one given to the <code>addListener(…)</code> method; |
| this method does not remove listeners registered for subclasses and does not remove listeners registered in |
| parent resources. |
| |
| <p>If the same listener has been registered many times for the same even type, then this method removes only |
| the most recent registration. In other words if <code>addListener(type, ls)</code> has been invoked twice, then |
| <code>removeListener(type, ls)</code> needs to be invoked twice in order to remove all instances of that listener. |
| If the given listener is not found, then this method does nothing (no exception is thrown).</p> |
| |
| <h4>Warning events</h4> |
| If <code>eventType</code> is <code><a href="event/WarningEvent.html" title="class in org.apache.sis.storage.event">WarningEvent</a>.class</code> |
| and if, after this method invocation, there are no remaining listeners for warning events, |
| then this <code>Resource</code> will send future warnings to the loggers.</div> |
| <dl class="notes"> |
| <dt>Type Parameters:</dt> |
| <dd><code>T</code> - compile-time value of the <code>eventType</code> argument.</dd> |
| <dt>Parameters:</dt> |
| <dd><code>eventType</code> - type of <a href="event/StoreEvent.html" title="class in org.apache.sis.storage.event"><code>StoreEvent</code></a>s which were listened (cannot be <code>null</code>).</dd> |
| <dd><code>listener</code> - listener to stop notifying about events.</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> |