Package org.apache.maven.api.services
Interface Request<S extends ProtoSession>
- Type Parameters:
S
- the type of ProtoSession associated with this request, allowing for type-safe session handling in specific request implementations
- All Known Subinterfaces:
ArtifactCoordinatesFactoryRequest
,ArtifactDeployerRequest
,ArtifactFactoryRequest
,ArtifactInstallerRequest
,ArtifactResolverRequest
,DependencyCoordinatesFactoryRequest
,DependencyResolverRequest
,ModelBuilderRequest
,ProjectBuilderRequest
,SettingsBuilderRequest
,ToolchainsBuilderRequest
,VersionRangeResolverRequest
,VersionResolverRequest
- All Known Implementing Classes:
DefaultModelBuilder.RgavCacheKey
,DefaultModelBuilder.SourceCacheKey
,ModelResolver.ModelResolverRequest
Base interface for service requests in Maven. This interface defines the common contract
for all request types within the Maven service layer, providing access to session context
and request tracing capabilities.
Each request is associated with a ProtoSession
that contains the configuration
and context necessary for request processing, including:
- User and system properties for interpolation
- Session start time information
- Project directory structures
Requests can optionally carry trace information through RequestTrace
to support:
- Debugging and troubleshooting of request flows
- Audit logging of operations
- Performance monitoring of nested operations
This interface is designed to be extended by specific request types that handle different Maven operations. All implementations must be immutable to ensure thread safety and predictable behavior in concurrent environments.
- Since:
- 4.0.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returnstrue
if the specified object is equal to this request.Returns the session associated with this request.getTrace()
Returns the trace information associated with this request, if any.int
hashCode()
Returns a hashcode value for this request, based on all significant fields.toString()
Returns a string representation of this request, used for debugging and logging purposes.
-
Method Details
-
getSession
Returns the session associated with this request.- Returns:
- the session instance, never
null
-
getTrace
Returns the trace information associated with this request, if any. The trace provides context about the request's position in the operation hierarchy and can carry additional diagnostic information.- Returns:
- the request trace, or
null
if no trace information is available
-
hashCode
int hashCode()Returns a hashcode value for this request, based on all significant fields. Implementations must ensure that if two requests are equal according toequals(Object)
, they have the same hashcode. -
equals
Returnstrue
if the specified object is equal to this request. Two requests are considered equal if they have the same type and all significant fields are equal. -
toString
Returns a string representation of this request, used for debugging and logging purposes. The format should include the request type and any significant attributes that define the request's state.
-