com.amazon.ask.dispatcher.request.handler.RequestHandler Java Examples

The following examples show how to use com.amazon.ask.dispatcher.request.handler.RequestHandler. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DefaultAlexaSkillBuilder.java    From micronaut-aws with Apache License 2.0 5 votes vote down vote up
private SkillBeans skillBeansByName(String name,
                                    Map<String, Collection<RequestHandler>> requestHandlersBySkillName,
                                    Map<String, Collection<ExceptionHandler>> exceptionHandlersBySkillName,
                                    Map<String, Collection<RequestInterceptor>> requestInterceptorsBySkillName,
                                    Map<String, Collection<ResponseInterceptor>> responseInterceptorsBySkillName,
                                    List<RequestHandler> unqualifiedRequestHandlers,
                                    List<ExceptionHandler> unqualifiedExceptionHandlers,
                                    List<RequestInterceptor> unqualifiedRequestInterceptors,
                                    List<ResponseInterceptor> unqualifiedResponseInterceptors) {
    List<RequestHandler> requestHandlers = new ArrayList<>();
    requestHandlers.addAll(unqualifiedRequestHandlers);
    if (name != null && requestHandlersBySkillName.containsKey(name)) {
        requestHandlers.addAll(requestHandlersBySkillName.get(name));
    }

    List<ExceptionHandler> exceptionHandlers = new ArrayList<>();
    exceptionHandlers.addAll(unqualifiedExceptionHandlers);
    if (name != null && exceptionHandlersBySkillName.containsKey(name)) {
        exceptionHandlers.addAll(exceptionHandlersBySkillName.get(name));
    }

    List<RequestInterceptor> requestInterceptors = new ArrayList<>();
    requestInterceptors.addAll(unqualifiedRequestInterceptors);
    if (name != null && requestInterceptorsBySkillName.containsKey(name)) {
        requestInterceptors.addAll(requestInterceptorsBySkillName.get(name));
    }

    List<ResponseInterceptor> responseInterceptors = new ArrayList<>();
    responseInterceptors.addAll(unqualifiedResponseInterceptors);
    if (name != null && responseInterceptorsBySkillName.containsKey(name)) {
        responseInterceptors.addAll(responseInterceptorsBySkillName.get(name));
    }

    return new SkillBeans(requestHandlers,
            exceptionHandlers,
            requestInterceptors,
            responseInterceptors);
}
 
Example #2
Source File: DefaultAlexaSkillBuilder.java    From micronaut-aws with Apache License 2.0 5 votes vote down vote up
public SkillBeans(List<RequestHandler> requestHandlers,
                  List<ExceptionHandler> exceptionHandlers,
                  List<RequestInterceptor> requestInterceptors,
                  List<ResponseInterceptor> responseInterceptors) {
    this.requestHandlers = requestHandlers;
    this.exceptionHandlers = exceptionHandlers;
    this.requestInterceptors = requestInterceptors;
    this.responseInterceptors = responseInterceptors;
}
 
Example #3
Source File: DefaultAlexaSkillBuilder.java    From micronaut-aws with Apache License 2.0 4 votes vote down vote up
public List<RequestHandler> getRequestHandlers() {
    return requestHandlers;
}
 
Example #4
Source File: DefaultAlexaSkillBuilder.java    From micronaut-aws with Apache License 2.0 4 votes vote down vote up
public void setRequestHandlers(List<RequestHandler> requestHandlers) {
    this.requestHandlers = requestHandlers;
}
 
Example #5
Source File: RequestHandlerGuard.java    From ask-sdk-frameworks-java with Apache License 2.0 4 votes vote down vote up
private RequestHandlerGuard(RequestHandler delegate, Predicate<HandlerInput> predicate, int priority) {
    super(delegate, predicate, priority);
}
 
Example #6
Source File: ControllerRequestMapper.java    From ask-sdk-frameworks-java with Apache License 2.0 4 votes vote down vote up
protected Stream<? extends RequestHandler> findRequestHandlers(Object controller) {
    return find(controller, skillContext.getRequestHandlerResolvers(), RequestHandlerGuard::builder);
}