net.dpml.transit
Interface Monitor


public interface Monitor

Transit event monitor.

Version:
2.1.0
Author:
Digital Product Management Library

Method Summary
 void addedToLocalCache(URL resource, File localFile)
          Notify the monitor that an artifact has been added to the local cache.
 void failedDownload(Artifact artifact)
          Notify the monitor of a failed download attempt.
 void failedDownloadFromHost(String host, Artifact artifact, Throwable cause)
          Notify the monitor of a failed download attempt relative to an identified host.
 void notifyCompletion(URL resource)
          Notify the monitor of the successful completion of a download process.
 void notifyUpdate(URL resource, int expected, int count)
          Notify the monitor of the update in the download status.
 void removedFromLocalCache(URL resource, File localFile)
          Notify the monitor that an artifact has been removed from the local cache.
 void resourceRequested(Artifact artifact)
          Notify the monitor that an artifact has been requested.
 void updatedLocalCache(URL resource, File localFile)
          Notify the monitor that an artifact in the local cache has been updated.
 

Method Detail

resourceRequested

void resourceRequested(Artifact artifact)
Notify the monitor that an artifact has been requested.

Parameters:
artifact - the requested artifact

addedToLocalCache

void addedToLocalCache(URL resource,
                       File localFile)
Notify the monitor that an artifact has been added to the local cache.

Parameters:
resource - the url of the resource added to the local cache
localFile - the local file resident in the cache

updatedLocalCache

void updatedLocalCache(URL resource,
                       File localFile)
Notify the monitor that an artifact in the local cache has been updated.

Parameters:
resource - the url of the resource updating the local cache
localFile - the local file that has been updated

removedFromLocalCache

void removedFromLocalCache(URL resource,
                           File localFile)
Notify the monitor that an artifact has been removed from the local cache.

Parameters:
resource - the url of the resource removed from the local cache
localFile - the local file removed from the cache

failedDownloadFromHost

void failedDownloadFromHost(String host,
                            Artifact artifact,
                            Throwable cause)
Notify the monitor of a failed download attempt relative to an identified host.

Parameters:
host - the host raising the fail status
artifact - the requested artifact
cause - the exception causing the failure

failedDownload

void failedDownload(Artifact artifact)
Notify the monitor of a failed download attempt.

Parameters:
artifact - the requested artifact

notifyUpdate

void notifyUpdate(URL resource,
                  int expected,
                  int count)
Notify the monitor of the update in the download status.

Parameters:
resource - the name of the remote resource being downloaded.
expected - the expected number of bytes to be downloaded.
count - the number of bytes downloaded.

notifyCompletion

void notifyCompletion(URL resource)
Notify the monitor of the successful completion of a download process.

Parameters:
resource - the name of the remote resource.