Interface FaaSClient

  • All Known Implementing Classes:
    FaaSWebClient

    public interface FaaSClient
    FaaS client for invoking lambdas of a account/brand
    Author:
    sschwarz, arotaru
    • Method Detail

      • invokeByEvent

        <T> T invokeByEvent​(String externalSystem,
                            FaaSEvent event,
                            FaaSInvocation data,
                            Class<T> responseType,
                            OptionalParams optionalParams)
                     throws FaaSException
        Invoking a lambda per brand via the RESTful api by event ID
        Type Parameters:
        T - Class of the response type
        Parameters:
        externalSystem - the name of the external system doing the invocation
        event - the faas event
        data - the invocation payload containing timestamp (ms), headers and payload send to the lambda
        responseType - the type of the response object
        optionalParams - optional Parameters for request - requestId and timeOuts
        Returns:
        the response object of type responseType
        Throws:
        FaaSException - when error occurs during lambda invocation
      • invokeByEvent

        <T> T invokeByEvent​(String externalSystem,
                            String event,
                            FaaSInvocation data,
                            Class<T> responseType,
                            OptionalParams optionalParams)
                     throws FaaSException
        Invoking a lambda per brand via the RESTful api by event ID
        Type Parameters:
        T - Class of the response type
        Parameters:
        externalSystem - the name of the external system doing the invocation
        event - the faas event
        data - the invocation payload containing timestamp (ms), headers and payload send to the lambda
        responseType - the type of the response object
        optionalParams - optional Parameters for request - requestId and timeOut
        Returns:
        the response object of type responseType
        Throws:
        FaaSException - when error occurs during lambda invocation
      • invokeByEvent

        void invokeByEvent​(String externalSystem,
                           FaaSEvent event,
                           FaaSInvocation data,
                           OptionalParams optionalParams)
                    throws FaaSException
        Invoking a lambda per brand via the RESTful api by event ID but does not return response of invocation
        Parameters:
        externalSystem - the name of the external system doing the invocation
        event - the faas event
        data - the invocation payload containing timestamp (ms), headers and payload send to the lambda
        optionalParams - optional Parameters for request - requestId and timeOut
        Throws:
        FaaSException - when error occurs during lambda invocation
      • invokeByEvent

        void invokeByEvent​(String externalSystem,
                           String event,
                           FaaSInvocation data,
                           OptionalParams optionalParams)
                    throws FaaSException
        Invoking a lambda per brand via the RESTful api by event ID but does not return response of invocation
        Parameters:
        externalSystem - the name of the external system doing the invocation
        event - the faas event
        data - the invocation payload containing timestamp (ms), headers and payload send to the lambda
        optionalParams - optional Parameters for request - requestId and timeOut
        Throws:
        FaaSException - when error occurs during lambda invocation
      • invokeByUUID

        <T> T invokeByUUID​(String externalSystem,
                           String lambdaUUID,
                           FaaSInvocation data,
                           Class<T> responseType,
                           OptionalParams optionalParams)
                    throws FaaSException
        Invoking a lambda per brand via the RESTful api by lambda UUID
        Type Parameters:
        T - Class of the response type
        Parameters:
        externalSystem - the name of the external system doing the invocation
        lambdaUUID - the global unique identifier of a lambda
        data - the invocation payload containing timestamp (ms), headers and payload send to the lambda
        responseType - the type of the response object
        optionalParams - optional Parameters for request - requestId and timeOuts
        Returns:
        the response object of type responseType
        Throws:
        FaaSException - when error occurs during lambda invocation
      • invokeByUUID

        void invokeByUUID​(String externalSystem,
                          String lambdaUUID,
                          FaaSInvocation data,
                          OptionalParams optionalParams)
                   throws FaaSException
        Invoking a lambda per brand via the RESTful api by lambda UUID but does not return response of invocation
        Parameters:
        externalSystem - the name of the external system doing the invocation
        lambdaUUID - the global unique identifier of a lambda
        data - the invocation payload containing timestamp (ms), headers and payload send to the lambda
        optionalParams - optional Parameters for request - requestId and timeOut
        Throws:
        FaaSException - when error occurs during lambda invocation
      • isImplemented

        boolean isImplemented​(String externalSystem,
                              FaaSEvent event,
                              OptionalParams optionalParams)
                       throws FaaSException
        Checking if lambda implementation exist for a given event
        Parameters:
        externalSystem - the name of the external system doing the invocation
        event - the faas event
        optionalParams - optional Parameters for request - requestId and timeOut
        Returns:
        boolean
        Throws:
        FaaSException - when error occurs during isImplemented request
      • isImplemented

        boolean isImplemented​(String externalSystem,
                              String event,
                              OptionalParams optionalParams)
                       throws FaaSException
        Checking if lambda implementation exist for a given event
        Parameters:
        externalSystem - the name of the external system doing the invocation
        event - the faas event
        optionalParams - optional Parameters for request - requestId and timeOut
        Returns:
        boolean
        Throws:
        FaaSException - when error occurs during isImplemented request
      • getLambdas

        List<LambdaResponse> getLambdas​(String userId,
                                        Map<String,​String> optionalQueryParams,
                                        OptionalParams optionalParams)
                                 throws FaaSException
        Get a list of lambdas. Filters can be applied by state, eventId or name. EventId and name supports substring.
        Parameters:
        userId - LE user id
        optionalQueryParams - optional query params that are used for filtering - supported params: state, eventId, name
        optionalParams - optional Parameters for request - requestId and timeOut
        Returns:
        A list of lambdas that belong that the above account filtered by the optionalQueryParams
        Throws:
        FaaSException - when error occurs during getLambda request