You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by Paul Boldijar <pa...@3sstudio.com> on 2015/03/12 14:57:36 UTC

Catch all requests with Olingo v4

Hello!
Is there a way to catch all the olingo requests ?
Sometimes a login token can expire, and when this happens, I will get the
error code 401 (unauthorized), and if so, I want do something.

Thanks.

Re: Catch all requests with Olingo v4

Posted by Paul Boldijar <pa...@3sstudio.com>.
We thought about this but we are using olingo in android and we're not sure
that if the default http client can cause some issues.

Thanks,

Paul.

On Fri, Mar 13, 2015 at 4:04 PM, Francesco Chicchiriccò <ilgrosso@apache.org
> wrote:

>  On 13/03/2015 15:00, Paul Boldijar wrote:
>
> Hey! I want to listen to every request that I make to the server.
> Ex: listen when i'm adding a new object, and see that i get code 201
> (created), listen when i do a GET request, and get the code 200 (success),
> and if is the case, listen to the request that the server will give me the
> 401 code (unauthorized). And I want to do this in only one place, I don't
> want to use try catch for all requests and check in the catch method the
> error code.
>
>
>
> ..something like a protocol interceptor?
>
>
> https://git-wip-us.apache.org/repos/asf?p=olingo-odata4.git;a=blob;f=samples/client/src/main/java/org/apache/olingo/samples/client/core/http/ProtocolInterceptorHttpClientFactory.java;hb=HEAD
>
> HTH
> Regards.
>
>   On Fri, Mar 13, 2015 at 3:35 PM, Amend, Christian <
> christian.amend@sap.com> wrote:
>
>>  HI Paul,
>>
>>
>>
>> would you like to catch Exceptions on server or client side? Or do you
>> want to cache OData Request on server or client side?
>>
>>
>>
>> Best Regards,
>> Christian
>>
>>
>>
>> *From:* Paul Boldijar [mailto:paul.boldijar@3sstudio.com]
>> *Sent:* Donnerstag, 12. März 2015 14:58
>> *To:* user@olingo.apache.org
>> *Subject:* Catch all requests with Olingo v4
>>
>>
>>
>> Hello!
>>
>> Is there a way to catch all the olingo requests ?
>>
>> Sometimes a login token can expire, and when this happens, I will get the
>> error code 401 (unauthorized), and if so, I want do something.
>>
>> Thanks.
>>
>   --
> Francesco Chicchiriccò
>
> Tirasa - Open Source Excellencehttp://www.tirasa.net/
>
> Involved at The Apache Software Foundation:
> member, Syncope PMC chair, Cocoon PMC, Olingo PMChttp://people.apache.org/~ilgrosso/
>
>

Re: Catch all requests with Olingo v4

Posted by Francesco Chicchiriccò <il...@apache.org>.
On 13/03/2015 15:00, Paul Boldijar wrote:
> Hey! I want to listen to every request that I make to the server.
> Ex: listen when i'm adding a new object, and see that i get code 201 
> (created), listen when i do a GET request, and get the code 200 
> (success), and if is the case, listen to the request that the server 
> will give me the 401 code (unauthorized). And I want to do this in 
> only one place, I don't want to use try catch for all requests and 
> check in the catch method the error code.


..something like a protocol interceptor?

https://git-wip-us.apache.org/repos/asf?p=olingo-odata4.git;a=blob;f=samples/client/src/main/java/org/apache/olingo/samples/client/core/http/ProtocolInterceptorHttpClientFactory.java;hb=HEAD

HTH
Regards.

> On Fri, Mar 13, 2015 at 3:35 PM, Amend, Christian 
> <christian.amend@sap.com <ma...@sap.com>> wrote:
>
>     HI Paul,
>
>     would you like to catch Exceptions on server or client side? Or do
>     you want to cache OData Request on server or client side?
>
>     Best Regards,
>     Christian
>
>     *From:*Paul Boldijar [mailto:paul.boldijar@3sstudio.com
>     <ma...@3sstudio.com>]
>     *Sent:* Donnerstag, 12. März 2015 14:58
>     *To:* user@olingo.apache.org <ma...@olingo.apache.org>
>     *Subject:* Catch all requests with Olingo v4
>
>     Hello!
>
>     Is there a way to catch all the olingo requests ?
>
>     Sometimes a login token can expire, and when this happens, I will
>     get the error code 401 (unauthorized), and if so, I want do something.
>
>     Thanks.
>
-- 
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Involved at The Apache Software Foundation:
member, Syncope PMC chair, Cocoon PMC, Olingo PMC
http://people.apache.org/~ilgrosso/


Re: Catch all requests with Olingo v4

Posted by Paul Boldijar <pa...@3sstudio.com>.
Hey! I want to listen to every request that I make to the server.
Ex: listen when i'm adding a new object, and see that i get code 201
(created), listen when i do a GET request, and get the code 200 (success),
and if is the case, listen to the request that the server will give me the
401 code (unauthorized). And I want to do this in only one place, I don't
want to use try catch for all requests and check in the catch method the
error code..


Thanks,
Paul.

On Fri, Mar 13, 2015 at 3:35 PM, Amend, Christian <ch...@sap.com>
wrote:

>  HI Paul,
>
>
>
> would you like to catch Exceptions on server or client side? Or do you
> want to cache OData Request on server or client side?
>
>
>
> Best Regards,
> Christian
>
>
>
> *From:* Paul Boldijar [mailto:paul.boldijar@3sstudio.com]
> *Sent:* Donnerstag, 12. März 2015 14:58
> *To:* user@olingo.apache.org
> *Subject:* Catch all requests with Olingo v4
>
>
>
> Hello!
>
> Is there a way to catch all the olingo requests ?
>
> Sometimes a login token can expire, and when this happens, I will get the
> error code 401 (unauthorized), and if so, I want do something.
>
>
>
> Thanks.
>
>
>

RE: Catch all requests with Olingo v4

Posted by "Amend, Christian" <ch...@sap.com>.
HI Paul,

would you like to catch Exceptions on server or client side? Or do you want to cache OData Request on server or client side?

Best Regards,
Christian

From: Paul Boldijar [mailto:paul.boldijar@3sstudio.com]
Sent: Donnerstag, 12. März 2015 14:58
To: user@olingo.apache.org
Subject: Catch all requests with Olingo v4

Hello!
Is there a way to catch all the olingo requests ?
Sometimes a login token can expire, and when this happens, I will get the error code 401 (unauthorized), and if so, I want do something.

Thanks.