Package org.eclipse.rdf4j.sail.helpers

## Class NotifyingSailWrapper

- java.lang.Object
- - org.eclipse.rdf4j.sail.helpers.SailWrapper
  - - org.eclipse.rdf4j.sail.helpers.NotifyingSailWrapper

- All Implemented Interfaces:
    `FederatedServiceResolverClient`, `NotifyingSail`, `Sail`, `StackableSail`
  Direct Known Subclasses:
    `AbstractForwardChainingInferencer`, `CustomGraphQueryInferencer`, `DedupingInferencer`, `DirectTypeHierarchyInferencer`, `LuceneSail`, `SchemaCachingRDFSInferencer`, `ShaclSail`

      public class NotifyingSailWrapper
      extends SailWrapper
      implements NotifyingSail

  An implementation of the StackableSail interface that wraps another Sail object and forwards any relevant calls to the wrapped Sail.
  Author:
    Arjohn Kampman

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `NotifyingSailWrapper()` | Creates a new SailWrapper.
    `NotifyingSailWrapper​(NotifyingSail baseSail)` | Creates a new SailWrapper that wraps the supplied Sail.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addSailChangedListener​(SailChangedListener listener)` | Adds the specified SailChangedListener to receive events when the data in this Sail object changes.
    `NotifyingSail` | `getBaseSail()` | Gets the base Sail that this Sail works on top of.
    `NotifyingSailConnection` | `getConnection()` | Opens a connection on the Sail which can be used to query and update data.
    `void` | `removeSailChangedListener​(SailChangedListener listener)` | Removes the specified SailChangedListener so that it no longer receives events from this Sail object.
    `void` | `setBaseSail​(Sail baseSail)` | Sets the base Sail that this Sail will work on top of.

    - ### Methods inherited from class org.eclipse.rdf4j.sail.helpers.SailWrapper

      `getDataDir, getDefaultIsolationLevel, getSupportedIsolationLevels, getValueFactory, init, isWritable, setDataDir, setFederatedServiceResolver, shutDown, verifyBaseSailSet`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.eclipse.rdf4j.sail.Sail

      `getDataDir, getDefaultIsolationLevel, getSupportedIsolationLevels, getValueFactory, init, isWritable, setDataDir, shutDown`

- - ### Constructor Detail

    - #### NotifyingSailWrapper

          public NotifyingSailWrapper()

      Creates a new SailWrapper. The base Sail for the created SailWrapper can be set later using `setBaseSail(org.eclipse.rdf4j.sail.Sail)`.

    - #### NotifyingSailWrapper

          public NotifyingSailWrapper​(NotifyingSail baseSail)

      Creates a new SailWrapper that wraps the supplied Sail.

  - ### Method Detail

    - #### setBaseSail

          public void setBaseSail​(Sail baseSail)

      Description copied from interface: `StackableSail`
      Sets the base Sail that this Sail will work on top of. This method will be called before the initialize() method is called.
      Specified by:
        `setBaseSail` in interface `StackableSail`
      Overrides:
        `setBaseSail` in class `SailWrapper`

    - #### getBaseSail

          public NotifyingSail getBaseSail()

      Description copied from interface: `StackableSail`
      Gets the base Sail that this Sail works on top of.
      Specified by:
        `getBaseSail` in interface `StackableSail`
      Overrides:
        `getBaseSail` in class `SailWrapper`

    - #### getConnection

          public NotifyingSailConnection getConnection()
                                                throws SailException

      Description copied from interface: `Sail`
      Opens a connection on the Sail which can be used to query and update data. Depending on how the implementation handles concurrent access, a call to this method might block when there is another open connection on this Sail.
      Specified by:
        `getConnection` in interface `NotifyingSail`
      Specified by:
        `getConnection` in interface `Sail`
      Overrides:
        `getConnection` in class `SailWrapper`
      Throws:
        `SailException` - If no transaction could be started, for example because the Sail is not writable.

    - #### addSailChangedListener

          public void addSailChangedListener​(SailChangedListener listener)

      Description copied from interface: `NotifyingSail`
      Adds the specified SailChangedListener to receive events when the data in this Sail object changes.
      Specified by:
        `addSailChangedListener` in interface `NotifyingSail`

    - #### removeSailChangedListener

          public void removeSailChangedListener​(SailChangedListener listener)

      Description copied from interface: `NotifyingSail`
      Removes the specified SailChangedListener so that it no longer receives events from this Sail object.
      Specified by:
        `removeSailChangedListener` in interface `NotifyingSail`