org.eclipse.rdf4j.federated.write

## Interface WriteStrategy

- All Superinterfaces:
    AutoCloseable
  All Known Implementing Classes:
    ReadOnlyWriteStrategy, RepositoryWriteStrategy

      @Experimental
      public interface WriteStrategy
      extends AutoCloseable

  Interface for the `WriteStrategy` that is used for writing data to the federation. The implementation can decided upon how is data written to the underlying federation members (e.g. to a designated federation member)

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

  Author:
    Andreas Schwarte
  See Also:
    `RepositoryWriteStrategy`, `ReadOnlyWriteStrategy`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and 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.

- - ### Method Detail

    - #### close

          void close()
              throws RepositoryException

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

    - #### setTransactionSettings

          void setTransactionSettings(TransactionSetting... transactionSettings)
                               throws RepositoryException

      Assign `TransactionSetting`s to be used for the next transaction.
      Parameters:
        `transactionSettings` - one or more `TransactionSetting`s
      Throws:
        `RepositoryException`

    - #### begin

          void begin()
              throws RepositoryException

      Begin a transaction.
      Throws:
        `RepositoryException`

    - #### commit

          void commit()
               throws RepositoryException

      Commit a transaction.
      Throws:
        `RepositoryException`

    - #### rollback

          void rollback()
                 throws RepositoryException

      Rollback a transaction.
      Throws:
        `RepositoryException`

    - #### addStatement

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

      Add a statement
      Parameters:
        `subj` -
        `pred` -
        `obj` -
        `contexts` -
      Throws:
        `RepositoryException`

    - #### removeStatement

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

      Remove a statement
      Parameters:
        `subj` -
        `pred` -
        `obj` -
        `contexts` -
      Throws:
        `RepositoryException`

    - #### clear

          void clear(Resource... contexts)
              throws RepositoryException

      Throws:
        `RepositoryException`

    - #### clearNamespaces

          void clearNamespaces()
                        throws RepositoryException

      Throws:
        `RepositoryException`

Copyright © 2015-2022 Eclipse Foundation. All Rights Reserved.