[aerogear-dev] [aerogear-controller] RestEasy integration

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[aerogear-dev] [aerogear-controller] RestEasy integration

danielbevenius
Hi everyone,

we are just starting to work on the integration with RestEasy and
created the following gist with some information:
https://gist.github.com/3871798

Currently, this is basically just describing what is involved and to
make sure that we all know what the goals are.
I'll post to this thread whenever any work that might be of interest
has happend.

cheers,

/Dan
_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] [aerogear-controller] RestEasy integration

danielbevenius
Hi!

I've updated the gist (https://gist.github.com/3871798) with the progress made.
aerogear-controller-demo is being used do demonstrate what is
currently there, and hopefully this will be easier to discuss when
seeing some code.

cheers,

/Dan
_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] [aerogear-controller] RestEasy integration

danielbevenius
In reply to this post by danielbevenius
Hi everyone,

I've updated the section "Programmatic endpoint configuration in
RestEasy" in the gist (https://gist.github.com/3871798) with progress
made the last few days. Hopefully this will explain how the current
configuration works and what options it supports.

If this looks alright, I'll shift focus back to aerogear-controller,
and look into adding support for things like query/form/header
parameters etc. This will enable us to update aerogear-controller demo
with more examples and that way get a better feel for how using the
programmatic configuration works in real life as opposed to tests.

cheers,

/Dan
_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] [aerogear-controller] RestEasy integration

Bruno Oliveira
Awesome Daniel, 

Do you have something in mind for HTTP responses?


-- 
"The measure of a man is what he does with power" - Plato
-
@abstractj
-
Volenti Nihil Difficile

On Friday, October 19, 2012 at 9:24 AM, Daniel Bevenius wrote:

Hi everyone,

I've updated the section "Programmatic endpoint configuration in
RestEasy" in the gist (https://gist.github.com/3871798) with progress
made the last few days. Hopefully this will explain how the current
configuration works and what options it supports.

If this looks alright, I'll shift focus back to aerogear-controller,
and look into adding support for things like query/form/header
parameters etc. This will enable us to update aerogear-controller demo
with more examples and that way get a better feel for how using the
programmatic configuration works in real life as opposed to tests.

cheers,

/Dan
_______________________________________________
aerogear-dev mailing list


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] [aerogear-controller] RestEasy integration

danielbevenius
> Do you have something in mind for HTTP responses?
At the moment, the only support for responses is taking what is
returned from the target method, and depending on what the value of
'produces' is and what the client requested, that type will be
returned.
This is what one of the RESTful routes looks like in aerogear-controller-demo:
route()
         .from("/hello2")
         .consumes("*/*")
         .on(RequestMethod.GET)
         .produces("application/json")
         .to(HelloRest.class).hello(queryParam(String.class,
"firstname"), queryParam(String.class, "lastname"));

So, this produces a JSON response and RestEasy will to this mapping:
curl -i  "http://localhost:8080/aerogear-controller-demo/hello2?firstname=Daniel&lastname=Bevenius"
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: application/json
Transfer-Encoding: chunked
Date: Mon, 22 Oct 2012 13:19:15 GMT

{"msg":"Hello Daniel Bevenius"}

We can certainly add other things and if you let me know what you'd
like to see I'll take a stab at it.
Perhaps we could have something like this:
route()
         .from("/hello2")
         .consumes("*/*")
         .on(RequestMethod.GET)
         .produces("application/json")
         .response(statusCodeMethodName(msg))
         .to(HelloRest.class).hello(queryParam(String.class,
"firstname"), queryParam(String.class, "lastname"));

What do you think?



On 22 October 2012 15:06, Bruno Oliveira <[hidden email]> wrote:

> Awesome Daniel,
>
> Do you have something in mind for HTTP responses?
>
>
> --
> "The measure of a man is what he does with power" - Plato
> -
> @abstractj
> -
> Volenti Nihil Difficile
>
> On Friday, October 19, 2012 at 9:24 AM, Daniel Bevenius wrote:
>
> Hi everyone,
>
> I've updated the section "Programmatic endpoint configuration in
> RestEasy" in the gist (https://gist.github.com/3871798) with progress
> made the last few days. Hopefully this will explain how the current
> configuration works and what options it supports.
>
> If this looks alright, I'll shift focus back to aerogear-controller,
> and look into adding support for things like query/form/header
> parameters etc. This will enable us to update aerogear-controller demo
> with more examples and that way get a better feel for how using the
> programmatic configuration works in real life as opposed to tests.
>
> cheers,
>
> /Dan
> _______________________________________________
> aerogear-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>
>
>
> _______________________________________________
> aerogear-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>
_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] [aerogear-controller] RestEasy integration

Bruno Oliveira
Maybe allow our users to programatically specify it, but is not high priority now, I just asked to know.

Let's think about it later and move forward/stabilise the integration with Resteasy before.

Great work Daniel!

-- 
"The measure of a man is what he does with power" - Plato
-
@abstractj
-
Volenti Nihil Difficile

On Monday, October 22, 2012 at 11:25 AM, Daniel Bevenius wrote:

Do you have something in mind for HTTP responses?
At the moment, the only support for responses is taking what is
returned from the target method, and depending on what the value of
'produces' is and what the client requested, that type will be
returned.
This is what one of the RESTful routes looks like in aerogear-controller-demo:
route()
.from("/hello2")
.consumes("*/*")
.on(RequestMethod.GET)
.produces("application/json")
.to(HelloRest.class).hello(queryParam(String.class,
"firstname"), queryParam(String.class, "lastname"));

So, this produces a JSON response and RestEasy will to this mapping:
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: application/json
Transfer-Encoding: chunked
Date: Mon, 22 Oct 2012 13:19:15 GMT

{"msg":"Hello Daniel Bevenius"}

We can certainly add other things and if you let me know what you'd
like to see I'll take a stab at it.
Perhaps we could have something like this:
route()
.from("/hello2")
.consumes("*/*")
.on(RequestMethod.GET)
.produces("application/json")
.response(statusCodeMethodName(msg))
.to(HelloRest.class).hello(queryParam(String.class,
"firstname"), queryParam(String.class, "lastname"));

What do you think?



On 22 October 2012 15:06, Bruno Oliveira <[hidden email]> wrote:
Awesome Daniel,

Do you have something in mind for HTTP responses?


--
"The measure of a man is what he does with power" - Plato
-
@abstractj
-
Volenti Nihil Difficile

On Friday, October 19, 2012 at 9:24 AM, Daniel Bevenius wrote:

Hi everyone,

I've updated the section "Programmatic endpoint configuration in
RestEasy" in the gist (https://gist.github.com/3871798) with progress
made the last few days. Hopefully this will explain how the current
configuration works and what options it supports.

If this looks alright, I'll shift focus back to aerogear-controller,
and look into adding support for things like query/form/header
parameters etc. This will enable us to update aerogear-controller demo
with more examples and that way get a better feel for how using the
programmatic configuration works in real life as opposed to tests.

cheers,

/Dan
_______________________________________________
aerogear-dev mailing list



_______________________________________________
aerogear-dev mailing list
_______________________________________________
aerogear-dev mailing list


_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] [aerogear-controller] RestEasy integration

danielbevenius
>Maybe allow our users to programatically specify it, but is not high priority now, I just asked to know.
Yeah, we'll need this for sure. I'm going to look into this, hopefully
later this week.

I've updated the section "Configuration of REST routes in AeroGear
Controller", which shows some example REST routes using various return
types and arguments.

cheers,

/Dan

On 22 October 2012 16:26, Bruno Oliveira <[hidden email]> wrote:

> Maybe allow our users to programatically specify it, but is not high
> priority now, I just asked to know.
>
> Let's think about it later and move forward/stabilise the integration with
> Resteasy before.
>
> Great work Daniel!
>
> --
> "The measure of a man is what he does with power" - Plato
> -
> @abstractj
> -
> Volenti Nihil Difficile
>
> On Monday, October 22, 2012 at 11:25 AM, Daniel Bevenius wrote:
>
> Do you have something in mind for HTTP responses?
>
> At the moment, the only support for responses is taking what is
> returned from the target method, and depending on what the value of
> 'produces' is and what the client requested, that type will be
> returned.
> This is what one of the RESTful routes looks like in
> aerogear-controller-demo:
> route()
> .from("/hello2")
> .consumes("*/*")
> .on(RequestMethod.GET)
> .produces("application/json")
> .to(HelloRest.class).hello(queryParam(String.class,
> "firstname"), queryParam(String.class, "lastname"));
>
> So, this produces a JSON response and RestEasy will to this mapping:
> curl -i
> "http://localhost:8080/aerogear-controller-demo/hello2?firstname=Daniel&lastname=Bevenius"
> HTTP/1.1 200 OK
> Server: Apache-Coyote/1.1
> Content-Type: application/json
> Transfer-Encoding: chunked
> Date: Mon, 22 Oct 2012 13:19:15 GMT
>
> {"msg":"Hello Daniel Bevenius"}
>
> We can certainly add other things and if you let me know what you'd
> like to see I'll take a stab at it.
> Perhaps we could have something like this:
> route()
> .from("/hello2")
> .consumes("*/*")
> .on(RequestMethod.GET)
> .produces("application/json")
> .response(statusCodeMethodName(msg))
> .to(HelloRest.class).hello(queryParam(String.class,
> "firstname"), queryParam(String.class, "lastname"));
>
> What do you think?
>
>
>
> On 22 October 2012 15:06, Bruno Oliveira <[hidden email]> wrote:
>
> Awesome Daniel,
>
> Do you have something in mind for HTTP responses?
>
>
> --
> "The measure of a man is what he does with power" - Plato
> -
> @abstractj
> -
> Volenti Nihil Difficile
>
> On Friday, October 19, 2012 at 9:24 AM, Daniel Bevenius wrote:
>
> Hi everyone,
>
> I've updated the section "Programmatic endpoint configuration in
> RestEasy" in the gist (https://gist.github.com/3871798) with progress
> made the last few days. Hopefully this will explain how the current
> configuration works and what options it supports.
>
> If this looks alright, I'll shift focus back to aerogear-controller,
> and look into adding support for things like query/form/header
> parameters etc. This will enable us to update aerogear-controller demo
> with more examples and that way get a better feel for how using the
> programmatic configuration works in real life as opposed to tests.
>
> cheers,
>
> /Dan
> _______________________________________________
> aerogear-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>
>
>
> _______________________________________________
> aerogear-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>
> _______________________________________________
> aerogear-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>
>
>
> _______________________________________________
> aerogear-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>
_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev