Package com.liveperson.faas.client
Class FaaSWebClient
- java.lang.Object
-
- com.liveperson.faas.client.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFaaSWebClient.Builder
-
Field Summary
Fields Modifier and Type Field Description static StringCSDS_GW_SERVICE_NAMEstatic StringCSDS_UI_SERVICE_NAMEstatic StringQUERY_PARAM_EVENT_IDstatic StringQUERY_PARAM_NAMEstatic StringQUERY_PARAM_STATE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<LambdaResponse>getLambdas(String userId, Map<String,String> optionalQueryParams, OptionalParams optionalParams)Get a list of lambdas.voidinvokeByEvent(String externalSystem, FaaSEvent event, FaaSInvocation data, OptionalParams optionalParams)Invoking a lambda per brand via the RESTful api by event ID but does not return response of invocation<T> TinvokeByEvent(String externalSystem, FaaSEvent event, FaaSInvocation data, Class<T> responseType, OptionalParams optionalParams)Invoking a lambda per brand via the RESTful api by event IDvoidinvokeByEvent(String externalSystem, String event, FaaSInvocation data, OptionalParams optionalParams)Invoking a lambda per brand via the RESTful api by event ID but does not return response of invocation<T> TinvokeByEvent(String externalSystem, String event, FaaSInvocation data, Class<T> responseType, OptionalParams optionalParams)Invoking a lambda per brand via the RESTful api by event IDvoidinvokeByUUID(String externalSystem, String lambdaUUID, FaaSInvocation data, OptionalParams optionalParams)Invoking a lambda per brand via the RESTful api by lambda UUID but does not return response of invocation<T> TinvokeByUUID(String externalSystem, String lambdaUUID, FaaSInvocation data, Class<T> responseType, OptionalParams optionalParams)Invoking a lambda per brand via the RESTful api by lambda UUIDbooleanisImplemented(String externalSystem, FaaSEvent event, OptionalParams optionalParams)Checking if lambda implementation exist for a given eventbooleanisImplemented(String externalSystem, String event, OptionalParams optionalParams)Checking if lambda implementation exist for a given event
-
-
-
Field Detail
-
CSDS_GW_SERVICE_NAME
public static final String CSDS_GW_SERVICE_NAME
- See Also:
- Constant Field Values
-
CSDS_UI_SERVICE_NAME
public static final String CSDS_UI_SERVICE_NAME
- See Also:
- Constant Field Values
-
QUERY_PARAM_STATE
public static final String QUERY_PARAM_STATE
- See Also:
- Constant Field Values
-
QUERY_PARAM_EVENT_ID
public static final String QUERY_PARAM_EVENT_ID
- See Also:
- Constant Field Values
-
QUERY_PARAM_NAME
public static final String QUERY_PARAM_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
invokeByUUID
public <T> T invokeByUUID(String externalSystem, String lambdaUUID, FaaSInvocation data, Class<T> responseType, OptionalParams optionalParams) throws FaaSException
Description copied from interface:FaaSClientInvoking a lambda per brand via the RESTful api by lambda UUID- Specified by:
invokeByUUIDin interfaceFaaSClient- Type Parameters:
T- Class of the response type- Parameters:
externalSystem- the name of the external system doing the invocationlambdaUUID- the global unique identifier of a lambdadata- the invocation payload containing timestamp (ms), headers and payload send to the lambdaresponseType- the type of the response objectoptionalParams- 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:FaaSClientInvoking a lambda per brand via the RESTful api by lambda UUID but does not return response of invocation- Specified by:
invokeByUUIDin interfaceFaaSClient- Parameters:
externalSystem- the name of the external system doing the invocationlambdaUUID- the global unique identifier of a lambdadata- the invocation payload containing timestamp (ms), headers and payload send to the lambdaoptionalParams- 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:FaaSClientInvoking a lambda per brand via the RESTful api by event ID- Specified by:
invokeByEventin interfaceFaaSClient- Type Parameters:
T- Class of the response type- Parameters:
externalSystem- the name of the external system doing the invocationevent- the faas eventdata- the invocation payload containing timestamp (ms), headers and payload send to the lambdaresponseType- the type of the response objectoptionalParams- 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:FaaSClientInvoking a lambda per brand via the RESTful api by event ID- Specified by:
invokeByEventin interfaceFaaSClient- Type Parameters:
T- Class of the response type- Parameters:
externalSystem- the name of the external system doing the invocationevent- the faas eventdata- the invocation payload containing timestamp (ms), headers and payload send to the lambdaresponseType- the type of the response objectoptionalParams- 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:FaaSClientInvoking a lambda per brand via the RESTful api by event ID but does not return response of invocation- Specified by:
invokeByEventin interfaceFaaSClient- Parameters:
externalSystem- the name of the external system doing the invocationevent- the faas eventdata- the invocation payload containing timestamp (ms), headers and payload send to the lambdaoptionalParams- 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:FaaSClientInvoking a lambda per brand via the RESTful api by event ID but does not return response of invocation- Specified by:
invokeByEventin interfaceFaaSClient- Parameters:
externalSystem- the name of the external system doing the invocationevent- the faas eventdata- the invocation payload containing timestamp (ms), headers and payload send to the lambdaoptionalParams- 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:FaaSClientChecking if lambda implementation exist for a given event- Specified by:
isImplementedin interfaceFaaSClient- Parameters:
externalSystem- the name of the external system doing the invocationevent- the faas eventoptionalParams- 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:FaaSClientChecking if lambda implementation exist for a given event- Specified by:
isImplementedin interfaceFaaSClient- Parameters:
externalSystem- the name of the external system doing the invocationevent- the faas eventoptionalParams- 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:FaaSClientGet a list of lambdas. Filters can be applied by state, eventId or name. EventId and name supports substring.- Specified by:
getLambdasin interfaceFaaSClient- Parameters:
userId- LE user idoptionalQueryParams- optional query params that are used for filtering - supported params: state, eventId, nameoptionalParams- 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
-
-