Record Class McpServerRegistrationResult
java.lang.Object
java.lang.Record
io.agentscope.harness.agent.tools.McpServerRegistrationResult
- Record Components:
serverName- configured server name; may benullfor a skipped invalid entrytransport- configured transport; may benullwhen absent or unavailablestatus- terminal registration statuscompletedAt- time at which registration reached the terminal statuscause- failure or skip cause;nullfor successful registration
public record McpServerRegistrationResult(String serverName, String transport, McpServerRegistrationResult.Status status, Instant completedAt, Throwable cause)
extends Record
Terminal result of registering one MCP server entry.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumTerminal status of an MCP server registration attempt. -
Constructor Summary
ConstructorsConstructorDescriptionMcpServerRegistrationResult(String serverName, String transport, McpServerRegistrationResult.Status status, Instant completedAt, Throwable cause) Creates an instance of aMcpServerRegistrationResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncause()Returns the value of thecauserecord component.Returns the value of thecompletedAtrecord component.final booleanIndicates whether some other object is "equal to" this one.static McpServerRegistrationResultCreates a failed registration result.final inthashCode()Returns a hash code value for this object.Returns the value of theserverNamerecord component.static McpServerRegistrationResultCreates a skipped registration result.status()Returns the value of thestatusrecord component.static McpServerRegistrationResultCreates a successful registration result.final StringtoString()Returns a string representation of this record class.Returns the value of thetransportrecord component.
-
Constructor Details
-
McpServerRegistrationResult
public McpServerRegistrationResult(String serverName, String transport, McpServerRegistrationResult.Status status, Instant completedAt, Throwable cause) Creates an instance of aMcpServerRegistrationResultrecord class.- Parameters:
serverName- the value for theserverNamerecord componenttransport- the value for thetransportrecord componentstatus- the value for thestatusrecord componentcompletedAt- the value for thecompletedAtrecord componentcause- the value for thecauserecord component
-
-
Method Details
-
success
Creates a successful registration result. -
failed
public static McpServerRegistrationResult failed(String serverName, String transport, Throwable cause) Creates a failed registration result. -
skipped
public static McpServerRegistrationResult skipped(String serverName, String transport, Throwable cause) Creates a skipped registration result. -
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. All components in this record class are compared withObjects::equals(Object,Object). -
serverName
Returns the value of theserverNamerecord component.- Returns:
- the value of the
serverNamerecord component
-
transport
Returns the value of thetransportrecord component.- Returns:
- the value of the
transportrecord component
-
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
completedAt
Returns the value of thecompletedAtrecord component.- Returns:
- the value of the
completedAtrecord component
-
cause
Returns the value of thecauserecord component.- Returns:
- the value of the
causerecord component
-