Package org.eclipse.rdf4j.federated.endpoint

## Interface Endpoint

- All Known Implementing Classes:
    `EndpointBase`, `ManagedRepositoryEndpoint`, `RepositoryEndpoint`, `ResolvableEndpoint`

      public interface Endpoint

  Structure to maintain endpoint information, e.g. `Repository` type, location.

  The `Repository` to use can be obtained by calling `getRepository()`

  A `RepositoryConnection` for interacting with the store can be obtained using `getConnection()`. Note that typically the `TripleSource` of the endpoint should be used.

  Author:
    Andreas Schwarte
  See Also:
    `ManagedRepositoryEndpoint`, `RepositoryEndpoint`, `ResolvableEndpoint`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `RepositoryConnection` | `getConnection()` | Return a `RepositoryConnection` for the `Repository` represented by this endpoint.
    `String` | `getEndpoint()` | Get the endpoint location, e.g.
    `EndpointClassification` | `getEndpointClassification()` |
    `EndpointConfiguration` | `getEndpointConfiguration()` | Additional endpoint specific configuration.
    `String` | `getId()` |
    `String` | `getName()` |
    `Repository` | `getRepository()` |
    `TripleSource` | `getTripleSource()` |
    `void` | `init​(FederationContext federationContext)` | Initialize this `Endpoint`
    `boolean` | `isInitialized()` |
    `boolean` | `isWritable()` |
    `void` | `shutDown()` | Shutdown this `Endpoint`
    `long` | `size()` | Returns the size of the given repository, i.e.

- - ### Method Detail

    - #### getRepository

          Repository getRepository()

      Returns:
        the initialized `Repository`

    - #### getConnection

          RepositoryConnection getConnection()

      Return a `RepositoryConnection` for the `Repository` represented by this endpoint.

      Callers of this method need to ensure to close the connection after use.

      Typical pattern:

           try (RepositoryConnection conn = endpoint.getConnection()) {
                  // do something with the connection
           }

      If the `RepositoryConnection` needs to stay open outside the scope of a method (e.g. for streaming results), consider using `CloseDependentConnectionIteration`.

      Returns:
        the repository connection
      Throws:
        `RepositoryException` - if the repository is not initialized

    - #### getTripleSource

          TripleSource getTripleSource()

      Returns:
        the `TripleSource`

    - #### getEndpointClassification

          EndpointClassification getEndpointClassification()

      Returns:
        the `EndpointClassification`

    - #### isWritable

          boolean isWritable()

      Returns:
        whether this endpoint is writable

    - #### getId

          String getId()

      Returns:
        the identifier of the federation member

    - #### getName

          String getName()

      Returns:
        the name of the federation member

    - #### getEndpoint

          String getEndpoint()

      Get the endpoint location, e.g. for SPARQL endpoints the url
      Returns:
        the endpoint location

    - #### size

          long size()
             throws RepositoryException

      Returns the size of the given repository, i.e. the number of triples.
      Returns:
        the size of the endpoint
      Throws:
        `RepositoryException`

    - #### init

          void init​(FederationContext federationContext)
             throws RepositoryException

      Initialize this `Endpoint`
      Parameters:
        `federationContext` -
      Throws:
        `RepositoryException`

    - #### shutDown

          void shutDown()
                 throws RepositoryException

      Shutdown this `Endpoint`
      Throws:
        `RepositoryException`

    - #### isInitialized

          boolean isInitialized()

      Returns:
        whether this Endpoint is initialized

    - #### getEndpointConfiguration

          EndpointConfiguration getEndpointConfiguration()

      Additional endpoint specific configuration.
      Returns:
        the endpointConfiguration