Class AGCatalog
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:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreates an AGCatalog instance for a special catalog in the given server, such as the root catalog.Creates an AGCatalog instance for a named catalog having catalogName in the given server. -
Method Summary
Modifier and TypeMethodDescriptioncreateRepository
(String repositoryID) Returns anuninitialized
AGRepository instance for the givenrepository id
.createRepository
(String repositoryID, boolean strict) Returns anuninitialized
AGRepository instance for the givenrepository id
.void
deleteRepository
(String repositoryID) Deletes the repository with the givenrepository id
.The name of this catalog.int
The type of this catalog.URL of this catalog.URL for accessing the repositories of this catalog.getRepositoryURL
(String repositoryID) The AGServer instance for this catalog.boolean
hasRepository
(String repoId) Returns true if the repository id is contained in this catalog.static boolean
Returns true iff the id identifies the root catalog.openRepository
(String repositoryID) Returns an uninitialized AGRepository instance for the givenrepository id
.
-
Field Details
-
ROOT_CATALOG
public static final int ROOT_CATALOG- See Also:
-
NAMED_CATALOG
public static final int NAMED_CATALOG- See Also:
-
ROOT_CATALOG_NAME
- See Also:
-
-
Constructor Details
-
AGCatalog
Creates an AGCatalog instance for a named catalog having catalogName in the given server.- Parameters:
server
- the server housing this named catalogcatalogName
- the name for this named catalog- See Also:
-
AGCatalog
Creates an AGCatalog instance for a special catalog in the given server, such as the root catalog.- Parameters:
server
- the server housing the catalogcatalogType
- the type of the special catalog- See Also:
-
-
Method Details
-
isRootID
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
The AGServer instance for this catalog.- Returns:
- the AGServer instance for this catalog
-
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
orNAMED_CATALOG
-
getCatalogURL
URL of this catalog.- Returns:
- the URL of this catalog
-
getRepositoriesURL
URL for accessing the repositories of this catalog.- Returns:
- the URL for accessing the repositories of this catalog
-
getRepositoryURL
-
getHTTPClient
-
listRepositories
- Returns:
- a List of repository ids contained in this catalog
-
hasRepository
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
Returns anuninitialized
AGRepository instance for the givenrepository 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:
RepositoryException
- if there is an error while creating the repository- See Also:
-
createRepository
public AGRepository createRepository(String repositoryID, boolean strict) throws RepositoryException Returns anuninitialized
AGRepository instance for the givenrepository 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 repositorystrict
- if true and the repository already exists, throw an exception- Returns:
- an uninitialized AGRepository instance
- Throws:
RepositoryException
- if there is an error while creating the repository- See Also:
-
openRepository
Returns an uninitialized AGRepository instance for the givenrepository 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:
RepositoryException
- if the repositoryID does not exist- See Also:
-
deleteRepository
Deletes the repository with the givenrepository id
.- Parameters:
repositoryID
- the name of the repository to delete- Throws:
RepositoryException
- if there is an error while deleting the repository- See Also:
-