Package com.tnsai.metadata
Record Class WebServiceConfig
java.lang.Object
java.lang.Record
com.tnsai.metadata.WebServiceConfig
- Record Components:
endpoint- HTTP endpoint URLhttpMethod- HTTP method (GET, POST, etc.)paramType- how parameters are passed (BODY, QUERY, PATH)timeout- request timeout in millisecondscontentType- request content typeaccept- accept header valuefollowRedirects- whether to follow HTTP redirectsretryCount- number of retries on failureretryBackoffMs- backoff between retries in msauth- authentication typeauthToken- env var name for bearer tokenauthUsername- env var name for basic auth usernameauthPassword- env var name for basic auth passwordapiKeyHeader- header name for API key authheaders- 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
,
providing a cohesive view of web service configuration including endpoint,
HTTP method, authentication, headers, and retry settings.
invalid reference
ActionSpec
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final WebServiceConfigDefault configuration matching @WebService annotation defaults. -
Constructor Summary
ConstructorsConstructorDescriptionWebServiceConfig(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 aWebServiceConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaccept()Returns the value of theacceptrecord component.Returns the value of theapiKeyHeaderrecord component.auth()Returns the value of theauthrecord component.Returns the value of theauthPasswordrecord component.Returns the value of theauthTokenrecord component.Returns the value of theauthUsernamerecord component.Returns the value of thecontentTyperecord component.endpoint()Returns the value of theendpointrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanReturns the value of thefollowRedirectsrecord component.booleanhasAuth()Checks if authentication is configured.booleanChecks if an endpoint is configured.final inthashCode()Returns a hash code value for this object.booleanChecks if custom headers are configured.booleanhasRetry()Checks if retry is configured.Header[]headers()Returns the value of theheadersrecord component.Returns the value of thehttpMethodrecord component.Returns the value of theparamTyperecord component.intReturns the value of theretryBackoffMsrecord component.intReturns the value of theretryCountrecord component.inttimeout()Returns the value of thetimeoutrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
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 aWebServiceConfigrecord class.- Parameters:
endpoint- the value for theendpointrecord componenthttpMethod- the value for thehttpMethodrecord componentparamType- the value for theparamTyperecord componenttimeout- the value for thetimeoutrecord componentcontentType- the value for thecontentTyperecord componentaccept- the value for theacceptrecord componentfollowRedirects- the value for thefollowRedirectsrecord componentretryCount- the value for theretryCountrecord componentretryBackoffMs- the value for theretryBackoffMsrecord componentauth- the value for theauthrecord componentauthToken- the value for theauthTokenrecord componentauthUsername- the value for theauthUsernamerecord componentauthPassword- the value for theauthPasswordrecord componentapiKeyHeader- the value for theapiKeyHeaderrecord componentheaders- the value for theheadersrecord 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
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 '=='. -
endpoint
Returns the value of theendpointrecord component.- Returns:
- the value of the
endpointrecord component
-
httpMethod
Returns the value of thehttpMethodrecord component.- Returns:
- the value of the
httpMethodrecord component
-
paramType
Returns the value of theparamTyperecord component.- Returns:
- the value of the
paramTyperecord component
-
timeout
public int timeout()Returns the value of thetimeoutrecord component.- Returns:
- the value of the
timeoutrecord component
-
contentType
Returns the value of thecontentTyperecord component.- Returns:
- the value of the
contentTyperecord component
-
accept
Returns the value of theacceptrecord component.- Returns:
- the value of the
acceptrecord component
-
followRedirects
public boolean followRedirects()Returns the value of thefollowRedirectsrecord component.- Returns:
- the value of the
followRedirectsrecord component
-
retryCount
public int retryCount()Returns the value of theretryCountrecord component.- Returns:
- the value of the
retryCountrecord component
-
retryBackoffMs
public int retryBackoffMs()Returns the value of theretryBackoffMsrecord component.- Returns:
- the value of the
retryBackoffMsrecord component
-
auth
Returns the value of theauthrecord component.- Returns:
- the value of the
authrecord component
-
authToken
Returns the value of theauthTokenrecord component.- Returns:
- the value of the
authTokenrecord component
-
authUsername
Returns the value of theauthUsernamerecord component.- Returns:
- the value of the
authUsernamerecord component
-
authPassword
Returns the value of theauthPasswordrecord component.- Returns:
- the value of the
authPasswordrecord component
-
apiKeyHeader
Returns the value of theapiKeyHeaderrecord component.- Returns:
- the value of the
apiKeyHeaderrecord component
-
headers
Returns the value of theheadersrecord component.- Returns:
- the value of the
headersrecord component
-