Package org.eclipse.rdf4j.federated.write

## Class RepositoryWriteStrategy

- java.lang.Object
- - org.eclipse.rdf4j.federated.write.RepositoryWriteStrategy

- All Implemented Interfaces:
    `AutoCloseable`, `WriteStrategy`

      public class RepositoryWriteStrategy
      extends Object
      implements WriteStrategy

  A `WriteStrategy` to write to a designated `Repository`. This write strategy opens a fresh `RepositoryConnection` and keeps this until a call of `close()`.

  Note: this is an experimental feature which is subject to change in a future version.

  Author:
    Andreas Schwarte
  See Also:
    `WriteStrategy`

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `RepositoryWriteStrategy​(Repository writeRepository)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addStatement​(Resource subj, IRI pred, Value obj, Resource... contexts)` | Add a statement
    `void` | `begin()` | Begin a transaction.
    `void` | `clear​(Resource... contexts)` |
    `void` | `clearNamespaces()` |
    `void` | `close()` | Close this write strategy (e.g.
    `void` | `commit()` | Commit a transaction.
    `void` | `removeStatement​(Resource subj, IRI pred, Value obj, Resource... contexts)` | Remove a statement
    `void` | `rollback()` | Rollback a transaction.
    `void` | `setTransactionSettings​(TransactionSetting... transactionSettings)` | Assign `TransactionSetting`s to be used for the next transaction.

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

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

- - ### Constructor Detail

    - #### RepositoryWriteStrategy

          public RepositoryWriteStrategy​(Repository writeRepository)

  - ### Method Detail

    - #### close

          public void close()
                     throws RepositoryException

      Description copied from interface: `WriteStrategy`
      Close this write strategy (e.g. close a shared `RepositoryException`).
      Specified by:
        `close` in interface `AutoCloseable`
      Specified by:
        `close` in interface `WriteStrategy`
      Throws:
        `RepositoryException`

    - #### begin

          public void begin()
                     throws RepositoryException

      Description copied from interface: `WriteStrategy`
      Begin a transaction.
      Specified by:
        `begin` in interface `WriteStrategy`
      Throws:
        `RepositoryException`

    - #### commit

          public void commit()
                      throws RepositoryException

      Description copied from interface: `WriteStrategy`
      Commit a transaction.
      Specified by:
        `commit` in interface `WriteStrategy`
      Throws:
        `RepositoryException`

    - #### rollback

          public void rollback()
                        throws RepositoryException

      Description copied from interface: `WriteStrategy`
      Rollback a transaction.
      Specified by:
        `rollback` in interface `WriteStrategy`
      Throws:
        `RepositoryException`

    - #### addStatement

          public void addStatement​(Resource subj,
                                   IRI pred,
                                   Value obj,
                                   Resource... contexts)
                            throws RepositoryException

      Description copied from interface: `WriteStrategy`
      Add a statement
      Specified by:
        `addStatement` in interface `WriteStrategy`
      Throws:
        `RepositoryException`

    - #### removeStatement

          public void removeStatement​(Resource subj,
                                      IRI pred,
                                      Value obj,
                                      Resource... contexts)
                               throws RepositoryException

      Description copied from interface: `WriteStrategy`
      Remove a statement
      Specified by:
        `removeStatement` in interface `WriteStrategy`
      Throws:
        `RepositoryException`

    - #### clear

          public void clear​(Resource... contexts)
                     throws RepositoryException

      Specified by:
        `clear` in interface `WriteStrategy`
      Throws:
        `RepositoryException`

    - #### clearNamespaces

          public void clearNamespaces()
                               throws RepositoryException

      Specified by:
        `clearNamespaces` in interface `WriteStrategy`
      Throws:
        `RepositoryException`

    - #### setTransactionSettings

          public void setTransactionSettings​(TransactionSetting... transactionSettings)
                                      throws RepositoryException

      Description copied from interface: `WriteStrategy`
      Assign `TransactionSetting`s to be used for the next transaction.
      Specified by:
        `setTransactionSettings` in interface `WriteStrategy`
      Parameters:
        `transactionSettings` - one or more `TransactionSetting`s
      Throws:
        `RepositoryException`