Class RrpcInterfaceMeta
@Remote.
Built once per interface class and cached for efficient proxy invocation.
Use of(Class) to obtain instances.
See Also:
- Since:
- 9.2.1
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the interface-level defaultacceptmedia-type override, or an empty string.Returns the base path from theRemoteannotation.Returns the interface-level base/host override, or an empty string if none.Returns the interface-level defaultcontentTypemedia-type override, or an empty string.Returns the interface-level constant form-data parameters to apply to every request.Returns the interface-level constant headers to set on every request.Class<?>[]Returns the interface-level interceptor classes, or an empty array if none.Class<?>Returns the interface class.Class<?>Returns the Java class of this interface.getMethodMeta(Method method) Returns the metadata for the given method, ornullif the method has no remote annotation.getMethodMetaByPath(String path) Returns the method metadata for the given path.Returns the method metadata for all annotated methods.Returns the method metadata keyed by the resolved method path.Returns the interface-level customHttpPartSerializer, ornull if none.Returns the interface-level constant query parameters to apply to every request.intReturns the interface-level default max retry attempts, or0if retries are disabled.Returns the interface-level default per-call timeout as a duration string, or an empty string.booleanReturns whether the interface opts its absolute@Remote/@Url/baseUrl()targets out of the default deny-private SSRF guardrail (Remote.allowPrivateUrls()).booleanReturns whether the interface opts non-idempotent verbs (POST/PATCH) into automatic retries.booleanReturns whether the interface throws a generic exception on an unmatched error response.static RrpcInterfaceMetaReturns theRrpcInterfaceMetafor the given interface, creating and caching it if necessary.toString()
-
Constructor Details
-
RrpcInterfaceMeta
Constructor.Provides backwards compatibility with the classic
RrpcInterfaceMetasignature; theuriargument is accepted for API parity and is currently ignored by this implementation.Unlike
of(Class), this constructor includes all public interface methods (matching the classic behavior), not just those annotated with the@Remote*annotations.- Parameters:
iface- The interface class. Must not benull .uri- Reserved for compatibility with the classic constructor. May benull .
-
-
Method Details
-
of
Returns theRrpcInterfaceMetafor the given interface, creating and caching it if necessary.- Parameters:
iface- The interface class. Must be annotated withRemote. Must not benull .- Returns:
- The metadata. Never
null . - Throws:
IllegalArgumentException- If the class is not an interface or not annotated withRemote.
-
getInterface
Returns the interface class.- Returns:
- The interface. Never
null .
-
getJavaClass
Returns the Java class of this interface.Alias for
getInterface()provided for backwards compatibility with the classic API.- Returns:
- The Java class. Never
null .
-
getMethodsByPath
Returns the method metadata keyed by the resolved method path.- Returns:
- An unmodifiable map from path to
RrpcInterfaceMethodMeta. Nevernull .
-
getMethodMetaByPath
Returns the method metadata for the given path.- Parameters:
path- The path. May benull .- Returns:
- The matching method metadata, or
null if no match was found.
-
getBasePath
Returns the base path from theRemoteannotation.- Returns:
- The base path. Never
null , but may be empty.
-
getBaseUrl
Returns the interface-level base/host override, or an empty string if none.Sourced from
Remote.baseUrl()(resolved throughVarResolver.DEFAULT). Used as a substitute for the client root URL when neither an@Urlparameter nor a method-levelbaseUrlis in effect; preserves the interface base path + method path + templating.- Returns:
- The base/host override. Never
null , but may be empty.
-
getContentType
Returns the interface-level defaultcontentTypemedia-type override, or an empty string.Sourced from
Remote.contentType()(resolved throughVarResolver.DEFAULT). Used as the default request-serializer/Content-Typeselector for methods that declare no method-levelRrpcInterfaceMethodMeta.getContentType().- Returns:
- The
contentTypemedia type. Nevernull , but may be empty.
-
getAccept
Returns the interface-level defaultacceptmedia-type override, or an empty string.Sourced from
Remote.accept()(resolved throughVarResolver.DEFAULT). Used as the defaultAcceptheader / response-parser fallback for methods that declare no method-levelRrpcInterfaceMethodMeta.getAccept().- Returns:
- The
acceptmedia type. Nevernull , but may be empty.
-
getHeaders
Returns the interface-level constant headers to set on every request.Includes the headers declared via
Remote.headers()plus the client-version header derived fromRemote.version()/Remote.versionHeader()(if a version was specified).- Returns:
- An unmodifiable list of name/value header entries. Never
null , but may be empty.
-
getQueryData
Returns the interface-level constant query parameters to apply to every request.Resolved from
Remote.queryData()(the"name=value"form, withVarResolver.DEFAULTexpansion).- Returns:
- An unmodifiable list of name/value query entries. Never
null , but may be empty.
-
getFormData
Returns the interface-level constant form-data parameters to apply to every request.Resolved from
Remote.formData()(the"name=value"form, withVarResolver.DEFAULTexpansion).- Returns:
- An unmodifiable list of name/value form-data entries. Never
null , but may be empty.
-
getPartSerializer
Returns the interface-level customHttpPartSerializer, ornull if none.Sourced from
@HttpPartMarshalling(serializer=...)declared on the interface. Used as the lowest-precedence default for part serialization: a parameter-level or method-level@HttpPartMarshallingserializer takes precedence over it.- Returns:
- The resolved part serializer, or
null if none is configured.
-
getInterceptorClasses
Returns the interface-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 interface-level default per-call timeout as a duration string, or an empty string.- Returns:
- The timeout duration string. Never
null , but may be empty.
-
getRetries
Returns the interface-level default max retry attempts, or0if retries are disabled.- Returns:
- The retry count.
-
isRetryNonIdempotent
Returns whether the interface opts non-idempotent verbs (POST/PATCH) into automatic retries.- Returns:
true if non-idempotent retries are opted in at the interface level.
-
isThrowOnError
Returns whether the interface throws a generic exception on an unmatched error response.- Returns:
true ifthrowOnErroris set at the interface level.
-
isAllowPrivateUrls
Returns whether the interface opts its absolute@Remote/@Url/baseUrl()targets out of the default deny-private SSRF guardrail (Remote.allowPrivateUrls()).- Returns:
true ifallowPrivateUrlsis set at the interface level.
-
getMethodMetas
Returns the method metadata for all annotated methods.- Returns:
- An unmodifiable map from
MethodtoRrpcInterfaceMethodMeta. Nevernull .
-
getMethodMeta
Returns the metadata for the given method, ornullif the method has no remote annotation.- Parameters:
method- The method. Can benull (returnsnull ).- Returns:
- The metadata, or
null if the method isnull or has no remote annotation.
-
toString
-