Class RrpcInterfaceMethodMeta
Remote.
Extracted at interface-discovery time (see RrpcInterfaceMeta) and cached for
efficient proxy invocation.
See Also:
- Since:
- 9.2.1
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordMethod-level content negotiation: theacceptandcontentTypemedia-type overrides sourced from@RemoteOp/verb-annotation members.static final recordMethod-level cross-cutting call policy: interceptors, per-call timeout, retries, and the genericthrowOnErrorflag, sourced from@RemoteOp/verb annotation members. -
Method Summary
Modifier and TypeMethodDescriptionReturns the method-levelacceptmedia-type override, or an empty string if none.Returns the method-level base/host override, or an empty string if none.Returns the method-level always-applied constant form-data parameters ("name=value"form), resolved viaVarResolver.DEFAULT.Returns the method-level always-applied constant headers ("Name: value"form), resolved viaVarResolver.DEFAULT.Returns the method-level always-applied constant query parameters ("name=value"form), resolved viaVarResolver.DEFAULT.Returns the method-level@Contentdefault body, ornull if none.Returns the method-levelcontentTypemedia-type override, or an empty string if none.getFormDataDefault(String name) Returns the method-level default for a@FormDatapart, ornull if none.getHeaderDefault(String name) Returns the method-level default for a@Headerpart, ornull if none.Returns the HTTP method (e.g.Class<?>[]Returns the method-level interceptor classes, or an empty array if none.Returns the Java method this metadata is for.Returns the Java method this metadata is for.Returns the method-level customHttpPartSerializer, ornull if none.getPath()Returns the resolved path for this operation (relative to the interface base path).getPathDefault(String name) Returns the method-level default for a@Pathpart, ornull if none.getQueryDefault(String name) Returns the method-level default for a@Querypart, ornull if none.intReturns the method-level max retry attempts, or0if retries are disabled.Returns what the proxy method should return.Returns the method-level per-call timeout as a duration string, or an empty string if none.intReturns the zero-based index of the method's single@Urlparameter, or-1if the method declares none.booleanReturns whether this method assembles amultipart/form-datarequest body from its@Partparameters.booleanReturns whether this method opts non-idempotent verbs (POST/PATCH) into automatic retries.booleanReturns whether this method throws a generic exception on an unmatched error response.static HttpPartSerializerresolvePartSerializer(Class<? extends HttpPartSerializer> c) Resolves anHttpPartSerializerclass declared on anHttpPartMarshallingannotation to a cached instance, or returnsnull for theHttpPartSerializer.Voidsentinel (or anull class).toString()
-
Method Details
-
resolvePartSerializer
Resolves anHttpPartSerializerclass declared on anHttpPartMarshallingannotation to a cached instance, or returnsnull for theHttpPartSerializer.Voidsentinel (or anull class).Instances are created through
BeanInstantiator(bean-store-less in the next-gen engine) and cached per class. Mirrors the classicRestClient.getPartSerializer(Class)per-class cache.- Parameters:
c- The part serializer class. May benull .- Returns:
- The resolved (cached) part serializer, or
null if none was specified.
-
getMethod
Returns the Java method this metadata is for.- Returns:
- The method. Never
null .
-
getJavaMethod
Returns the Java method this metadata is for.Alias for
getMethod()provided for backwards compatibility with the classic API.- Returns:
- The Java method. Never
null .
-
getHttpMethod
Returns the HTTP method (e.g."GET","POST").- Returns:
- The HTTP method. Never
null .
-
getPath
Returns the resolved path for this operation (relative to the interface base path).- Returns:
- The path. Never
null , but may be empty.
-
getReturnType
Returns what the proxy method should return.- Returns:
- The return type. Never
null .
-
getHeaderDefault
Returns the method-level default for a@Headerpart, ornull if none.- Parameters:
name- The header name.- Returns:
- The default value, or
null if none is configured.
-
getQueryDefault
Returns the method-level default for a@Querypart, ornull if none.- Parameters:
name- The query parameter name.- Returns:
- The default value, or
null if none is configured.
-
getFormDataDefault
Returns the method-level default for a@FormDatapart, ornull if none.- Parameters:
name- The form-data parameter name.- Returns:
- The default value, or
null if none is configured.
-
getPathDefault
Returns the method-level default for a@Pathpart, ornull if none.- Parameters:
name- The path variable name.- Returns:
- The default value, or
null if none is configured.
-
getContentDefault
Returns the method-level@Contentdefault body, ornull if none.Sourced from
@Content(def=...)declared on the method. Used as the body when a@Contentparameter isnull , or as a constant body when the method declares no@Contentparameter.- Returns:
- The default body value, or
null if none is configured.
-
getBaseUrl
Returns the method-level base/host override, or an empty string if none.Sourced from
@RemoteOp(baseUrl=...)/ the verb annotations'baseUrl(resolved throughVarResolver.DEFAULT). Takes precedence over the interface-levelRrpcInterfaceMeta.getBaseUrl()but is itself overridden by an@Urlparameter; preserves the interface base path + method path + templating.- Returns:
- The base/host override. Never
null , but may be empty.
-
getContentType
Returns the method-levelcontentTypemedia-type override, or an empty string if none.Sourced from
@RemoteOp(contentType=...)/ the verb annotations'contentType. Selects the matching request serializer and sets theContent-Typeheader; takes precedence over the interface-levelRrpcInterfaceMeta.getContentType().- Returns:
- The
contentTypemedia type. Nevernull , but may be empty.
-
getAccept
Returns the method-levelacceptmedia-type override, or an empty string if none.Sourced from
@RemoteOp(accept=...)/ the verb annotations'accept. Sets theAcceptheader and acts as the response parser fallback; takes precedence over the interface-levelRrpcInterfaceMeta.getAccept().- Returns:
- The
acceptmedia type. Nevernull , but may be empty.
-
getUrlParamIndex
Returns the zero-based index of the method's single@Urlparameter, or-1if the method declares none.The presence and structural position of the
@Urlparameter is fixed per method (validated at proxy-build time: at most one is allowed); the per-call value is read from the invocation arguments by the next-genRemoteClientand never cached here.- Returns:
- The
@Urlparameter index, or-1.
-
isMultipart
Returns whether this method assembles amultipart/form-datarequest body from its@Partparameters.Sourced from the presence of a method-level
@Multipartannotation. Validated at proxy-build time: a multipart method must declare at least one@Partparameter and must not also declare a single@Contentbody.- Returns:
true if this is a multipart method.
-
getPartSerializer
Returns the method-level customHttpPartSerializer, ornull if none.Sourced from
@HttpPartMarshalling(serializer=...)declared on the method. Applied to a parameter's parts when the parameter itself declares no@HttpPartMarshallingserializer; the interface-level default (RrpcInterfaceMeta.getPartSerializer()) applies when neither is present.- Returns:
- The resolved part serializer, or
null if none is configured.
-
getInterceptorClasses
Returns the method-level interceptor classes, or an empty array if none.Each class implements the next-gen client-side interceptor SPI and is resolved to an instance by the next-gen
RemoteClient(the rawClass<?>[]type avoids a module dependency onjuneau-rest-client).- Returns:
- The interceptor classes. Never
null , but may be empty.
-
getTimeout
Returns the method-level per-call timeout as a duration string, or an empty string if none.- Returns:
- The timeout duration string. Never
null , but may be empty.
-
getRetries
Returns the method-level max retry attempts, or0if retries are disabled.- Returns:
- The retry count.
-
isRetryNonIdempotent
Returns whether this method opts non-idempotent verbs (POST/PATCH) into automatic retries.- Returns:
true if non-idempotent retries are opted in at the method level.
-
isThrowOnError
Returns whether this method throws a generic exception on an unmatched error response.- Returns:
true ifthrowOnErroris set at the method level.
-
getConstantHeaders
Returns the method-level always-applied constant headers ("Name: value"form), resolved viaVarResolver.DEFAULT.- Returns:
- An unmodifiable list of name/value header entries. Never
null , but may be empty.
-
getConstantQueryData
Returns the method-level always-applied constant query parameters ("name=value"form), resolved viaVarResolver.DEFAULT.- Returns:
- An unmodifiable list of name/value query entries. Never
null , but may be empty.
-
getConstantFormData
Returns the method-level always-applied constant form-data parameters ("name=value"form), resolved viaVarResolver.DEFAULT.- Returns:
- An unmodifiable list of name/value form-data entries. Never
null , but may be empty.
-
toString
-