|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ResourceHost
An interface that represents locations where the artifacts can be downloaded.
Method Summary | |
---|---|
boolean |
checkPresence(Artifact artifact,
boolean knownOnly)
Checks if the Artifact is present on the resource host. |
Date |
download(Artifact artifact,
OutputStream dest)
Downloads the given artifact to the directory indicated. |
String |
getHostName()
Returns the hostname of the resource host. |
int |
getPriority()
Returns the priority of the resource host. |
URL |
getURL()
Returns the full host url. |
boolean |
isEnabled()
Return true if the resource host has been enabled. |
boolean |
isTrusted()
Returns true if the ResourceHost is considered trusted. |
void |
upload(Artifact artifact,
InputStream source)
Uploads the given file to the resource host as an artifact. |
Method Detail |
---|
Date download(Artifact artifact, OutputStream dest) throws IOException
The cachedir argument is the root cache directory, and the ResourceHost class is responsible for the creation of the directory structure of the group if nonexistent.
If the knownOnly argument is true, then only attempt download if the group is known to exist on this resource host.
artifact
- the artifact that is requested to be downloaded.dest
- The output stream where to write the downloaded content.
IOException
- if an IO related error occursvoid upload(Artifact artifact, InputStream source) throws IOException
artifact
- the artifact destination specification.source
- The input stream from where to read the content to be uploaded.
IOException
- if an IO related error occursboolean checkPresence(Artifact artifact, boolean knownOnly)
Performs a check to see if the artifact exists on the resource host. If knownOnly is set to true, then the implementation will only consult the knownGroups table, and if found there, it is considered found without checking at the resource host itself. If knownOnly is false, however, a connection will be established to the resource host and a check of the actual resource existence.
artifact
- the artifact for which the method checks its presence.knownOnly
- does not perform a remote connection, and instead lookup
the group table, and if not found there it will return false.
String getHostName()
This does not include any of the path, but does include any port number of this resource host.
URL getURL()
boolean isEnabled()
boolean isTrusted()
int getPriority()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |