|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.sdsc.inca.repository.Repositories
public class Repositories
Provides convenience methods for dealing with a set of Inca reporter repositories. This object may keep its persistence by writing the list of repositories to file.
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_PATH
|
static java.lang.String |
DEPENDS_ATTR
|
static java.lang.String |
FILE_ATTR
|
static java.lang.String |
NAME_ATTR
|
static java.lang.String |
VERSION_ATTR
|
Constructor Summary | |
---|---|
Repositories()
Creates a Repositories object using the default repositories file to store its state. |
|
Repositories(java.lang.String filePath)
Creates a Repositories object using the provided filePath to read/save the list of repositories. |
Method Summary | |
---|---|
void |
addRepository(Repository repo)
Add a repository to the set. |
java.util.Properties[] |
getCatalog()
Returns an array of Properties, each of which specifies the attributes of one reporter from the Agent's reporter repositories. |
java.lang.String |
getFilePath()
Retrieve the path to the repositories file. |
java.lang.String |
getLatestVersionOfPackage(java.lang.String name)
Return the latest version available for the named package in any of the repositories. |
Repository[] |
getRepositories()
Returns the list of reporter repositories stored in the object. |
Repository |
getRepositoryForPackage(java.lang.String packageName,
java.lang.String version)
Return the repository that contains the specified package with the specified version. |
java.lang.String |
getRepositoryUrlForPackage(java.lang.String packageName,
java.lang.String version)
Translate the package name into a repository url. |
boolean |
hasPackageUpdated(java.lang.String name,
java.lang.String version)
Checks for a package update by iterating through all repositories and returns true if it finds a version of the package more recent than the specified one. |
void |
refresh()
Refresh the current catalog contents of all repositories. |
void |
removeRepository(java.lang.String baseURL)
Removes the repository with a particular URL from the set. |
protected void |
saveRepositories(java.lang.String filePath)
Writes the set of repository URLs to a specified file. |
void |
setFilePath(java.lang.String filePath)
Set the path to the repositories file. |
void |
setRepositories(Repository[] repos)
Set the repositories the agent should download reporters from upon receiving a suite (if it hasn't downloaded them before). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_PATH
public static final java.lang.String DEPENDS_ATTR
public static final java.lang.String FILE_ATTR
public static final java.lang.String NAME_ATTR
public static final java.lang.String VERSION_ATTR
Constructor Detail |
---|
public Repositories() throws java.io.IOException
java.io.IOException
public Repositories(java.lang.String filePath) throws java.io.IOException
filePath
- A path to a file containing newline delimited uris
to Inca reporter repositories; null for none
java.io.IOException
Method Detail |
---|
public void addRepository(Repository repo)
repo
- the repository to addpublic java.util.Properties[] getCatalog()
public java.lang.String getFilePath()
public java.lang.String getLatestVersionOfPackage(java.lang.String name)
name
- The name of the package to search for.
public Repository[] getRepositories()
public Repository getRepositoryForPackage(java.lang.String packageName, java.lang.String version)
packageName
- The name of the package we are looking for.version
- The version of the package we are looking for.
public java.lang.String getRepositoryUrlForPackage(java.lang.String packageName, java.lang.String version)
packageName
- A package name.
public boolean hasPackageUpdated(java.lang.String name, java.lang.String version)
public void refresh() throws java.io.IOException
java.io.IOException
public void removeRepository(java.lang.String baseURL)
baseURL
- the URL of the repository to removepublic void setFilePath(java.lang.String filePath) throws java.io.IOException
filePath
- A string containing the path to where the repositories
file can be read/stored.
java.io.IOException
- on write errorpublic void setRepositories(Repository[] repos) throws java.io.IOException
repos
- A list of repositories.
java.io.IOException
protected void saveRepositories(java.lang.String filePath) throws java.io.IOException
filePath
- the file to write
java.io.IOException
- on error
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |