Class LambdaRestMounter

    • Constructor Detail

      • LambdaRestMounter

        public LambdaRestMounter​(org.apache.wicket.protocol.http.WebApplication application)
        Constructor for the mounter.
        Parameters:
        application - The web application we are using.
    • Method Detail

      • post

        public void post​(String path,
                         Function<org.wicketstuff.restutils.wicket.AttributesWrapper,​Object> respondFunction,
                         Function<Object,​String> outputFunction)
        Mount a TextOutputLambdaResource to the given path and for HTTP method POST.
        Parameters:
        path - the mounting path
        respondFunction - the respond function
        outputFunction - the output function
      • post

        public void post​(String path,
                         Consumer<org.wicketstuff.restutils.wicket.AttributesWrapper> respondConsumer)
        Mount a SimpleLambdaResource to the given path and for HTTP method POST.
        Parameters:
        path - the mounting path
        respondConsumer - the respond consumer
      • get

        public void get​(String path,
                        Function<org.wicketstuff.restutils.wicket.AttributesWrapper,​Object> respondFunction,
                        Function<Object,​String> outputFunction)
        Mount a TextOutputLambdaResource to the given path and for HTTP method GET.
        Parameters:
        path - the mounting path
        respondFunction - the respond function
        outputFunction - the output function
      • get

        public void get​(String path,
                        Consumer<org.wicketstuff.restutils.wicket.AttributesWrapper> respondConsumer)
        Mount a SimpleLambdaResource to the given path and for HTTP method GET.
        Parameters:
        path - the mounting path
        respondConsumer - the respond consumer
      • put

        public void put​(String path,
                        Consumer<org.wicketstuff.restutils.wicket.AttributesWrapper> respondConsumer)
        Mount a SimpleLambdaResource to the given path and for HTTP method PUT.
        Parameters:
        path - the mounting path
        respondConsumer - the respond consumer
      • put

        public void put​(String path,
                        Function<org.wicketstuff.restutils.wicket.AttributesWrapper,​Object> respondFunction,
                        Function<Object,​String> outputFunction)
        Mount a TextOutputLambdaResource to the given path and for HTTP method PUT.
        Parameters:
        path - the mounting path
        respondFunction - the respond function
        outputFunction - the output function
      • delete

        public void delete​(String path,
                           Consumer<org.wicketstuff.restutils.wicket.AttributesWrapper> respondConsumer)
        Mount a SimpleLambdaResource to the given path and for HTTP method DELETE.
        Parameters:
        path - the mounting path
        respondConsumer - the respond consumer
      • delete

        public void delete​(String path,
                           Function<org.wicketstuff.restutils.wicket.AttributesWrapper,​Object> respondFunction,
                           Function<Object,​String> outputFunction)
        Mount a TextOutputLambdaResource to the given path and for HTTP method DELETE.
        Parameters:
        path - the mounting path
        respondFunction - the respond function
        outputFunction - the output function
      • options

        public void options​(String path,
                            Consumer<org.wicketstuff.restutils.wicket.AttributesWrapper> respondConsumer)
        Mount a SimpleLambdaResource to the given path and for HTTP method OPTIONS.
        Parameters:
        path - the mounting path
        respondConsumer - the respond consumer
      • options

        public void options​(String path,
                            Function<org.wicketstuff.restutils.wicket.AttributesWrapper,​Object> respondFunction,
                            Function<Object,​String> outputFunction)
        Mount a TextOutputLambdaResource to the given path and for HTTP method OPTIONS.
        Parameters:
        path - the mounting path
        respondFunction - the respond function
        outputFunction - the output function
      • patch

        public void patch​(String path,
                          Consumer<org.wicketstuff.restutils.wicket.AttributesWrapper> respondConsumer)
        Mount a SimpleLambdaResource to the given path and for HTTP method PATCH.
        Parameters:
        path - the mounting path
        respondConsumer - the respond consumer
      • patch

        public void patch​(String path,
                          Function<org.wicketstuff.restutils.wicket.AttributesWrapper,​Object> respondFunction,
                          Function<Object,​String> outputFunction)
        Mount a TextOutputLambdaResource to the given path and for HTTP method PATCH.
        Parameters:
        path - the mounting path
        respondFunction - the respond function
        outputFunction - the output function
      • head

        public void head​(String path,
                         Consumer<org.wicketstuff.restutils.wicket.AttributesWrapper> respondConsumer)
        Mount a SimpleLambdaResource to the given path and for HTTP method HEAD.
        Parameters:
        path - the mounting path
        respondConsumer - the respond consumer
      • head

        public void head​(String path,
                         Function<org.wicketstuff.restutils.wicket.AttributesWrapper,​Object> respondFunction,
                         Function<Object,​String> outputFunction)
        Mount a TextOutputLambdaResource to the given path and for HTTP method HEAD.
        Parameters:
        path - the mounting path
        respondFunction - the respond function
        outputFunction - the output function
      • trace

        public void trace​(String path,
                          Consumer<org.wicketstuff.restutils.wicket.AttributesWrapper> respondConsumer)
        Mount a SimpleLambdaResource to the given path and for HTTP method TRACE.
        Parameters:
        path - the mounting path
        respondConsumer - the respond consumer
      • trace

        public void trace​(String path,
                          Function<org.wicketstuff.restutils.wicket.AttributesWrapper,​Object> respondFunction,
                          Function<Object,​String> outputFunction)
        Mount a TextOutputLambdaResource to the given path and for HTTP method TRACE.
        Parameters:
        path - the mounting path
        respondFunction - the respond function
        outputFunction - the output function
      • mountRestResource

        public org.apache.wicket.core.request.mapper.ResourceMapper mountRestResource​(org.wicketstuff.restutils.http.HttpMethod httpMethod,
                                                                                      String path,
                                                                                      Function<org.wicketstuff.restutils.wicket.AttributesWrapper,​Object> respondFunction,
                                                                                      Function<Object,​String> outputFunction)
        Mount a TextOutputLambdaResource to the given path and for the given http method
        Parameters:
        httpMethod - the http method
        path - the mounting path
        respondFunction - the respond function
        outputFunction - the output function
        Returns:
        the resource mapper
      • mountRestResource

        public org.apache.wicket.core.request.mapper.ResourceMapper mountRestResource​(org.wicketstuff.restutils.http.HttpMethod httpMethod,
                                                                                      String path,
                                                                                      Consumer<org.wicketstuff.restutils.wicket.AttributesWrapper> respondConsumer)
        Mount a SimpleLambdaResource to the given path and for the given http method
        Parameters:
        httpMethod - the http method
        path - the mounting path
        respondConsumer - the respond consumer
        Returns:
        the resource mapper
      • mountRestResource

        protected org.apache.wicket.core.request.mapper.ResourceMapper mountRestResource​(org.wicketstuff.restutils.http.HttpMethod httpMethod,
                                                                                         String path,
                                                                                         org.apache.wicket.request.resource.IResource resource)
        Mount rest resource.
        Parameters:
        httpMethod - the http method
        path - the mounting path
        resource - the resource
        Returns:
        the resource mapper