Package org.eclipse.aether.internal.impl
Class DefaultUpdateCheckManager
java.lang.Object
org.eclipse.aether.internal.impl.DefaultUpdateCheckManager
- All Implemented Interfaces:
UpdateCheckManager
,Service
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final String
private static final String
private static final org.slf4j.Logger
private static final String
private static final String
private static final int
private static final int
private static final int
private static final String
private UpdatePolicyAnalyzer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.private static int
getCacheFlag
(String error) private String
getDataKey
(Artifact artifact, File artifactFile, RemoteRepository repository) private String
getDataKey
(Metadata metadata, File metadataFile, RemoteRepository repository) private String
getError
(Properties props, String key) private long
getLastUpdated
(Properties props, String key) private String
getRepoKey
(RepositorySystemSession session, RemoteRepository repository) private int
getSessionState
(RepositorySystemSession session) private File
getTouchFile
(Artifact artifact, File artifactFile) private File
getTouchFile
(Metadata metadata, File metadataFile) private String
getTransferKey
(RepositorySystemSession session, Artifact artifact, File artifactFile, RemoteRepository repository) private String
getTransferKey
(RepositorySystemSession session, Metadata metadata, File metadataFile, RemoteRepository repository) private String
getUpdateKey
(RepositorySystemSession session, File file, RemoteRepository repository) private boolean
hasErrors
(Properties props) void
initService
(ServiceLocator locator) Provides the opportunity to initialize this service and to acquire other services for its operation from the locator.private boolean
isAlreadyUpdated
(RepositorySystemSession session, Object updateKey) private boolean
isUpdatedRequired
(RepositorySystemSession session, long lastModified, String policy) private ArtifactTransferException
newException
(String error, Artifact artifact, RemoteRepository repository) private MetadataTransferException
newException
(String error, Metadata metadata, RemoteRepository repository) private String
normalizeRepoUrl
(String url) private Properties
private void
setUpdated
(RepositorySystemSession session, Object updateKey) setUpdatePolicyAnalyzer
(UpdatePolicyAnalyzer updatePolicyAnalyzer) 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.private Properties
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
updatePolicyAnalyzer
-
UPDATED_KEY_SUFFIX
- See Also:
-
ERROR_KEY_SUFFIX
- See Also:
-
NOT_FOUND
- See Also:
-
SESSION_CHECKS
- See Also:
-
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
-
-
Method Details
-
initService
Description copied from interface:Service
Provides 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:
initService
in interfaceService
- Parameters:
locator
- The service locator, must not benull
.
-
setUpdatePolicyAnalyzer
-
checkArtifact
public void checkArtifact(RepositorySystemSession session, UpdateCheck<Artifact, ArtifactTransferException> check) Description copied from interface:UpdateCheckManager
Checks whether an artifact has to be updated from a remote repository.- Specified by:
checkArtifact
in 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:UpdateCheckManager
Checks whether metadata has to be updated from a remote repository.- Specified by:
checkMetadata
in 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
-
getTouchFile
-
getTouchFile
-
getDataKey
-
getTransferKey
private String getTransferKey(RepositorySystemSession session, Artifact artifact, File artifactFile, RemoteRepository repository) -
getDataKey
-
getTransferKey
private String getTransferKey(RepositorySystemSession session, Metadata metadata, 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:UpdateCheckManager
Updates the timestamp for the artifact contained in the update check.- Specified by:
touchArtifact
in 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:UpdateCheckManager
Updates the timestamp for the metadata contained in the update check.- Specified by:
touchMetadata
in 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
-