Package org.mcpjava.server.progress
Interface ProgressNotification
- All Superinterfaces:
MetaCarrier
Represents a
notifications/progress message to send to the client.
Progress notifications allow servers to report progress on long-running operations.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceBuilder for creating progress notifications. -
Method Summary
Modifier and TypeMethodDescriptionmessage()Gets the progress message.progress()Gets the current progress value.<T> Tsend()Sends the progress notification to the client asynchronously.voidSends the progress notification to the client without waiting for acknowledgment.token()Gets the original progress token from the request.total()Gets the total expected value for the operation.Methods inherited from interface org.mcpjava.server.MetaCarrier
metadata
-
Method Details
-
token
ProgressToken token()Gets the original progress token from the request.- Returns:
- the progress token
-
total
Optional<BigDecimal> total()Gets the total expected value for the operation.- Returns:
- the total value, or an empty
Optionalif not set
-
progress
BigDecimal progress()Gets the current progress value.- Returns:
- the progress value
-
message
Gets the progress message.- Returns:
- the message, or an empty
Optionalif not set
-
sendAndForget
void sendAndForget()Sends the progress notification to the client without waiting for acknowledgment.This method is fire-and-forget and can be called from any thread. Framework implementations may send the message asynchronously.
-
send
<T> T send()Sends the progress notification to the client asynchronously.Framework implementations should return their native reactive type:
- Quarkus:
Uni<Void> - Spring:
Mono<Void> - Standard Java:
CompletableFuture<Void>
- Type Parameters:
T- the framework-specific reactive type- Returns:
- a reactive result that completes when the notification is sent
- Quarkus:
-