Class RemoteOperationMeta
java.lang.Object
org.apache.juneau.rest.client.classic.remote.RemoteOperationMeta
Contains the meta-data about a Java method on a REST proxy class.
Captures the information in @RemoteOp annotations for caching and reuse.
See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionRemoteOperationMeta(String parentPath, Method m, String defaultMethod) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionforEachException(Consumer<Class<?>> action) Performs an action on the exceptions thrown by this method.forEachFormDataArg(Consumer<RemoteOperationArg> action) Performs an action on the@FormDataannotated arguments on this Java method.forEachHeaderArg(Consumer<RemoteOperationArg> action) Performs an action on the@Headerannotated arguments on this Java method.forEachPathArg(Consumer<RemoteOperationArg> action) Performs an action on the@Pathannotated arguments on this Java method.forEachQueryArg(Consumer<RemoteOperationArg> action) Performs an action on the@Queryannotated arguments on this Java method.Performs an action on the@Requestannotated arguments on this Java method.Returns the method-level defaultAcceptmedia type from theacceptannotation member.Returns the method-level base/host override from thebaseUrlannotation member.Returns the method-level constant form-data parameters from theformDataannotation member.Returns the method-level constant headers from theheadersannotation member.Returns the method-level constant query parameters from thequeryDataannotation member.Returns the argument annotated with@Content.Returns the default value for a@Contentannotation on the method.Returns the method-level defaultContent-Typemedia type from thecontentTypeannotation member.getFormDataDefault(String name) Returns the default value for a@FormDataannotation on the method.Returns the absolute URI of the REST interface invoked by this Java method.getHeaderDefault(String name) Returns the default value for a@Headerannotation on the method.Returns the value of the@RemoteOp(method)annotation on this Java method.getPathDefault(String name) Returns the default value for a@Pathannotation on the method.getQueryDefault(String name) Returns the default value for a@Queryannotation on the method.intReturns the method-level maximum retry attempts from theretriesannotation member.Returns whether the method returns the HTTP response body or status code.Returns the method-level per-call timeout duration string from thetimeoutannotation member.intReturns the index of the@Urlparameter, or-1if none.booleanReturns whether the method opts non-idempotent verbs into automatic retries (retryNonIdempotentmember).booleanReturns whether the method throws a generic exception on an unmatched error response (throwOnErrormember).
-
Constructor Details
-
RemoteOperationMeta
Constructor.- Parameters:
parentPath- The absolute URI of the REST interface backing the interface proxy.m- The Java method.defaultMethod- The default HTTP method if not specified through annotation.
-
-
Method Details
-
forEachException
Performs an action on the exceptions thrown by this method.- Parameters:
action- The action to perform.- Returns:
- This object.
-
forEachFormDataArg
Performs an action on the@FormDataannotated arguments on this Java method.- Parameters:
action- The action to perform.- Returns:
- This object.
-
forEachHeaderArg
Performs an action on the@Headerannotated arguments on this Java method.- Parameters:
action- The action to perform.- Returns:
- This object.
-
forEachPathArg
Performs an action on the@Pathannotated arguments on this Java method.- Parameters:
action- The action to perform.- Returns:
- This object.
-
forEachQueryArg
Performs an action on the@Queryannotated arguments on this Java method.- Parameters:
action- The action to perform.- Returns:
- This object.
-
forEachRequestArg
Performs an action on the@Requestannotated arguments on this Java method.- Parameters:
action- The action to perform.- Returns:
- This object.
-
getContentArg
Returns the argument annotated with@Content.- Returns:
- A index of the argument with the
@Contentannotation, ornull if no argument exists.
-
getContentDefault
Returns the default value for a@Contentannotation on the method.- Returns:
- The default value, or
null if not specified. - Since:
- 9.2.0
-
getFormDataDefault
Returns the default value for a@FormDataannotation on the method.- Parameters:
name- The form data parameter name.- Returns:
- The default value, or
null if not specified. - Since:
- 9.2.0
-
getFullPath
Returns the absolute URI of the REST interface invoked by this Java method.- Returns:
- The absolute URI of the REST interface, never
null .
-
getHeaderDefault
Returns the default value for a@Headerannotation on the method.- Parameters:
name- The header name.- Returns:
- The default value, or
null if not specified. - Since:
- 9.2.0
-
getHttpMethod
Returns the value of the@RemoteOp(method)annotation on this Java method.- Returns:
- The value of the annotation, never
null .
-
getPathDefault
Returns the default value for a@Pathannotation on the method.- Parameters:
name- The path parameter name.- Returns:
- The default value, or
null if not specified. - Since:
- 9.2.0
-
getQueryDefault
Returns the default value for a@Queryannotation on the method.- Parameters:
name- The query parameter name.- Returns:
- The default value, or
null if not specified. - Since:
- 9.2.0
-
getReturns
Returns whether the method returns the HTTP response body or status code.- Returns:
- Whether the method returns the HTTP response body or status code.
-
getBaseUrl
Returns the method-level base/host override from thebaseUrlannotation member.- Returns:
- The base/host override. Never
null , but may be empty.
-
getAccept
Returns the method-level defaultAcceptmedia type from theacceptannotation member.- Returns:
- The accept media type. Never
null , but may be empty.
-
getContentType
Returns the method-level defaultContent-Typemedia type from thecontentTypeannotation member.- Returns:
- The content-type media type. Never
null , but may be empty.
-
getConstantHeaders
Returns the method-level constant headers from theheadersannotation member.- Returns:
- An unmodifiable list of name/value entries. Never
null , but may be empty.
-
getConstantQueryData
Returns the method-level constant query parameters from thequeryDataannotation member.- Returns:
- An unmodifiable list of name/value entries. Never
null , but may be empty.
-
getConstantFormData
Returns the method-level constant form-data parameters from theformDataannotation member.- Returns:
- An unmodifiable list of name/value entries. Never
null , but may be empty.
-
getTimeout
Returns the method-level per-call timeout duration string from thetimeoutannotation member.- Returns:
- The timeout duration string. Never
null , but may be empty.
-
getRetries
Returns the method-level maximum retry attempts from theretriesannotation member.- Returns:
- The retry count.
-
isRetryNonIdempotent
Returns whether the method opts non-idempotent verbs into automatic retries (retryNonIdempotentmember).- Returns:
true if non-idempotent retries are opted in at the method level.
-
isThrowOnError
Returns whether the method throws a generic exception on an unmatched error response (throwOnErrormember).- Returns:
true ifthrowOnErroris set at the method level.
-
getUrlParamIndex
Returns the index of the@Urlparameter, or-1if none.- Returns:
- The
@Urlparameter index, or-1.
-