org.sonatype.aether.impl
Interface UpdateCheckManager

All Known Implementing Classes:
DefaultUpdateCheckManager

public interface UpdateCheckManager

Determines if updates of artifacts and metadata from remote repositories are needed.

Author:
Benjamin Bentmann

Method Summary
 void checkArtifact(RepositorySystemSession session, UpdateCheck<Artifact,ArtifactTransferException> check)
          Checks whether an artifact has to be updated from a remote repository.
 void checkMetadata(RepositorySystemSession session, UpdateCheck<Metadata,MetadataTransferException> check)
          Checks whether metadata has to be updated from a remote repository.
 java.lang.String getEffectiveUpdatePolicy(RepositorySystemSession session, java.lang.String policy1, java.lang.String policy2)
          Returns the policy with the shorter update interval.
 boolean isUpdatedRequired(RepositorySystemSession session, long lastModified, java.lang.String policy)
          Determines whether the specified modification timestamp satisfies the freshness constraint expressed by the given update policy.
 void touchArtifact(RepositorySystemSession session, UpdateCheck<Artifact,ArtifactTransferException> check)
          Updates the timestamp for the artifact contained in the update check.
 void touchMetadata(RepositorySystemSession session, UpdateCheck<Metadata,MetadataTransferException> check)
          Updates the timestamp for the metadata contained in the update check.
 

Method Detail

getEffectiveUpdatePolicy

java.lang.String getEffectiveUpdatePolicy(RepositorySystemSession session,
                                          java.lang.String policy1,
                                          java.lang.String policy2)
Returns the policy with the shorter update interval.

Parameters:
session - The repository system session during which the request is made, must not be null.
policy1 - A policy to compare, may be null.
policy2 - A policy to compare, may be null.
Returns:
The policy with the shorter update interval.

isUpdatedRequired

boolean isUpdatedRequired(RepositorySystemSession session,
                          long lastModified,
                          java.lang.String policy)
Determines whether the specified modification timestamp satisfies the freshness constraint expressed by the given update policy.

Parameters:
session - The repository system session during which the check is made, must not be null.
lastModified - The timestamp to check against the update policy.
policy - The update policy, may be null.
Returns:
true if the specified timestamp is older than acceptable by the update policy, false otherwise.

checkArtifact

void checkArtifact(RepositorySystemSession session,
                   UpdateCheck<Artifact,ArtifactTransferException> check)
Checks whether an artifact has to be updated from a remote repository.

Parameters:
session - The repository system session during which the request is made, must not be null.
check - The update check request, must not be null.

touchArtifact

void touchArtifact(RepositorySystemSession session,
                   UpdateCheck<Artifact,ArtifactTransferException> check)
Updates the timestamp for the artifact contained in the update check.

Parameters:
session - The repository system session during which the request is made, must not be null.
check - The update check request, must not be null.

checkMetadata

void checkMetadata(RepositorySystemSession session,
                   UpdateCheck<Metadata,MetadataTransferException> check)
Checks whether metadata has to be updated from a remote repository.

Parameters:
session - The repository system session during which the request is made, must not be null.
check - The update check request, must not be null.

touchMetadata

void touchMetadata(RepositorySystemSession session,
                   UpdateCheck<Metadata,MetadataTransferException> check)
Updates the timestamp for the metadata contained in the update check.

Parameters:
session - The repository system session during which the request is made, must not be null.
check - The update check request, must not be null.


Copyright © 2010 Sonatype, Inc.. All Rights Reserved.