Record Class WebServiceConfig

java.lang.Object
java.lang.Record
com.tnsai.metadata.WebServiceConfig
Record Components:
endpoint - HTTP endpoint URL
httpMethod - HTTP method (GET, POST, etc.)
paramType - how parameters are passed (BODY, QUERY, PATH)
timeout - request timeout in milliseconds
contentType - request content type
accept - accept header value
followRedirects - whether to follow HTTP redirects
retryCount - number of retries on failure
retryBackoffMs - backoff between retries in ms
auth - authentication type
authToken - env var name for bearer token
authUsername - env var name for basic auth username
authPassword - env var name for basic auth password
apiKeyHeader - header name for API key auth
headers - custom HTTP headers

public record WebServiceConfig(String endpoint, HttpMethod httpMethod, ParamType paramType, int timeout, String contentType, String accept, boolean followRedirects, int retryCount, int retryBackoffMs, AuthType auth, String authToken, String authUsername, String authPassword, String apiKeyHeader, Header[] headers) extends Record
Grouped configuration for WEB_SERVICE actions.

Extracts and organizes the HTTP-specific fields from

invalid reference
ActionSpec
, providing a cohesive view of web service configuration including endpoint, HTTP method, authentication, headers, and retry settings.

This record is part of the ActionConfig decomposition (C-20), splitting ActionSpec's 60+ fields into focused, type-specific records.

Usage


 ActionSpec action = ...;
 WebServiceConfig ws = action.webServiceConfig();
 String url = ws.endpoint();
 HttpMethod method = ws.httpMethod();
 
See Also:
  • invalid reference
    ActionSpec#webServiceConfig()
  • Field Details

    • DEFAULT

      public static final WebServiceConfig DEFAULT
      Default configuration matching @WebService annotation defaults.
  • Constructor Details

    • WebServiceConfig

      public WebServiceConfig(String endpoint, HttpMethod httpMethod, ParamType paramType, int timeout, String contentType, String accept, boolean followRedirects, int retryCount, int retryBackoffMs, AuthType auth, String authToken, String authUsername, String authPassword, String apiKeyHeader, Header[] headers)
      Creates an instance of a WebServiceConfig record class.
      Parameters:
      endpoint - the value for the endpoint record component
      httpMethod - the value for the httpMethod record component
      paramType - the value for the paramType record component
      timeout - the value for the timeout record component
      contentType - the value for the contentType record component
      accept - the value for the accept record component
      followRedirects - the value for the followRedirects record component
      retryCount - the value for the retryCount record component
      retryBackoffMs - the value for the retryBackoffMs record component
      auth - the value for the auth record component
      authToken - the value for the authToken record component
      authUsername - the value for the authUsername record component
      authPassword - the value for the authPassword record component
      apiKeyHeader - the value for the apiKeyHeader record component
      headers - the value for the headers record component
  • Method Details

    • hasEndpoint

      public boolean hasEndpoint()
      Checks if an endpoint is configured.
      Returns:
      true if endpoint is not empty
    • hasAuth

      public boolean hasAuth()
      Checks if authentication is configured.
      Returns:
      true if auth type is not NO_AUTH
    • hasHeaders

      public boolean hasHeaders()
      Checks if custom headers are configured.
      Returns:
      true if headers array is not empty
    • hasRetry

      public boolean hasRetry()
      Checks if retry is configured.
      Returns:
      true if retryCount > 0
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • endpoint

      public String endpoint()
      Returns the value of the endpoint record component.
      Returns:
      the value of the endpoint record component
    • httpMethod

      public HttpMethod httpMethod()
      Returns the value of the httpMethod record component.
      Returns:
      the value of the httpMethod record component
    • paramType

      public ParamType paramType()
      Returns the value of the paramType record component.
      Returns:
      the value of the paramType record component
    • timeout

      public int timeout()
      Returns the value of the timeout record component.
      Returns:
      the value of the timeout record component
    • contentType

      public String contentType()
      Returns the value of the contentType record component.
      Returns:
      the value of the contentType record component
    • accept

      public String accept()
      Returns the value of the accept record component.
      Returns:
      the value of the accept record component
    • followRedirects

      public boolean followRedirects()
      Returns the value of the followRedirects record component.
      Returns:
      the value of the followRedirects record component
    • retryCount

      public int retryCount()
      Returns the value of the retryCount record component.
      Returns:
      the value of the retryCount record component
    • retryBackoffMs

      public int retryBackoffMs()
      Returns the value of the retryBackoffMs record component.
      Returns:
      the value of the retryBackoffMs record component
    • auth

      public AuthType auth()
      Returns the value of the auth record component.
      Returns:
      the value of the auth record component
    • authToken

      public String authToken()
      Returns the value of the authToken record component.
      Returns:
      the value of the authToken record component
    • authUsername

      public String authUsername()
      Returns the value of the authUsername record component.
      Returns:
      the value of the authUsername record component
    • authPassword

      public String authPassword()
      Returns the value of the authPassword record component.
      Returns:
      the value of the authPassword record component
    • apiKeyHeader

      public String apiKeyHeader()
      Returns the value of the apiKeyHeader record component.
      Returns:
      the value of the apiKeyHeader record component
    • headers

      public Header[] headers()
      Returns the value of the headers record component.
      Returns:
      the value of the headers record component