public class AGCatalog extends Object
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.
AGServer.getCatalog(String)
Modifier and Type | Field and Description |
---|---|
static int |
NAMED_CATALOG |
static int |
ROOT_CATALOG |
Constructor and 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.
|
Modifier and Type | Method and 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()
Returns a List of repository ids contained in this catalog.
|
AGRepository |
openRepository(String repositoryID)
Returns an uninitialized AGRepository instance for the given
repository id . |
public static final int ROOT_CATALOG
getCatalogType()
,
Constant Field Valuespublic static final int NAMED_CATALOG
getCatalogType()
,
Constant Field Valuespublic AGCatalog(AGServer server, String catalogName)
server
- the server housing this named catalogcatalogName
- the name for this named catalogAGServer.getCatalog(String)
public AGCatalog(AGServer server, int catalogType)
server
- the server housing the catalogcatalogType
- the type of the special catalogAGServer.getCatalog()
public static boolean isRootID(String catalogID)
Currently null, the empty string, and "/" are all considered to identify the root catalog.
catalogID
- the name of the catalog to checkpublic AGServer getServer()
public String getCatalogName()
public int getCatalogType()
ROOT_CATALOG
or NAMED_CATALOG
public String getCatalogURL()
public String getRepositoriesURL()
public AGHTTPClient getHTTPClient()
public List<String> listRepositories() throws RDF4JException
RDF4JException
- if there is an error during the requestpublic boolean hasRepository(String repoId) throws RDF4JException
repoId
- name of the repository to lookupRDF4JException
- if repository does not exist
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.
public AGRepository createRepository(String repositoryID) throws RepositoryException
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.
repositoryID
- the id (the name) of the repositoryRepositoryException
- if there is an error while creating the repositorycreateRepository(String, boolean)
public AGRepository createRepository(String repositoryID, boolean strict) throws RepositoryException
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.
repositoryID
- the id (the name) of the repositorystrict
- if true and the repository already exists, throw an exceptionRepositoryException
- if there is an error while creating the repositorycreateRepository(String)
,
listRepositories()
,
openRepository(String)
public AGRepository openRepository(String repositoryID) throws RepositoryException
repository id
.
If the repository already exists, it is simply opened.
repositoryID
- the id (the name) of the repositoryRepositoryException
- if the repositoryID does not existcreateRepository(String, boolean)
public void deleteRepository(String repositoryID) throws RepositoryException
repository id
.repositoryID
- the name of the repository to deleteRepositoryException
- if there is an error while deleting the repositorylistRepositories()
Copyright © 2019 Franz Inc.. All rights reserved.