Class AbstractApiConsumer<E extends Enum<E> & ApiName,​T>

    • Constructor Detail

      • AbstractApiConsumer

        public AbstractApiConsumer​(AbstractApiEndpoint<E,​T> endpoint,
                                   org.apache.camel.Processor processor)
    • Method Detail

      • poll

        protected int poll()
                    throws Exception
        Description copied from class: ScheduledPollConsumer
        The polling method which is invoked periodically to poll this consumer
        Specified by:
        poll in class ScheduledPollConsumer
        Returns:
        number of messages polled, will be 0 if no message was polled at all.
        Throws:
        Exception - can be thrown if an exception occurred during polling
      • interceptPropertyNames

        public void interceptPropertyNames​(Set<String> propertyNames)
        Description copied from interface: PropertyNamesInterceptor
        Intercept property names used to find API Method. Used to add any custom/hidden method arguments, which MUST be provided in interceptProperties() override.
        Specified by:
        interceptPropertyNames in interface PropertyNamesInterceptor
        Parameters:
        propertyNames - argument names.
      • interceptProperties

        public void interceptProperties​(Map<String,​Object> properties)
        Description copied from interface: PropertiesInterceptor
        Intercept method invocation arguments used to find and invoke API method. Can be overridden to add custom/hidden method arguments.
        Specified by:
        interceptProperties in interface PropertiesInterceptor
        Parameters:
        properties - method invocation arguments.
      • doInvokeMethod

        protected Object doInvokeMethod​(Map<String,​Object> args)
        Invoke the API method. This method can be overridden, for example to synchronize API calls for thread-unsafe proxies. Derived class MUST call super.doInvokeMethod() to invoke the API method.
        Parameters:
        args - method arguments from endpoint parameters.
        Returns:
        method invocation result.
      • splitResult

        public Object splitResult​(Object result)
        Description copied from interface: ResultInterceptor
        Split a complex result into result elements.
        Specified by:
        splitResult in interface ResultInterceptor
        Parameters:
        result - API method invocation result
        Returns:
        either the same result if it cannot be split, an array or collection object with split results
      • interceptResult

        public void interceptResult​(Object result,
                                    org.apache.camel.Exchange resultExchange)
        Description copied from interface: ResultInterceptor
        Do additional result exchange processing, for example, adding custom headers.
        Specified by:
        interceptResult in interface ResultInterceptor
        Parameters:
        result - result of API method invocation.
        resultExchange - result as a Camel exchange, may be a split result from Arrays or Collections.
      • isSplitResult

        public final boolean isSplitResult()
      • setSplitResult

        public final void setSplitResult​(boolean splitResult)