You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Ranabroto <ra...@globalcharge.com> on 2014/02/13 19:42:57 UTC
Retrieve Caller Ip Address
HI all I am new in Camel
I have a reslet api like below
<from uri="restlet:/getmsisdn?restletMethods=GET,POST" />
How can i get the caller ip address..? I have checked message header and
body, but didnt find the client ip address
Please help me
--
View this message in context: http://camel.465427.n5.nabble.com/Retrieve-Caller-Ip-Address-tp5747272.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Retrieve Caller Ip Address
Posted by Ranabroto <ra...@globalcharge.com>.
Hi
Thank you so much :) it worked perfectly
--
View this message in context: http://camel.465427.n5.nabble.com/Retrieve-Caller-Ip-Address-Camel-Reslet-tp5747272p5747367.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Retrieve Caller Ip Address
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
You should have access to the Restlet request from a Camel header. For
example from a Camel processor you can do this code:
public void process(Exchange exchange) {
Request request =
exchange.getIn().getHeader(RestletConstants.RESTLET_REQUEST,
Request.class);
..
}
On Fri, Feb 14, 2014 at 12:04 PM, Ranabroto
<ra...@globalcharge.com> wrote:
> Hello Claus Ibsen
> Thank you so much for your reply sir :)
>
> I have looked into reslet documentation and I found out they have the client
> info,
> They have 'Request' class which got a method getClientInfo() returns an
> object of type 'ClientInfo' and 'ClientInfo' class has got a method
> 'getAddress()' which returns clients ip address.
>
> so it should look like
>
> request.getClientInfo().getAddress(); (which should return the clients ip
> address)
>
> Here we go for their(reslet) api spec(find the getClientInfo() method)
> http://restlet.org/learn/javadocs/2.1/jse/api/org/restlet/Request.html
>
> Find the getAddress() method
> http://restlet.org/learn/javadocs/2.1/jse/api/org/restlet/data/ClientInfo.html
>
> Thanks in advance
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Retrieve-Caller-Ip-Address-Camel-Reslet-tp5747272p5747311.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io
Re: Retrieve Caller Ip Address
Posted by Ranabroto <ra...@globalcharge.com>.
Hello Claus Ibsen
Thank you so much for your reply sir :)
I have looked into reslet documentation and I found out they have the client
info,
They have 'Request' class which got a method getClientInfo() returns an
object of type 'ClientInfo' and 'ClientInfo' class has got a method
'getAddress()' which returns clients ip address.
so it should look like
request.getClientInfo().getAddress(); (which should return the clients ip
address)
Here we go for their(reslet) api spec(find the getClientInfo() method)
http://restlet.org/learn/javadocs/2.1/jse/api/org/restlet/Request.html
Find the getAddress() method
http://restlet.org/learn/javadocs/2.1/jse/api/org/restlet/data/ClientInfo.html
Thanks in advance
--
View this message in context: http://camel.465427.n5.nabble.com/Retrieve-Caller-Ip-Address-Camel-Reslet-tp5747272p5747311.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Retrieve Caller Ip Address
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
Could you check the restlet documentation to see if they provide any
details how to get this information.
As Camel would need to get the information the same way.
And if so we could maybe make it easier to get this details out of the
box as headers or something by improving the camel-restlet component.
On Thu, Feb 13, 2014 at 7:42 PM, Ranabroto
<ra...@globalcharge.com> wrote:
> HI all I am new in Camel
>
> I have a reslet api like below
>
> <from uri="restlet:/getmsisdn?restletMethods=GET,POST" />
>
> How can i get the caller ip address..? I have checked message header and
> body, but didnt find the client ip address
>
> Please help me
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Retrieve-Caller-Ip-Address-tp5747272.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io