Shindig Architectural Overview Nov 2008

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    16 Favorites

    Shindig Architectural Overview Nov 2008 - Presentation Transcript

    1. Shindig Architectural Overview Rajdeep Dua Google Developer Relations Nov ,2008. 1
    2. Agenda •  Shindig Client and Server Components •  Javascript Client libraries and various containers   OpenSocial Container   Java script Container •  GET FRIENDS – Client side Collaboration •  GET FRIENDS - Server side Collaboration Google Confidential and Proprietary 2
    3. Shindig •  Apache Incubator Project •  Available in both Java and PHP Version •  Java version based on Servlet stack •  JSON backend in the reference implementation Google Confidential and Proprietary
    4. Shindig Client side • Gadget Container – gadgets.js • OpenSocial Container • Restful Container – Part of OpenSocial 0.8 feature Google Confidential and Proprietary 4
    5. Shindig : Client Server Flow Shindig Javascript Client Gadgets.io Shindig Server opensocial.Container: FunctionObject URL Parser and Mapper XmlHttpRequest extends HTTP Service Open Handler1 Social RestfulContainer: calls Handler2 Gadget FunctionObject Handler3 JsonRpcContainer: FunctionObject calls GadgetsContainer: FunctionObject Any HTTP Client Google Confidential and Proprietary 5
    6. Shindig Component Architecture HTTP Server Servlet Engine Gadget Renderer ConcatProxy Servlet Servlet DataService MakeRequest JsonRpcServlet Proxy Servlet Rpc Servlet Servlet Js Servlet Servlet Gadget Open Renderer Open Social Social Open Social Sample Server BeanJson BeanXml DataHandler Convertor Container Side Convertor implements
 Object People s Gadget Service PersonHandler Server Activities JsonDB Service OpenSocial Activities Gadget Spec Service Handler Data Service AppData Handler Gadget Features State Gadget.xml File and jsLibraries Google Confidential and Proprietary 6
    7. Component Architecture – Client side Gadget Container Gadgets : Object gadgets.Container gadgets.Extensible • gadgets.GadgetService() Function Object setDependencies() • gadgets.DefaultUserPrefStore() Gadgets_ • gadgets.LayoutManager() ParentUrl_ • gadgets.Gadget() View_ • gadgets.Container() gadgetClass gadgets.IfrContainer gadgetService •  renderGadget() gadgets.GadgetService gadgets.Gadget gadgets.LayoutManager Function Object Function Object Function Object _userPrefs call inherits gadgets.UserPrefStore call inherits Function Object gadgets.IfrGadgetService inherits gadgets.StaticLayoutManager inherits call call gadgets.DefaultUserPrefStore gadgets.IfrGadget Google Confidential and Proprietary 7
    8. OpenSocial client side container 1 opensocial.BodyType opensocial.Container: FunctionObject 0 0 0 opensocial.Person • container_ n 0 • getEnvironment() 0 0 0 opensocial.Activity • requestSendMessage(…) • requestShareApp(..) n • requestCreateActivity(..) opensocial.Email • newFetchPersonRequest(..) n • newFetchPeopleRequest(..) opensocial.Phone opensocial.Url 1 opensocial.enum.Smoker 1 opensocial.enum.Drinker 1 opensocial.enum.Presence Google Confidential and Proprietary 8
    9. Server Side Component Architecture Servlet Class Diagram Google Confidential and Proprietary 9
    10. OpenSocial Client Side Flow List of Friends 1.  Create Request Object 2.  Populate Request Parameters 3.  Send the Request Google Confidential and Proprietary 10
    11. OpenSocial JS APIs – Collaboration Diagram List of Friends Step 1 opensocial.Container.container makeIdSpec( newDataRequest() _ : JsonRpcContainer 7 1 “VIEWER”) 7.1 new 8 Gadget Javascript 2 translate newFetchPerson opensocial.IdSpec 6 IdSpec() Request(“VIEWER”, new ProfileDetails) JsonRpcRequest 9 new 4 newFetchPersonRequest() opensocial.DataRequest 3 \"/people/@viewer/@self? fields=id, name, thumbnailUrl& RequestObject_=[] startIndex=0 5 &count=20& orderBy=topFriends& addDefaultProfileFields({}) filterBy=all\" (to RequestObject_) var

req
=
opensocial.newDataRequest();
 req.add(
req.newFetchPersonRequest(
opensocial.DataRequest.PersonId.VIEWER
)
,
'viewer'); Google Confidential and Proprietary 11
    12. OpenSocial JS APIs – Collaboration Diagram List of Friends Step 2 new RestFulRequestItem opensocial.Container.container (X, “GET”,..) _ :JsonRpcContainer 7.1 Gadget Javascript opensocial.IdSpec newFetchPeopleRequest(…) 14 /people/@viewer/@friends 13 userid =VIEWER groupID =FRIENDS JsonRpcRequest 10 opensocial.DataRequest newFetchPeopleRequest( “VIEWER_FRIENDS”, undefined) 11 12 X =\"/people/@viewer/@ friends? fields=id, name, thumbnailUrl& newFetchPeopleRequest( translateIdSpec(..) startIndex=0&count=20&orderBy=topFriends & {userId=“VIEWER”, userId : VIEWER filterBy=all\" groupId= ”FRIENDS”}) groupId: FRIENDS req.add(
req.newFetchPeopleRequest
(
opensocial.DataRequest.Group.VIEWER_FRIENDS
),
 'viewerFriends');
 Google Confidential and Proprietary 12
    13. OpenSocial JS APIs – Collaboration Diagram : GET Request Object RequestObject_=[] Key Object viewer { method = “GET”, url = \"/people/@viewer/@self? fields=id, name, thumbnailUrl& startIndex=0&count=20& orderBy= topFriends & filterBy=all\" } viewerFriends { method = “GET”, url = \"/people/@viewer/@friends? fields=id, name, thumbnailUrl& startIndex=0&count=20& orderBy= topFriends & filterBy=all\" } Google Confidential and Proprietary 13
    14. OpenSocial JS APIs – Collaboration Diagram Step 3 makeNonProxiedRequest( relativeUrl, callback , .., “application/ json ” ) 16 opensocial.Container.container gadgets.io _ : JsonRpcContainer 17 7.1 makeXhrRequest(…) 18 Gadget Javascript sendRequest( opensocial.IdSpec new 16 14 RequestObject_, 13 <callback> ) JsonRpcRequest XMLHttpRequest 10 opensocial.DataRequest 19 20 12 11 send(<callback>) Open(…) send(…) 15 relativeURL =\"/social/rest/jsonBatch?st=john.doe%3Ajohn.doe%3A7303%3Ashindig%3Ahttp%253A//hosting.gmodules.com/ig/gadgets/file/ 104769461040349626058/list_of_friends.xml%3A0\" \" req.send(
onLoadFriends
)
;
 Google Confidential and Proprietary 14
    15. OpenSocial – Server Side flow •  List of Friends when it reaches the Server. It is a 4 Step Process 1.  Call JsonRpcServletGet the Converter 2.  Get the Appropriate Handler 3.  Get the JSON Object from the DB 4.  Populate Responses into a List 5.  Stringify and return to the client Google Confidential and Proprietary 15
    16. List My Friends – Server Side Call fro m the ! Step 1 : JsonRpcServlet’s doPost() l APIS! O penSocia Servlet
Container
 RpcRequestItem
 dispatchBatch()
 new
RpcRequestItem(..)
 H b.i.a O b
 doPost(..)
 T b.i
 S a
 T GET
 P G Service(..)
 a b.ii JsonRpcServlet
 S d handleRequestItem(…)
 e g r e v t e r Google Confidential and Proprietary 16
    17. List My Friends – Server Side C all fro m the ! APIS! Step 2 :Get the People Handler Op e nSocial Servlet
Container
 RpcRequestItem
 H doPost(..)
 b.i.a
 O b
 T b.i
 S a
 getHandler(..)
 T GET
 P G Service(..)
 b.ii.a HandlerDispatcher
 a b.ii JsonRpcServlet
 S b.ii.b d e handleRequestItem(…)
 PeopleHandler
 g r e v t e r Google Confidential and Proprietary 17
    18. List My Friends – Server Side C all fro m the ! APIS! Step 3 : Get the data from DB Op e nSocial Servlet
Container
 RpcRequestItem
 H doPost(..)
 b.i.a
 O b
 T b.i
 S a
 T GET
 P G Service(..)
 b.ii.a
 HandlerDispatcher
 a b.ii JsonRpcServlet
 S b.ii.b
 d e handleRequestItem(…)
 PeopleHandler
 g r e v b.ii.b.1
 t e b.ii.b.1b
 getAllPeople()
 getPeople(..)
 r BasicPeopleService
 db:JsonObject
 b.ii.b.1a
 getFriendIds.(.)
 18 CASE:
FRIENDS
 Google Confidential and Proprietary 18
    19. List My Friends – Server Side C all fro m the ! APIS! Step 4 :Populate List of Responses Op e nSocial Servlet
Container
 RpcRequestItem
 H doPost(..)
 b.i.a
 O b
 T b.i
 S a
 T GET
 P G Service(..)
 b.ii.a
 HandlerDispatcher
 a b.ii JsonRpcServlet
 S b.ii.b
 d e PeopleHandler
 g handleRequestItem(…)
 r e v b.ii.b.1
 t List<responses>
 b.ii.b.1b
 e r BasicPeopleService
 db:JsonObject
 b.ii.b.1a
 19 Google Confidential and Proprietary 19
    20. List My Friends – Server Side C all fro m the ! APIS! Step 5 :Send the response Op e nSocial Servlet
Container
 RpcRequestItem
 H doPost(..)
 b.i.a
 O b
 T b.i
 S a
 T GET
 P G Service(..)
 b.ii.a
 HandlerDispatcher
 a b.ii JsonRpcServlet
 S b.ii.b
 d c
 e PeopleHandler
 g handleRequestItem(…)
 r e v b.ii.b.1
 t List<responses>
 b.ii.b.1b
 e r BasicPeopleService
 db:JsonObject
 b.ii.b.1a
 20 Google Confidential and Proprietary 20
    21. OpenSocial – Server Side flow in case a REST Call •  List of Friends when it reaches the Server. It is a 5 Step Process 1.  Call DataServiceServlet 2.  Get the appropriate converter 3.  Get the handler 4.  Get the JSON Object from the DB 5.  Stringify and return to the client Call fro m the ! REST client! Google Confidential and Proprietary 21
    22. the ! Call fro m ! List My Friends – Server Side REST cli ent Step 1 : DataServiceServlet doPost() URL
:
hUp://localhost:8080/social/rest/people/john.doe/@friends?st=a:a:a:a:a:a
 DataServiceServlet
 Servlet
Container
 Fetcher
 fetch(req)
 token
 new
BaseSecurityToken(..)
 b.i.a.1 b.i.a.2 BasicSecurity
 createToken()
 BaseSecurityToken
 TokenDecoder
 getSecuriyToken()
 b.i.a R H T doPost(..)
 b.i E S T T GET
 P Service(..)
 b.ii DataServiceServlet
 C S getConvertorforRequest(req)
 L e I r E v handleSingleRequest(req,
res,
token,
conv)
 N e b.iii T r Google Confidential and Proprietary 22
    23. List My Friends – Server Side the ! Call fro m ! ent Step 2 :Get the Converter REST cli URL
:
hUp://localhost:8080/social/rest/people/john.doe/@friends?st=a:a:a:a:a:a
 DataServiceServlet
 Servlet
Container
 Fetcher
 b.i.a.1
 b.i.a.2
 BasicSecurity
 TokenDecoder
 BaseSecurityToken
 b.i.a
 getParameter(“param”)
 R H T doPost(..)
 b.i
 servletRequest
 E T b.ii.a
 S T GET
 P null
 Service(..)
 BeanJson
 b.ii.b
 DataServiceServlet
 Converter
 C S b.ii
 L e I r getConvertorforRequest(req)
 E v handleSingleRequest(req,
res,
token,
conv)
 N e b.iii T r Google Confidential and Proprietary 23
    24. List My Friends – Server Side the ! Call fro m ! Step 3 :Get the Handler REST cli ent URL
:
hUp://localhost:8080/social/rest/people/john.doe/@friends?st=a:a:a:a:a:a
 DataServiceServlet
 Fetcher
 handleGet
in
PeopleHandler
 supports

 Servlet
Container
 b.i.a.1
 following
PaUerns b.i.a.2
 • /people/john.doe/@all • /people/john.doe/@friends BasicSecurity
 • /people/john.doe/@self
 TokenDecoder
 BaseSecurityToken
 getSecuriyToken()
 b.i.a
 R H T doPost(..)
 b.i
 servletRequest
 E T b.ii.a
 S T GET
 P null
 Service(..)
 BeanJson
 b.ii.b
 DataServiceServlet
 Converter
 C S b.ii
 L e I r getConvertorforRequest(
req)
 E v N e handleSingleRequest(
 b.iii.a
 getHUpMethodFromParameter(..)
 b.iii
 T r req,
res,
token,
conv)
 b.iii.b getHandler(“PeopleHandler”)
 RequestItem
 b.iii.c.2
 InjectorImpl
 handleRequestItem(..)
 b.iii.c
 b.iii.c.2.1
 b.iii.c.3
 PersonHandler
 getRouteFromParameter(“..”)
 b.iii.c.1
 handleItem(request)
 Google Confidential and Proprietary 24
    25. List My Friends – Server Side the ! Call fro m ! Step 4 :Get the Data from DB ent REST cli URL
:
hUp://localhost:8080/social/rest/people/john.doe/@friends?st=a:a:a:a:a:a
 DataServiceServlet
 Fetcher
 b.i.a.1
 Servlet
Container
 b.i.a.2
 BasicSecurity
 getSecuriyToken()
 TokenDecoder
 BaseSecurityToken
 R H b.i.a
 T doPost(..)
 b.i servletRequest
 E T b.ii.a
 S T GET
 P Service(..)
 BeanJson
 b.ii.b
 DataServiceServlet
 Converter
 C S b.ii L e I r b.iii.a
 E v e b.iii.b
 N handleSingleRequest(
 b.iii RequestItem
 T r req,
res,
token,
conv)
 b.iii.c.2
 InjectorImpl
 handleRequestItem(..)
 b.iii.c b.iii.c.2.1
 b.iii.c.3
 PersonHandler
 b.iii.c.1
 b.iii.c.3.2
 handleGet
in
PeopleHandler
 supports

 b.iii.c.3.2b
 getPeople(..)
 getAllPeople()
 following
PaUerns • /people/john.doe/@all BasicPeopleService
 db:JsonObject
 • /people/john.doe/@friends getFriendIds.(.)
 • /people/john.doe/@self
 b.iii.c.3.2a
 CASE:
FRIENDS
 25 Google Confidential and Proprietary
    26. the ! List My Friends – Server Side Call fro m ! ent REST cli Step 5 :Convert to JSON String and Return URL
:
hUp://localhost:8080/social/rest/people/john.doe/@friends?st=a:a:a:a:a:a
 DataServiceServlet
 Fetcher
 b.i.a.1
 Servlet
Container
 b.i.a.2
 BasicSecurity
 getSecuriyToken()
 TokenDecoder
 BaseSecurityToken
 R H b.i.a
 b doPost(..)
 E a GET
 T b.i servletRequest
 T b.ii.a
 S Service(..)
 T P BeanJson
 b.ii.b
 c DataServiceServlet
 Converter
 C S b.ii L e convertToString
 (ResaulCollecbon<Person>)
 I r b.iii.a
 E v b.iii.c.3.3
 e b.iii.b
 N handleSingleRequest(
 b.iii RequestItem
 T r req,
res,
token,
conv)
 b.iii.c.2
 InjectorImpl
 handleRequestItem(..)
 b.iii.c b.iii.c.2.1
 b.iii.c.3
 PersonHandler
 b.iii.c.1
 b.iii.c.3.2
 handleGet
in
PeopleHandler
 supports

 b.iii.c.3.2b
 getPeople(..)
 following
PaUerns • /people/john.doe/@all BasicPeopleService
 db:JsonObject
 • /people/john.doe/@friends • /people/john.doe/@self
 b.iii.c.3.2a
 26 Google Confidential and Proprietary
    27. Re-Cap •  Shindig is implemented in 2 languages ( Java, PHP, Others soon) •  Java version on top of Servlet stack •  Multiple entry points for various “kinds” of calls •  Client Side architecture - containers – Gadget and OpenSocial •  Handlers and Converters take care of call semantics •  REST and Json RPC calls share infrastructure in the backend Google Confidential and Proprietary 27
    28. Summary •  Shindig built on premise of reusability without major modifications •  It’s a moving target which is tending towards stable code base as we close in on 0.8 spec •  Its Open source and “you” are encouraged to take up features and implement them Google Confidential and Proprietary 28

    + rajdeeprajdeep, 12 months ago

    custom

    2620 views, 16 favs, 2 embeds more stats

    Apache Shindig Java Architectural Overview

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 2620
      • 2617 on SlideShare
      • 3 from embeds
    • Comments 0
    • Favorites 16
    • Downloads 0
    Most viewed embeds
    • 2 views on file://
    • 1 views on http://wildfire.gigya.com

    more

    All embeds
    • 2 views on file://
    • 1 views on http://wildfire.gigya.com

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories