Class FaaSWebClient

  • All Implemented Interfaces:
    FaaSClient

    public class FaaSWebClient
    extends Object
    implements FaaSClient
    FaaS web client for invoking lambdas of a account/brand over the eventsource gateway / asgard
    Author:
    sschwarz, arotaru
    • Method Detail

      • invokeByUUID

        public <T> T invokeByUUID​(String externalSystem,
                                  String lambdaUUID,
                                  FaaSInvocation data,
                                  Class<T> responseType,
                                  OptionalParams optionalParams)
                           throws FaaSException
        Description copied from interface: FaaSClient
        Invoking a lambda per brand via the RESTful api by lambda UUID
        Specified by:
        invokeByUUID in interface FaaSClient
        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

        public void invokeByUUID​(String externalSystem,
                                 String lambdaUUID,
                                 FaaSInvocation data,
                                 OptionalParams optionalParams)
                          throws FaaSException
        Description copied from interface: FaaSClient
        Invoking a lambda per brand via the RESTful api by lambda UUID but does not return response of invocation
        Specified by:
        invokeByUUID in interface FaaSClient
        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
      • invokeByEvent

        public <T> T invokeByEvent​(String externalSystem,
                                   FaaSEvent event,
                                   FaaSInvocation data,
                                   Class<T> responseType,
                                   OptionalParams optionalParams)
                            throws FaaSException
        Description copied from interface: FaaSClient
        Invoking a lambda per brand via the RESTful api by event ID
        Specified by:
        invokeByEvent in interface FaaSClient
        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

        public <T> T invokeByEvent​(String externalSystem,
                                   String event,
                                   FaaSInvocation data,
                                   Class<T> responseType,
                                   OptionalParams optionalParams)
                            throws FaaSException
        Description copied from interface: FaaSClient
        Invoking a lambda per brand via the RESTful api by event ID
        Specified by:
        invokeByEvent in interface FaaSClient
        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

        public void invokeByEvent​(String externalSystem,
                                  FaaSEvent event,
                                  FaaSInvocation data,
                                  OptionalParams optionalParams)
                           throws FaaSException
        Description copied from interface: FaaSClient
        Invoking a lambda per brand via the RESTful api by event ID but does not return response of invocation
        Specified by:
        invokeByEvent in interface FaaSClient
        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

        public void invokeByEvent​(String externalSystem,
                                  String event,
                                  FaaSInvocation data,
                                  OptionalParams optionalParams)
                           throws FaaSException
        Description copied from interface: FaaSClient
        Invoking a lambda per brand via the RESTful api by event ID but does not return response of invocation
        Specified by:
        invokeByEvent in interface FaaSClient
        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
      • isImplemented

        public boolean isImplemented​(String externalSystem,
                                     FaaSEvent event,
                                     OptionalParams optionalParams)
                              throws FaaSException
        Description copied from interface: FaaSClient
        Checking if lambda implementation exist for a given event
        Specified by:
        isImplemented in interface FaaSClient
        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

        public boolean isImplemented​(String externalSystem,
                                     String event,
                                     OptionalParams optionalParams)
                              throws FaaSException
        Description copied from interface: FaaSClient
        Checking if lambda implementation exist for a given event
        Specified by:
        isImplemented in interface FaaSClient
        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

        public List<LambdaResponse> getLambdas​(String userId,
                                               Map<String,​String> optionalQueryParams,
                                               OptionalParams optionalParams)
                                        throws FaaSException
        Description copied from interface: FaaSClient
        Get a list of lambdas. Filters can be applied by state, eventId or name. EventId and name supports substring.
        Specified by:
        getLambdas in interface FaaSClient
        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