You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by "VU, Thi Thu Thuy" <th...@sap.com> on 2010/04/16 14:11:40 UTC

Functions of PersonService

Hi,
I read the interface PersonService, but I'm not sure if I understand it or not.
I can't figure out which functions that PersonService gives us?

Could you tell me, pls?
Thank you very much.

Re: Functions of PersonService

Posted by Paul Lindner <li...@inuus.com>.
By making these interfaces asynchronous shindig can dispatch multiple
requests in parallel.  For example the data pipelining code executes
multiple calls in this way, greatly speeding up gadget rendering times.

On Mon, Apr 19, 2010 at 4:43 AM, VU, Thi Thu Thuy
<th...@sap.com>wrote:

> Yeah, i understant this, i searched it on internet too. But, I don't
> understand why this process is asynchronous??? Why is it asynchronous?
> A bit stupid question, but I really want to understand well everything.
> Thank for your help.
>
> -----Original Message-----
> From: franck tankoua [mailto:ftankoua@gmail.com]
> Sent: vendredi 16 avril 2010 17:07
> To: dev@shindig.apache.org
> Subject: Re: Functions of PersonService
>
> THis is for concurrency.
> take a look at this ( I grabbed it in the java.util.concurrrent package ) :
>
> A Future represents the result of an asynchronous computation. Methods are
> provided to check if the computation is complete, to wait for its
> completion, and to retrieve the result of the computation. The result can
> only be retrieved using method get when the computation has completed,
> blocking if necessary until it is ready. Cancellation is performed by the
> cancel method. Additional methods are provided to determine if the task
> completed normally or was cancelled. Once a computation has completed, the
> computation cannot be cancelled. If you would like to use a Future for the
> sake of cancellability but not provide a usable result, you can declare
> types of the form Future<?> and return null as a result of the underlying
> task.
>
> hope it helps
>
> On Fri, Apr 16, 2010 at 3:26 PM, VU, Thi Thu Thuy
> <th...@sap.com>wrote:
>
> > Thanks
> > Can you explain me why we have to use Future<> in these methods of
> > PersonService?
> > I want to understand well the advantage of Future<>.
> > Thank you
> >
> > -----Original Message-----
> > From: franck tankoua [mailto:ftankoua@gmail.com]
> > Sent: vendredi 16 avril 2010 15:04
> > To: dev@shindig.apache.org
> > Subject: Re: Functions of PersonService
> >
> > You will need to glande a little bit through the API for that. here is a
> > short but not exaustive list:
> > for  GroupId :(all ,deleted , friends , groupId , self)
> >  for collectionOptions :
> >
> >
> http://shindig.apache.org/shindig-1.1.x/apidocs/org/apache/shindig/social/opensocial/spi/CollectionOptions.html
> >
> > and so one.
> >
> > You need to make your own implementation so you are not obliged to handle
> > all different combinaison supposing you have control of the gadget and
> you
> > know what your gadget will be asking to the server.
> >
> > Is this gives you more hints?
> >
> > On Fri, Apr 16, 2010 at 2:33 PM, VU, Thi Thu Thuy
> > <th...@sap.com>wrote:
> >
> > > Yeah, i understand that i have to implement these methods. But, I don't
> > > understand which results they will return?
> > > With each case, they will return different results, and I want to
> collect
> > > all cases possible. For example, I know, it's possible to get one
> profile
> > of
> > > one user, profile of user's relation (friends, all, ..)... and so on
> > (what's
> > > so on, I don't know)
> > > So, I want to ask to list all functions of these methods.
> > > I don't know if you understand what I mean?
> > > Thanks a lot.
> > >
> > > -----Original Message-----
> > > From: franck tankoua [mailto:ftankoua@gmail.com]
> > > Sent: vendredi 16 avril 2010 14:26
> > > To: dev@shindig.apache.org
> > > Subject: Re: Functions of PersonService
> > >
> > > Hi Vu,
> > >
> > > I am not sure if I understand your question.
> > > But let me give you what might be answer. You need to implements two
> > > methods.
> > > Future<Person> getPerson(UserId id, Set<String> fields, SecurityToken
> > > token)
> > >
> > > and
> > > Future<RestfulCollection<Person>> getPeople(Set<UserId> userIds,
> GroupId
> > > groupId,
> > >      CollectionOptions collectionOptions, Set<String> fields,
> > SecurityToken
> > > token)
> > >
> > > those methods will basically return people/person based on the certain
> > > parameter you passed in which is : groupid, collectionOptions (filter,
> > sort
> > > etc..) , the fields you want to fetch...
> > >
> > > Take a look at the samplecode in
> > > org.apache.shindig.social.sample.spi.JsonDbOpensocialService.
> > >
> > > On Fri, Apr 16, 2010 at 2:11 PM, VU, Thi Thu Thuy
> > > <th...@sap.com>wrote:
> > >
> > > > Hi,
> > > > I read the interface PersonService, but I'm not sure if I understand
> it
> > > or
> > > > not.
> > > > I can't figure out which functions that PersonService gives us?
> > > >
> > > > Could you tell me, pls?
> > > > Thank you very much.
> > > >
> > >
> > >
> > >
> > > --
> > > Franck
> > >
> >
> >
> >
> > --
> > Franck
> >
>
>
>
> --
> Franck
>

RE: Functions of PersonService

Posted by "VU, Thi Thu Thuy" <th...@sap.com>.
Yeah, i understant this, i searched it on internet too. But, I don't understand why this process is asynchronous??? Why is it asynchronous?
A bit stupid question, but I really want to understand well everything.
Thank for your help.

-----Original Message-----
From: franck tankoua [mailto:ftankoua@gmail.com] 
Sent: vendredi 16 avril 2010 17:07
To: dev@shindig.apache.org
Subject: Re: Functions of PersonService

THis is for concurrency.
take a look at this ( I grabbed it in the java.util.concurrrent package ) :

A Future represents the result of an asynchronous computation. Methods are
provided to check if the computation is complete, to wait for its
completion, and to retrieve the result of the computation. The result can
only be retrieved using method get when the computation has completed,
blocking if necessary until it is ready. Cancellation is performed by the
cancel method. Additional methods are provided to determine if the task
completed normally or was cancelled. Once a computation has completed, the
computation cannot be cancelled. If you would like to use a Future for the
sake of cancellability but not provide a usable result, you can declare
types of the form Future<?> and return null as a result of the underlying
task.

hope it helps

On Fri, Apr 16, 2010 at 3:26 PM, VU, Thi Thu Thuy
<th...@sap.com>wrote:

> Thanks
> Can you explain me why we have to use Future<> in these methods of
> PersonService?
> I want to understand well the advantage of Future<>.
> Thank you
>
> -----Original Message-----
> From: franck tankoua [mailto:ftankoua@gmail.com]
> Sent: vendredi 16 avril 2010 15:04
> To: dev@shindig.apache.org
> Subject: Re: Functions of PersonService
>
> You will need to glande a little bit through the API for that. here is a
> short but not exaustive list:
> for  GroupId :(all ,deleted , friends , groupId , self)
>  for collectionOptions :
>
> http://shindig.apache.org/shindig-1.1.x/apidocs/org/apache/shindig/social/opensocial/spi/CollectionOptions.html
>
> and so one.
>
> You need to make your own implementation so you are not obliged to handle
> all different combinaison supposing you have control of the gadget and you
> know what your gadget will be asking to the server.
>
> Is this gives you more hints?
>
> On Fri, Apr 16, 2010 at 2:33 PM, VU, Thi Thu Thuy
> <th...@sap.com>wrote:
>
> > Yeah, i understand that i have to implement these methods. But, I don't
> > understand which results they will return?
> > With each case, they will return different results, and I want to collect
> > all cases possible. For example, I know, it's possible to get one profile
> of
> > one user, profile of user's relation (friends, all, ..)... and so on
> (what's
> > so on, I don't know)
> > So, I want to ask to list all functions of these methods.
> > I don't know if you understand what I mean?
> > Thanks a lot.
> >
> > -----Original Message-----
> > From: franck tankoua [mailto:ftankoua@gmail.com]
> > Sent: vendredi 16 avril 2010 14:26
> > To: dev@shindig.apache.org
> > Subject: Re: Functions of PersonService
> >
> > Hi Vu,
> >
> > I am not sure if I understand your question.
> > But let me give you what might be answer. You need to implements two
> > methods.
> > Future<Person> getPerson(UserId id, Set<String> fields, SecurityToken
> > token)
> >
> > and
> > Future<RestfulCollection<Person>> getPeople(Set<UserId> userIds, GroupId
> > groupId,
> >      CollectionOptions collectionOptions, Set<String> fields,
> SecurityToken
> > token)
> >
> > those methods will basically return people/person based on the certain
> > parameter you passed in which is : groupid, collectionOptions (filter,
> sort
> > etc..) , the fields you want to fetch...
> >
> > Take a look at the samplecode in
> > org.apache.shindig.social.sample.spi.JsonDbOpensocialService.
> >
> > On Fri, Apr 16, 2010 at 2:11 PM, VU, Thi Thu Thuy
> > <th...@sap.com>wrote:
> >
> > > Hi,
> > > I read the interface PersonService, but I'm not sure if I understand it
> > or
> > > not.
> > > I can't figure out which functions that PersonService gives us?
> > >
> > > Could you tell me, pls?
> > > Thank you very much.
> > >
> >
> >
> >
> > --
> > Franck
> >
>
>
>
> --
> Franck
>



-- 
Franck

Re: Functions of PersonService

Posted by franck tankoua <ft...@gmail.com>.
THis is for concurrency.
take a look at this ( I grabbed it in the java.util.concurrrent package ) :

A Future represents the result of an asynchronous computation. Methods are
provided to check if the computation is complete, to wait for its
completion, and to retrieve the result of the computation. The result can
only be retrieved using method get when the computation has completed,
blocking if necessary until it is ready. Cancellation is performed by the
cancel method. Additional methods are provided to determine if the task
completed normally or was cancelled. Once a computation has completed, the
computation cannot be cancelled. If you would like to use a Future for the
sake of cancellability but not provide a usable result, you can declare
types of the form Future<?> and return null as a result of the underlying
task.

hope it helps

On Fri, Apr 16, 2010 at 3:26 PM, VU, Thi Thu Thuy
<th...@sap.com>wrote:

> Thanks
> Can you explain me why we have to use Future<> in these methods of
> PersonService?
> I want to understand well the advantage of Future<>.
> Thank you
>
> -----Original Message-----
> From: franck tankoua [mailto:ftankoua@gmail.com]
> Sent: vendredi 16 avril 2010 15:04
> To: dev@shindig.apache.org
> Subject: Re: Functions of PersonService
>
> You will need to glande a little bit through the API for that. here is a
> short but not exaustive list:
> for  GroupId :(all ,deleted , friends , groupId , self)
>  for collectionOptions :
>
> http://shindig.apache.org/shindig-1.1.x/apidocs/org/apache/shindig/social/opensocial/spi/CollectionOptions.html
>
> and so one.
>
> You need to make your own implementation so you are not obliged to handle
> all different combinaison supposing you have control of the gadget and you
> know what your gadget will be asking to the server.
>
> Is this gives you more hints?
>
> On Fri, Apr 16, 2010 at 2:33 PM, VU, Thi Thu Thuy
> <th...@sap.com>wrote:
>
> > Yeah, i understand that i have to implement these methods. But, I don't
> > understand which results they will return?
> > With each case, they will return different results, and I want to collect
> > all cases possible. For example, I know, it's possible to get one profile
> of
> > one user, profile of user's relation (friends, all, ..)... and so on
> (what's
> > so on, I don't know)
> > So, I want to ask to list all functions of these methods.
> > I don't know if you understand what I mean?
> > Thanks a lot.
> >
> > -----Original Message-----
> > From: franck tankoua [mailto:ftankoua@gmail.com]
> > Sent: vendredi 16 avril 2010 14:26
> > To: dev@shindig.apache.org
> > Subject: Re: Functions of PersonService
> >
> > Hi Vu,
> >
> > I am not sure if I understand your question.
> > But let me give you what might be answer. You need to implements two
> > methods.
> > Future<Person> getPerson(UserId id, Set<String> fields, SecurityToken
> > token)
> >
> > and
> > Future<RestfulCollection<Person>> getPeople(Set<UserId> userIds, GroupId
> > groupId,
> >      CollectionOptions collectionOptions, Set<String> fields,
> SecurityToken
> > token)
> >
> > those methods will basically return people/person based on the certain
> > parameter you passed in which is : groupid, collectionOptions (filter,
> sort
> > etc..) , the fields you want to fetch...
> >
> > Take a look at the samplecode in
> > org.apache.shindig.social.sample.spi.JsonDbOpensocialService.
> >
> > On Fri, Apr 16, 2010 at 2:11 PM, VU, Thi Thu Thuy
> > <th...@sap.com>wrote:
> >
> > > Hi,
> > > I read the interface PersonService, but I'm not sure if I understand it
> > or
> > > not.
> > > I can't figure out which functions that PersonService gives us?
> > >
> > > Could you tell me, pls?
> > > Thank you very much.
> > >
> >
> >
> >
> > --
> > Franck
> >
>
>
>
> --
> Franck
>



-- 
Franck

RE: Functions of PersonService

Posted by "VU, Thi Thu Thuy" <th...@sap.com>.
Thanks
Can you explain me why we have to use Future<> in these methods of PersonService?
I want to understand well the advantage of Future<>.
Thank you

-----Original Message-----
From: franck tankoua [mailto:ftankoua@gmail.com] 
Sent: vendredi 16 avril 2010 15:04
To: dev@shindig.apache.org
Subject: Re: Functions of PersonService

You will need to glande a little bit through the API for that. here is a
short but not exaustive list:
for  GroupId :(all ,deleted , friends , groupId , self)
 for collectionOptions :
http://shindig.apache.org/shindig-1.1.x/apidocs/org/apache/shindig/social/opensocial/spi/CollectionOptions.html

and so one.

You need to make your own implementation so you are not obliged to handle
all different combinaison supposing you have control of the gadget and you
know what your gadget will be asking to the server.

Is this gives you more hints?

On Fri, Apr 16, 2010 at 2:33 PM, VU, Thi Thu Thuy
<th...@sap.com>wrote:

> Yeah, i understand that i have to implement these methods. But, I don't
> understand which results they will return?
> With each case, they will return different results, and I want to collect
> all cases possible. For example, I know, it's possible to get one profile of
> one user, profile of user's relation (friends, all, ..)... and so on (what's
> so on, I don't know)
> So, I want to ask to list all functions of these methods.
> I don't know if you understand what I mean?
> Thanks a lot.
>
> -----Original Message-----
> From: franck tankoua [mailto:ftankoua@gmail.com]
> Sent: vendredi 16 avril 2010 14:26
> To: dev@shindig.apache.org
> Subject: Re: Functions of PersonService
>
> Hi Vu,
>
> I am not sure if I understand your question.
> But let me give you what might be answer. You need to implements two
> methods.
> Future<Person> getPerson(UserId id, Set<String> fields, SecurityToken
> token)
>
> and
> Future<RestfulCollection<Person>> getPeople(Set<UserId> userIds, GroupId
> groupId,
>      CollectionOptions collectionOptions, Set<String> fields, SecurityToken
> token)
>
> those methods will basically return people/person based on the certain
> parameter you passed in which is : groupid, collectionOptions (filter, sort
> etc..) , the fields you want to fetch...
>
> Take a look at the samplecode in
> org.apache.shindig.social.sample.spi.JsonDbOpensocialService.
>
> On Fri, Apr 16, 2010 at 2:11 PM, VU, Thi Thu Thuy
> <th...@sap.com>wrote:
>
> > Hi,
> > I read the interface PersonService, but I'm not sure if I understand it
> or
> > not.
> > I can't figure out which functions that PersonService gives us?
> >
> > Could you tell me, pls?
> > Thank you very much.
> >
>
>
>
> --
> Franck
>



-- 
Franck

Re: Functions of PersonService

Posted by franck tankoua <ft...@gmail.com>.
You will need to glande a little bit through the API for that. here is a
short but not exaustive list:
for  GroupId :(all ,deleted , friends , groupId , self)
 for collectionOptions :
http://shindig.apache.org/shindig-1.1.x/apidocs/org/apache/shindig/social/opensocial/spi/CollectionOptions.html

and so one.

You need to make your own implementation so you are not obliged to handle
all different combinaison supposing you have control of the gadget and you
know what your gadget will be asking to the server.

Is this gives you more hints?

On Fri, Apr 16, 2010 at 2:33 PM, VU, Thi Thu Thuy
<th...@sap.com>wrote:

> Yeah, i understand that i have to implement these methods. But, I don't
> understand which results they will return?
> With each case, they will return different results, and I want to collect
> all cases possible. For example, I know, it's possible to get one profile of
> one user, profile of user's relation (friends, all, ..)... and so on (what's
> so on, I don't know)
> So, I want to ask to list all functions of these methods.
> I don't know if you understand what I mean?
> Thanks a lot.
>
> -----Original Message-----
> From: franck tankoua [mailto:ftankoua@gmail.com]
> Sent: vendredi 16 avril 2010 14:26
> To: dev@shindig.apache.org
> Subject: Re: Functions of PersonService
>
> Hi Vu,
>
> I am not sure if I understand your question.
> But let me give you what might be answer. You need to implements two
> methods.
> Future<Person> getPerson(UserId id, Set<String> fields, SecurityToken
> token)
>
> and
> Future<RestfulCollection<Person>> getPeople(Set<UserId> userIds, GroupId
> groupId,
>      CollectionOptions collectionOptions, Set<String> fields, SecurityToken
> token)
>
> those methods will basically return people/person based on the certain
> parameter you passed in which is : groupid, collectionOptions (filter, sort
> etc..) , the fields you want to fetch...
>
> Take a look at the samplecode in
> org.apache.shindig.social.sample.spi.JsonDbOpensocialService.
>
> On Fri, Apr 16, 2010 at 2:11 PM, VU, Thi Thu Thuy
> <th...@sap.com>wrote:
>
> > Hi,
> > I read the interface PersonService, but I'm not sure if I understand it
> or
> > not.
> > I can't figure out which functions that PersonService gives us?
> >
> > Could you tell me, pls?
> > Thank you very much.
> >
>
>
>
> --
> Franck
>



-- 
Franck

RE: Functions of PersonService

Posted by "VU, Thi Thu Thuy" <th...@sap.com>.
Yeah, i understand that i have to implement these methods. But, I don't understand which results they will return?
With each case, they will return different results, and I want to collect all cases possible. For example, I know, it's possible to get one profile of one user, profile of user's relation (friends, all, ..)... and so on (what's so on, I don't know)
So, I want to ask to list all functions of these methods.
I don't know if you understand what I mean?
Thanks a lot.

-----Original Message-----
From: franck tankoua [mailto:ftankoua@gmail.com] 
Sent: vendredi 16 avril 2010 14:26
To: dev@shindig.apache.org
Subject: Re: Functions of PersonService

Hi Vu,

I am not sure if I understand your question.
But let me give you what might be answer. You need to implements two
methods.
Future<Person> getPerson(UserId id, Set<String> fields, SecurityToken token)

and
Future<RestfulCollection<Person>> getPeople(Set<UserId> userIds, GroupId
groupId,
      CollectionOptions collectionOptions, Set<String> fields, SecurityToken
token)

those methods will basically return people/person based on the certain
parameter you passed in which is : groupid, collectionOptions (filter, sort
etc..) , the fields you want to fetch...

Take a look at the samplecode in
org.apache.shindig.social.sample.spi.JsonDbOpensocialService.

On Fri, Apr 16, 2010 at 2:11 PM, VU, Thi Thu Thuy
<th...@sap.com>wrote:

> Hi,
> I read the interface PersonService, but I'm not sure if I understand it or
> not.
> I can't figure out which functions that PersonService gives us?
>
> Could you tell me, pls?
> Thank you very much.
>



-- 
Franck

Re: Functions of PersonService

Posted by franck tankoua <ft...@gmail.com>.
Hi Vu,

I am not sure if I understand your question.
But let me give you what might be answer. You need to implements two
methods.
Future<Person> getPerson(UserId id, Set<String> fields, SecurityToken token)

and
Future<RestfulCollection<Person>> getPeople(Set<UserId> userIds, GroupId
groupId,
      CollectionOptions collectionOptions, Set<String> fields, SecurityToken
token)

those methods will basically return people/person based on the certain
parameter you passed in which is : groupid, collectionOptions (filter, sort
etc..) , the fields you want to fetch...

Take a look at the samplecode in
org.apache.shindig.social.sample.spi.JsonDbOpensocialService.

On Fri, Apr 16, 2010 at 2:11 PM, VU, Thi Thu Thuy
<th...@sap.com>wrote:

> Hi,
> I read the interface PersonService, but I'm not sure if I understand it or
> not.
> I can't figure out which functions that PersonService gives us?
>
> Could you tell me, pls?
> Thank you very much.
>



-- 
Franck