Package org.eclipse.aether.internal.impl
Class DefaultUpdateCheckManager
java.lang.Object
org.eclipse.aether.internal.impl.DefaultUpdateCheckManager
- All Implemented Interfaces:
UpdateCheckManager,Service
@Singleton
@Named
public class DefaultUpdateCheckManager
extends Object
implements UpdateCheckManager, Service
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final Stringprivate static final Stringprivate static final org.slf4j.Loggerprivate static final String(package private) static final Objectprivate static final intprivate static final intprivate static final intprivate TrackingFileManagerprivate static final Stringprivate UpdatePolicyAnalyzer -
Constructor Summary
ConstructorsConstructorDescriptionDefaultUpdateCheckManager(TrackingFileManager trackingFileManager, UpdatePolicyAnalyzer updatePolicyAnalyzer) -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckArtifact(RepositorySystemSession session, UpdateCheck<Artifact, ArtifactTransferException> check) Checks whether an artifact has to be updated from a remote repository.voidcheckMetadata(RepositorySystemSession session, UpdateCheck<Metadata, MetadataTransferException> check) Checks whether metadata has to be updated from a remote repository.private FilegetArtifactTouchFile(File artifactFile) private static intgetCacheFlag(String error) private StringgetDataKey(File metadataFile) private StringgetDataKey(RemoteRepository repository) private StringgetError(Properties props, String key) private longgetLastUpdated(Properties props, String key) private FilegetMetadataTouchFile(File metadataFile) private StringgetRepoKey(RepositorySystemSession session, RemoteRepository repository) private intgetSessionState(RepositorySystemSession session) private StringgetTransferKey(RepositorySystemSession session, File metadataFile, RemoteRepository repository) private StringgetTransferKey(RepositorySystemSession session, RemoteRepository repository) private StringgetUpdateKey(RepositorySystemSession session, File file, RemoteRepository repository) private booleanhasErrors(Properties props) voidinitService(ServiceLocator locator) Provides the opportunity to initialize this service and to acquire other services for its operation from the locator.private booleanisAlreadyUpdated(RepositorySystemSession session, Object updateKey) private booleanisUpdatedRequired(RepositorySystemSession session, long lastModified, String policy) private ArtifactTransferExceptionnewException(String error, Artifact artifact, RemoteRepository repository) private MetadataTransferExceptionnewException(String error, Metadata metadata, RemoteRepository repository) private StringnormalizeRepoUrl(String url) private PropertiessetTrackingFileManager(TrackingFileManager trackingFileManager) private voidsetUpdated(RepositorySystemSession session, Object updateKey) setUpdatePolicyAnalyzer(UpdatePolicyAnalyzer updatePolicyAnalyzer) voidtouchArtifact(RepositorySystemSession session, UpdateCheck<Artifact, ArtifactTransferException> check) Updates the timestamp for the artifact contained in the update check.voidtouchMetadata(RepositorySystemSession session, UpdateCheck<Metadata, MetadataTransferException> check) Updates the timestamp for the metadata contained in the update check.private Properties
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
trackingFileManager
-
updatePolicyAnalyzer
-
UPDATED_KEY_SUFFIX
- See Also:
-
ERROR_KEY_SUFFIX
- See Also:
-
NOT_FOUND
- See Also:
-
SESSION_CHECKS
-
CONFIG_PROP_SESSION_STATE
- See Also:
-
STATE_ENABLED
private static final int STATE_ENABLED- See Also:
-
STATE_BYPASS
private static final int STATE_BYPASS- See Also:
-
STATE_DISABLED
private static final int STATE_DISABLED- See Also:
-
-
Constructor Details
-
DefaultUpdateCheckManager
public DefaultUpdateCheckManager() -
DefaultUpdateCheckManager
@Inject DefaultUpdateCheckManager(TrackingFileManager trackingFileManager, UpdatePolicyAnalyzer updatePolicyAnalyzer)
-
-
Method Details
-
initService
Description copied from interface:ServiceProvides the opportunity to initialize this service and to acquire other services for its operation from the locator. A service must not save the reference to the provided service locator.- Specified by:
initServicein interfaceService- Parameters:
locator- The service locator, must not benull.
-
setTrackingFileManager
-
setUpdatePolicyAnalyzer
-
checkArtifact
public void checkArtifact(RepositorySystemSession session, UpdateCheck<Artifact, ArtifactTransferException> check) Description copied from interface:UpdateCheckManagerChecks whether an artifact has to be updated from a remote repository.- Specified by:
checkArtifactin interfaceUpdateCheckManager- Parameters:
session- The repository system session during which the request is made, must not benull.check- The update check request, must not benull.
-
getCacheFlag
-
newException
private ArtifactTransferException newException(String error, Artifact artifact, RemoteRepository repository) -
checkMetadata
public void checkMetadata(RepositorySystemSession session, UpdateCheck<Metadata, MetadataTransferException> check) Description copied from interface:UpdateCheckManagerChecks whether metadata has to be updated from a remote repository.- Specified by:
checkMetadatain interfaceUpdateCheckManager- Parameters:
session- The repository system session during which the request is made, must not benull.check- The update check request, must not benull.
-
newException
private MetadataTransferException newException(String error, Metadata metadata, RemoteRepository repository) -
getLastUpdated
-
getError
-
getArtifactTouchFile
-
getMetadataTouchFile
-
getDataKey
-
getTransferKey
-
getDataKey
-
getTransferKey
private String getTransferKey(RepositorySystemSession session, File metadataFile, RemoteRepository repository) -
getRepoKey
-
normalizeRepoUrl
-
getUpdateKey
private String getUpdateKey(RepositorySystemSession session, File file, RemoteRepository repository) -
getSessionState
-
isAlreadyUpdated
-
setUpdated
-
isUpdatedRequired
private boolean isUpdatedRequired(RepositorySystemSession session, long lastModified, String policy) -
read
-
touchArtifact
public void touchArtifact(RepositorySystemSession session, UpdateCheck<Artifact, ArtifactTransferException> check) Description copied from interface:UpdateCheckManagerUpdates the timestamp for the artifact contained in the update check.- Specified by:
touchArtifactin interfaceUpdateCheckManager- Parameters:
session- The repository system session during which the request is made, must not benull.check- The update check request, must not benull.
-
hasErrors
-
touchMetadata
public void touchMetadata(RepositorySystemSession session, UpdateCheck<Metadata, MetadataTransferException> check) Description copied from interface:UpdateCheckManagerUpdates the timestamp for the metadata contained in the update check.- Specified by:
touchMetadatain interfaceUpdateCheckManager- Parameters:
session- The repository system session during which the request is made, must not benull.check- The update check request, must not benull.
-
write
-