AGCatalog (agraph-java-client 5.0.4-SNAPSHOT API)
Description: declaration: package: com.franz.agraph.repository, class: AGCatalog

Package com.franz.agraph.repository

# Class AGCatalog

java.lang.Object
com.franz.agraph.repository.AGCatalog

public class AGCatalog extends Object
Catalogs are locations on disk where AllegroGraph Server keeps its repositories.

Catalogs are created by the catalog server configuration.

A catalog is a grouping of repositories. The root catalog is the default, unnamed catalog that is available with every server. It is also possible to create any number of named catalogs.

See Also:
  - `AGServer.getCatalog(String)`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `NAMED_CATALOG`
  `static final int`
  `ROOT_CATALOG`
  `static final String`
  `ROOT_CATALOG_NAME`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AGCatalog(AGServer server, int catalogType)`
  Creates an AGCatalog instance for a special catalog in the given server, such as the root catalog.
  `AGCatalog(AGServer server, String catalogName)`
  Creates an AGCatalog instance for a named catalog having catalogName in the given server.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `AGRepository`
  `createRepository(String repositoryID)`
  Returns an `uninitialized` AGRepository instance for the given `repository id`.
  `AGRepository`
  `createRepository(String repositoryID, boolean strict)`
  Returns an `uninitialized` AGRepository instance for the given `repository id`.
  `void`
  `deleteRepository(String repositoryID)`
  Deletes the repository with the given `repository id`.
  `String`
  `getCatalogName()`
  The name of this catalog.
  `int`
  `getCatalogType()`
  The type of this catalog.
  `String`
  `getCatalogURL()`
  URL of this catalog.
  `AGHTTPClient`
  `getHTTPClient()`
  `String`
  `getRepositoriesURL()`
  URL for accessing the repositories of this catalog.
  `String`
  `getRepositoryURL(String repositoryID)`
  `AGServer`
  `getServer()`
  The AGServer instance for this catalog.
  `boolean`
  `hasRepository(String repoId)`
  Returns true if the repository id is contained in this catalog.
  `static boolean`
  `isRootID(String catalogID)`
  Returns true iff the id identifies the root catalog.
  `List<String>`
  `listRepositories()`
  `AGRepository`
  `openRepository(String repositoryID)`
  Returns an uninitialized AGRepository instance for the given `repository id`.

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

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

- ## Field Details

  - ### ROOT_CATALOG

    public static final int ROOT_CATALOG
    See Also:
      - `getCatalogType()`
      - Constant Field Values

  - ### NAMED_CATALOG

    public static final int NAMED_CATALOG
    See Also:
      - `getCatalogType()`
      - Constant Field Values

  - ### ROOT_CATALOG_NAME

    public static final String ROOT_CATALOG_NAME
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### AGCatalog

    public AGCatalog(AGServer server, String catalogName)
    Creates an AGCatalog instance for a named catalog having catalogName in the given server.
    Parameters:
      `server` - the server housing this named catalog
      `catalogName` - the name for this named catalog
    See Also:
      - `AGServer.getCatalog(String)`

  - ### AGCatalog

    public AGCatalog(AGServer server, int catalogType)
    Creates an AGCatalog instance for a special catalog in the given server, such as the root catalog.
    Parameters:
      `server` - the server housing the catalog
      `catalogType` - the type of the special catalog
    See Also:
      - `AGServer.getCatalog()`

- ## Method Details

  - ### isRootID

    public static boolean isRootID(String catalogID)
    Returns true iff the id identifies the root catalog.

    Currently null, the empty string, and "/" are all considered to identify the root catalog.

    Parameters:
      `catalogID` - the name of the catalog to check
    Returns:
      true iff the id identifies the root catalog

  - ### getServer

    public AGServer getServer()
    The AGServer instance for this catalog.
    Returns:
      the AGServer instance for this catalog

  - ### getCatalogName

    public String getCatalogName()
    The name of this catalog. The root catalog has the name "/".
    Returns:
      the name of this catalog

  - ### getCatalogType

    public int getCatalogType()
    The type of this catalog.
    Returns:
      the type of this catalog, `ROOT_CATALOG` or `NAMED_CATALOG`

  - ### getCatalogURL

    public String getCatalogURL()
    URL of this catalog.
    Returns:
      the URL of this catalog

  - ### getRepositoriesURL

    public String getRepositoriesURL()
    URL for accessing the repositories of this catalog.
    Returns:
      the URL for accessing the repositories of this catalog

  - ### getRepositoryURL

    public String getRepositoryURL(String repositoryID)

  - ### getHTTPClient

    public AGHTTPClient getHTTPClient()

  - ### listRepositories

    public List<String> listRepositories()
    Returns:
      a List of repository ids contained in this catalog

  - ### hasRepository

    public boolean hasRepository(String repoId)
    Returns true if the repository id is contained in this catalog.
    Parameters:
      `repoId` - name of the repository to lookup
    Returns:
      true if the repository id is contained in this catalog TODO: revisit the decision to throw instead of returning null if does not exit. Why throw?

      TODO: have this throw a RepositoryException instead, either by modifying contains() or catching and rethrowing here.

  - ### createRepository

    public AGRepository createRepository(String repositoryID) throws org.eclipse.rdf4j.repository.RepositoryException
    Returns an `uninitialized` AGRepository instance for the given `repository id`.

    The repository is created if it does not exist. If the repository already exists, it is simply opened.

    Parameters:
      `repositoryID` - the id (the name) of the repository
    Returns:
      an uninitialized AGRepository instance
    Throws:
      `org.eclipse.rdf4j.repository.RepositoryException` - if there is an error while creating the repository
    See Also:
      - `createRepository(String, boolean)`

  - ### createRepository

    public AGRepository createRepository(String repositoryID, boolean strict) throws org.eclipse.rdf4j.repository.RepositoryException
    Returns an `uninitialized` AGRepository instance for the given `repository id`.

    The repository is created if it does not exist. If the repository already exists, it is simply opened, or an exception is thrown if strict=true.

    Parameters:
      `repositoryID` - the id (the name) of the repository
      `strict` - if true and the repository already exists, throw an exception
    Returns:
      an uninitialized AGRepository instance
    Throws:
      `org.eclipse.rdf4j.repository.RepositoryException` - if there is an error while creating the repository
    See Also:
      - `createRepository(String)`
      - `listRepositories()`
      - `openRepository(String)`

  - ### openRepository

    public AGRepository openRepository(String repositoryID) throws org.eclipse.rdf4j.repository.RepositoryException
    Returns an uninitialized AGRepository instance for the given `repository id`.

    If the repository already exists, it is simply opened.

    Parameters:
      `repositoryID` - the id (the name) of the repository
    Returns:
      an uninitialized AGRepository instance
    Throws:
      `org.eclipse.rdf4j.repository.RepositoryException` - if the repositoryID does not exist
    See Also:
      - `createRepository(String, boolean)`

  - ### deleteRepository

    public void deleteRepository(String repositoryID) throws org.eclipse.rdf4j.repository.RepositoryException
    Deletes the repository with the given `repository id`.
    Parameters:
      `repositoryID` - the name of the repository to delete
    Throws:
      `org.eclipse.rdf4j.repository.RepositoryException` - if there is an error while deleting the repository
    See Also:
      - `listRepositories()`