Class ApiConsumerHelper
java.lang.Object
org.apache.camel.support.component.ApiConsumerHelper
Utility class for API Consumers.
-
Method Summary
Modifier and TypeMethodDescriptionfindMethod(AbstractApiEndpoint<E, T> endpoint, PropertyNamesInterceptor propertyNamesInterceptor) Utility method to find matching API Method for supplied endpoint's configuration properties.static <T extends DefaultConsumer & ResultInterceptor>
intgetResultsProcessed(T consumer, Object result, boolean splitResult) Utility method for Consumers to process API method invocation result.
-
Method Details
-
findMethod
public static <E extends Enum<E> & ApiName,T> ApiMethod findMethod(AbstractApiEndpoint<E, T> endpoint, PropertyNamesInterceptor propertyNamesInterceptor) Utility method to find matching API Method for supplied endpoint's configuration properties.- Type Parameters:
E- ApiName enumeration.T- Component configuration class.- Parameters:
endpoint- endpoint for configuration properties.propertyNamesInterceptor- names interceptor for adapting property names, usually the consumer class itself.- Returns:
- matching ApiMethod.
-
getResultsProcessed
public static <T extends DefaultConsumer & ResultInterceptor> int getResultsProcessed(T consumer, Object result, boolean splitResult) throws Exception Utility method for Consumers to process API method invocation result.- Type Parameters:
T- Consumer class that extends DefaultConsumer and implementsResultInterceptor.- Parameters:
consumer- Consumer that wants to process results.result- result of API method invocation.splitResult- true if the Consumer wants to split result usingResultInterceptor.splitResult(Object)method.- Returns:
- number of result exchanges processed.
- Throws:
Exception- on error.
-