Record Class TasksConfig
java.lang.Object
java.lang.Record
dev.tachyonmcp.core.server.config.TasksConfig
- Record Components:
enabled- whether thetaskscapability is advertised at all (defaultfalse); the capability is also advertised, regardless of this flag, when a registered tool supports task augmentationlist- whethertasks/listis exposed (defaultfalse)cancel- whethertasks/cancelis supported (defaultfalse)requests- whether task-augmentedtools/callrequests are accepted (defaultfalse)pageSize- default page size when a list request omits its limitkeepAlive- default retention window for a terminal task's result before it's dropped from memory (default 5 minutes); overridable per task viaTaskOptions.keepAlive()pollInterval- defaultpollIntervalsuggested to requestors in task responses, ornull(the default) to suggest none; overridable per task viaTaskOptions.pollInterval(). UnlikekeepAlive, this value is wire-visible and spec-compliant requestorsSHOULDthrottle their own polling cadence to match it — pick a value that fits how long tasks in this server actually run, there's no one-size-fits-all default.
public record TasksConfig(boolean enabled, boolean list, boolean cancel, boolean requests, int pageSize, Duration keepAlive, @Nullable Duration pollInterval)
extends Record
Configuration for the tasks capability. Fields map 1:1 to the MCP
tasks capability
object (tasks.list, tasks.cancel, tasks.requests.tools.call).-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DurationPublic (unlike the defaults above) —TaskEntryin a different package reuses this as the resolved default. -
Constructor Summary
ConstructorsConstructorDescriptionTasksConfig(boolean enabled, boolean list, boolean cancel, boolean requests, int pageSize, Duration keepAlive, @Nullable Duration pollInterval) Creates an instance of aTasksConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic TasksConfig.Builderbuilder()booleancancel()Returns the value of thecancelrecord component.booleanenabled()Returns the value of theenabledrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thekeepAliverecord component.booleanlist()Returns the value of thelistrecord component.intpageSize()Returns the value of thepageSizerecord component.@Nullable DurationReturns the value of thepollIntervalrecord component.booleanrequests()Returns the value of therequestsrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DEFAULT_TASK_KEEP_ALIVE
Public (unlike the defaults above) —TaskEntryin a different package reuses this as the resolved default.
-
-
Constructor Details
-
TasksConfig
public TasksConfig(boolean enabled, boolean list, boolean cancel, boolean requests, int pageSize, Duration keepAlive, @Nullable Duration pollInterval) Creates an instance of aTasksConfigrecord class.- Parameters:
enabled- the value for theenabledrecord componentlist- the value for thelistrecord componentcancel- the value for thecancelrecord componentrequests- the value for therequestsrecord componentpageSize- the value for thepageSizerecord componentkeepAlive- the value for thekeepAliverecord componentpollInterval- the value for thepollIntervalrecord component
-
-
Method Details
-
builder
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
enabled
public boolean enabled()Returns the value of theenabledrecord component.- Returns:
- the value of the
enabledrecord component
-
list
public boolean list()Returns the value of thelistrecord component.- Returns:
- the value of the
listrecord component
-
cancel
public boolean cancel()Returns the value of thecancelrecord component.- Returns:
- the value of the
cancelrecord component
-
requests
public boolean requests()Returns the value of therequestsrecord component.- Returns:
- the value of the
requestsrecord component
-
pageSize
public int pageSize()Returns the value of thepageSizerecord component.- Returns:
- the value of the
pageSizerecord component
-
keepAlive
Returns the value of thekeepAliverecord component.- Returns:
- the value of the
keepAliverecord component
-
pollInterval
Returns the value of thepollIntervalrecord component.- Returns:
- the value of the
pollIntervalrecord component
-