Class RrpcInterfaceMethodMeta

java.lang.Object
org.apache.juneau.http.remote.RrpcInterfaceMethodMeta

public final class RrpcInterfaceMethodMeta extends Object
Holds resolved metadata for a single method on an interface annotated with Remote.

Extracted at interface-discovery time (see RrpcInterfaceMeta) and cached for efficient proxy invocation.

See Also:
Since:
9.2.1
  • Method Details

    • resolvePartSerializer

      Resolves an HttpPartSerializer class declared on an HttpPartMarshalling annotation to a cached instance, or returns null for the HttpPartSerializer.Void sentinel (or a null class).

      Instances are created through BeanInstantiator (bean-store-less in the next-gen engine) and cached per class. Mirrors the classic RestClient.getPartSerializer(Class) per-class cache.

      Parameters:
      c - The part serializer class. May be null.
      Returns:
      The resolved (cached) part serializer, or null if none was specified.
    • getMethod

      public Method 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

      public String 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 @Header part, or null if none.
      Parameters:
      name - The header name.
      Returns:
      The default value, or null if none is configured.
    • getQueryDefault

      public String getQueryDefault(String name)
      Returns the method-level default for a @Query part, or null 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 @FormData part, or null if none.
      Parameters:
      name - The form-data parameter name.
      Returns:
      The default value, or null if none is configured.
    • getPathDefault

      public String getPathDefault(String name)
      Returns the method-level default for a @Path part, or null if none.
      Parameters:
      name - The path variable name.
      Returns:
      The default value, or null if none is configured.
    • getContentDefault

      Returns the method-level @Content default body, or null if none.

      Sourced from @Content(def=...) declared on the method. Used as the body when a @Content parameter is null, or as a constant body when the method declares no @Content parameter.

      Returns:
      The default body value, or null if none is configured.
    • getBaseUrl

      public String getBaseUrl()
      Returns the method-level base/host override, or an empty string if none.

      Sourced from @RemoteOp(baseUrl=...) / the verb annotations' baseUrl (resolved through VarResolver.DEFAULT). Takes precedence over the interface-level RrpcInterfaceMeta.getBaseUrl() but is itself overridden by an @Url parameter; preserves the interface base path + method path + templating.

      Returns:
      The base/host override. Never null, but may be empty.
    • getContentType

      Returns the method-level contentType media-type override, or an empty string if none.

      Sourced from @RemoteOp(contentType=...) / the verb annotations' contentType. Selects the matching request serializer and sets the Content-Type header; takes precedence over the interface-level RrpcInterfaceMeta.getContentType().

      Returns:
      The contentType media type. Never null, but may be empty.
    • getAccept

      public String getAccept()
      Returns the method-level accept media-type override, or an empty string if none.

      Sourced from @RemoteOp(accept=...) / the verb annotations' accept. Sets the Accept header and acts as the response parser fallback; takes precedence over the interface-level RrpcInterfaceMeta.getAccept().

      Returns:
      The accept media type. Never null, but may be empty.
    • getUrlParamIndex

      public int getUrlParamIndex()
      Returns the zero-based index of the method's single @Url parameter, or -1 if the method declares none.

      The presence and structural position of the @Url parameter 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-gen RemoteClient and never cached here.

      Returns:
      The @Url parameter index, or -1.
    • isMultipart

      public boolean isMultipart()
      Returns whether this method assembles a multipart/form-data request body from its @Part parameters.

      Sourced from the presence of a method-level @Multipart annotation. Validated at proxy-build time: a multipart method must declare at least one @Part parameter and must not also declare a single @Content body.

      Returns:
      true if this is a multipart method.
    • getPartSerializer

      Returns the method-level custom HttpPartSerializer, or null if none.

      Sourced from @HttpPartMarshalling(serializer=...) declared on the method. Applied to a parameter's parts when the parameter itself declares no @HttpPartMarshalling serializer; 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 raw Class<?>[] type avoids a module dependency on juneau-rest-client).

      Returns:
      The interceptor classes. Never null, but may be empty.
    • getTimeout

      public String 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

      public int getRetries()
      Returns the method-level max retry attempts, or 0 if retries are disabled.
      Returns:
      The retry count.
    • isRetryNonIdempotent

      public boolean 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

      public boolean isThrowOnError()
      Returns whether this method throws a generic exception on an unmatched error response.
      Returns:
      true if throwOnError is set at the method level.
    • getConstantHeaders

      Returns the method-level always-applied constant headers ("Name: value" form), resolved via VarResolver.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 via VarResolver.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 via VarResolver.DEFAULT.
      Returns:
      An unmodifiable list of name/value form-data entries. Never null, but may be empty.
    • toString

      public String toString()
      Overrides:
      toString in class Object