Package org.eclipse.aether.resolution
Class MetadataRequest
- java.lang.Object
-
- org.eclipse.aether.resolution.MetadataRequest
-
public final class MetadataRequest extends java.lang.ObjectA request to resolve metadata from either a remote repository or the local repository.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringcontextprivate booleandeleteLocalCopyIfMissingprivate booleanfavorLocalRepositoryprivate Metadatametadataprivate RemoteRepositoryrepositoryprivate RequestTracetrace
-
Constructor Summary
Constructors Constructor Description MetadataRequest()Creates an uninitialized request.MetadataRequest(Metadata metadata)Creates a request to resolve the specified metadata from the local repository.MetadataRequest(Metadata metadata, RemoteRepository repository, java.lang.String context)Creates a request with the specified properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MetadatagetMetadata()Gets the metadata to resolve.RemoteRepositorygetRepository()Gets the repository from which the metadata should be resolved.java.lang.StringgetRequestContext()Gets the context in which this request is made.RequestTracegetTrace()Gets the trace information that describes the higher level request/operation in which this request is issued.booleanisDeleteLocalCopyIfMissing()Indicates whether the locally cached copy of the metadata should be removed if the corresponding file does not exist (any more) in the remote repository.booleanisFavorLocalRepository()Indicates whether the metadata resolution should be suppressed if the corresponding metadata of the local repository is up-to-date according to the update policy of the remote repository.MetadataRequestsetDeleteLocalCopyIfMissing(boolean deleteLocalCopyIfMissing)Controls whether the locally cached copy of the metadata should be removed if the corresponding file does not exist (any more) in the remote repository.MetadataRequestsetFavorLocalRepository(boolean favorLocalRepository)Controls resolution of remote metadata when already corresponding metadata of the local repository exists.MetadataRequestsetMetadata(Metadata metadata)Sets the metadata to resolve.MetadataRequestsetRepository(RemoteRepository repository)Sets the repository from which the metadata should be resolved.MetadataRequestsetRequestContext(java.lang.String context)Sets the context in which this request is made.MetadataRequestsetTrace(RequestTrace trace)Sets the trace information that describes the higher level request/operation in which this request is issued.java.lang.StringtoString()
-
-
-
Field Detail
-
metadata
private Metadata metadata
-
repository
private RemoteRepository repository
-
context
private java.lang.String context
-
deleteLocalCopyIfMissing
private boolean deleteLocalCopyIfMissing
-
favorLocalRepository
private boolean favorLocalRepository
-
trace
private RequestTrace trace
-
-
Constructor Detail
-
MetadataRequest
public MetadataRequest()
Creates an uninitialized request.
-
MetadataRequest
public MetadataRequest(Metadata metadata)
Creates a request to resolve the specified metadata from the local repository.- Parameters:
metadata- The metadata to resolve, may benull.
-
MetadataRequest
public MetadataRequest(Metadata metadata, RemoteRepository repository, java.lang.String context)
Creates a request with the specified properties.- Parameters:
metadata- The metadata to resolve, may benull.repository- The repository to resolve the metadata from, may benullto resolve from the local repository.context- The context in which this request is made, may benull.
-
-
Method Detail
-
getMetadata
public Metadata getMetadata()
Gets the metadata to resolve.- Returns:
- The metadata or
nullif not set.
-
setMetadata
public MetadataRequest setMetadata(Metadata metadata)
Sets the metadata to resolve.- Parameters:
metadata- The metadata, may benull.- Returns:
- This request for chaining, never
null.
-
getRepository
public RemoteRepository getRepository()
Gets the repository from which the metadata should be resolved.- Returns:
- The repository or
nullto resolve from the local repository.
-
setRepository
public MetadataRequest setRepository(RemoteRepository repository)
Sets the repository from which the metadata should be resolved.- Parameters:
repository- The repository, may benullto resolve from the local repository.- Returns:
- This request for chaining, never
null.
-
getRequestContext
public java.lang.String getRequestContext()
Gets the context in which this request is made.- Returns:
- The context, never
null.
-
setRequestContext
public MetadataRequest setRequestContext(java.lang.String context)
Sets the context in which this request is made.- Parameters:
context- The context, may benull.- Returns:
- This request for chaining, never
null.
-
isDeleteLocalCopyIfMissing
public boolean isDeleteLocalCopyIfMissing()
Indicates whether the locally cached copy of the metadata should be removed if the corresponding file does not exist (any more) in the remote repository.- Returns:
trueif locally cached metadata should be deleted if no corresponding remote file exists,falseto keep the local copy.
-
setDeleteLocalCopyIfMissing
public MetadataRequest setDeleteLocalCopyIfMissing(boolean deleteLocalCopyIfMissing)
Controls whether the locally cached copy of the metadata should be removed if the corresponding file does not exist (any more) in the remote repository.- Parameters:
deleteLocalCopyIfMissing-trueif locally cached metadata should be deleted if no corresponding remote file exists,falseto keep the local copy.- Returns:
- This request for chaining, never
null.
-
isFavorLocalRepository
public boolean isFavorLocalRepository()
Indicates whether the metadata resolution should be suppressed if the corresponding metadata of the local repository is up-to-date according to the update policy of the remote repository. In this case, the metadata resolution will even be suppressed if no local copy of the remote metadata exists yet.- Returns:
trueto suppress resolution of remote metadata if the corresponding metadata of the local repository is up-to-date,falseto resolve the remote metadata normally according to the update policy.
-
setFavorLocalRepository
public MetadataRequest setFavorLocalRepository(boolean favorLocalRepository)
Controls resolution of remote metadata when already corresponding metadata of the local repository exists. In cases where the local repository's metadata is sufficient and going to be preferred, resolution of the remote metadata can be suppressed to avoid unnecessary network access.- Parameters:
favorLocalRepository-trueto suppress resolution of remote metadata if the corresponding metadata of the local repository is up-to-date,falseto resolve the remote metadata normally according to the update policy.- Returns:
- This request for chaining, never
null.
-
getTrace
public RequestTrace getTrace()
Gets the trace information that describes the higher level request/operation in which this request is issued.- Returns:
- The trace information about the higher level operation or
nullif none.
-
setTrace
public MetadataRequest setTrace(RequestTrace trace)
Sets the trace information that describes the higher level request/operation in which this request is issued.- Parameters:
trace- The trace information about the higher level operation, may benull.- Returns:
- This request for chaining, never
null.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-