Class RequestUtil


  • public class RequestUtil
    extends Object
    Utility methods for handling requests.
    • Field Detail

      • ATOM_DATE_FORMAT

        public static final String ATOM_DATE_FORMAT
        date format used internally by the Boomi Atom
        See Also:
        Constant Field Values
    • Method Detail

      • parseAtomDateString

        public static Date parseAtomDateString​(String dateStr)
                                        throws ParseException
        Returns a Date parsed from a date string formatted using the Boomi Atom internal date format "yyyyMMdd HHmmss.SSS". Useful for handling date strings passed into a connector as query parameters.
        Parameters:
        dateStr - the date string to parse, may be null
        Returns:
        a valid Date, or null if the given date string was blank or null
        Throws:
        ParseException
      • setCurrentContextClassLoader

        public static void setCurrentContextClassLoader​(ClassLoader loader)
        Sets the context ClassLoader of the current thread (calls Thread.setContextClassLoader(java.lang.ClassLoader)). Note, however, that this call is made with the security context of the Connector SDK only, and therefore will succeed when a direct call to will fail.
        Parameters:
        loader - the new context ClassLoader for the current thread
      • getCurrentContextClassLoader

        public static ClassLoader getCurrentContextClassLoader()
        Returns the ClassLoader for the current thread (calls Thread.getContextClassLoader()).
        Returns:
        the context ClassLoader for the current thread
      • pageIterable

        public static <T> Iterable<List<T>> pageIterable​(Iterable<T> iterable,
                                                         int connectorMaxPageSize,
                                                         AtomConfig config)
        Returns an Iterable which generates "pages" of elements from the given Iterable. The pageSize is the minimum of the given connectorPageSize and the AtomConfig maximum page size.
        Parameters:
        iterable - source Iterable of elements
        connectorMaxPageSize - max connector page size
        config - atom configuration
        Returns:
        Iterable which generates pages of elements
      • pageIterable

        public static <T> Iterable<List<T>> pageIterable​(Iterable<T> iterable,
                                                         AtomConfig config)
        Returns an Iterable which generates "pages" of elements from the given Iterable. The pageSize is the AtomConfig maximum page size.
        Parameters:
        iterable - source Iterable of elements
        config - atom configuration
        Returns:
        Iterable which generates pages of elements