Record Class McpServerRegistrationResult

java.lang.Object
java.lang.Record
io.agentscope.harness.agent.tools.McpServerRegistrationResult
Record Components:
serverName - configured server name; may be null for a skipped invalid entry
transport - configured transport; may be null when absent or unavailable
status - terminal registration status
completedAt - time at which registration reached the terminal status
cause - failure or skip cause; null for 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.
  • Constructor Details

    • McpServerRegistrationResult

      public McpServerRegistrationResult(String serverName, String transport, McpServerRegistrationResult.Status status, Instant completedAt, Throwable cause)
      Creates an instance of a McpServerRegistrationResult record class.
      Parameters:
      serverName - the value for the serverName record component
      transport - the value for the transport record component
      status - the value for the status record component
      completedAt - the value for the completedAt record component
      cause - the value for the cause record component
  • Method Details

    • success

      public static McpServerRegistrationResult success(String serverName, String transport)
      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

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • serverName

      public String serverName()
      Returns the value of the serverName record component.
      Returns:
      the value of the serverName record component
    • transport

      public String transport()
      Returns the value of the transport record component.
      Returns:
      the value of the transport record component
    • status

      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • completedAt

      public Instant completedAt()
      Returns the value of the completedAt record component.
      Returns:
      the value of the completedAt record component
    • cause

      public Throwable cause()
      Returns the value of the cause record component.
      Returns:
      the value of the cause record component