<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5129155740138768789</id><updated>2012-02-16T20:32:39.395-08:00</updated><title type='text'>Sun GlassFish Mobility Platform Development</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://rajivkonkimalla.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5129155740138768789/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://rajivkonkimalla.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Rajiv Konkimalla</name><uri>http://www.blogger.com/profile/04132149846220145460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_Dgw21WfjpPI/ScE3yqxlngI/AAAAAAAAAAM/kWKTIoY4-Xc/S220/Rajiv1.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5129155740138768789.post-2762939476208540451</id><published>2009-03-18T11:47:00.000-07:00</published><updated>2009-03-18T12:17:32.870-07:00</updated><title type='text'>Synchronizing Twitter data using Sun's GlassFish Mobility Platform</title><content type='html'>&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 11"&gt;&lt;meta name="Originator" content="Microsoft Word 11"&gt;&lt;link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CRKONKI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml"&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" latentstylecount="156"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:Wingdings; 	panose-1:5 0 0 0 0 0 0 0 0 0; 	mso-font-charset:2; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:0 268435456 0 0 -2147483648 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman"; 	mso-fareast-font-family:"Times New Roman";} a:link, span.MsoHyperlink 	{color:blue; 	text-decoration:underline; 	text-underline:single;} a:visited, span.MsoHyperlinkFollowed 	{color:purple; 	text-decoration:underline; 	text-underline:single;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.25in 1.0in 1.25in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;}  /* List Definitions */  @list l0 	{mso-list-id:840661345; 	mso-list-type:hybrid; 	mso-list-template-ids:-595007472 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l0:level1 	{mso-level-number-format:bullet; 	mso-level-text:; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in; 	font-family:Symbol;} @list l0:level2 	{mso-level-number-format:bullet; 	mso-level-text:o; 	mso-level-tab-stop:1.0in; 	mso-level-number-position:left; 	text-indent:-.25in; 	font-family:"Courier New";} @list l1 	{mso-list-id:959148657; 	mso-list-type:hybrid; 	mso-list-template-ids:-634772164 67698691 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l1:level1 	{mso-level-number-format:bullet; 	mso-level-text:o; 	mso-level-tab-stop:1.0in; 	mso-level-number-position:left; 	margin-left:1.0in; 	text-indent:-.25in; 	font-family:"Courier New";} @list l2 	{mso-list-id:1295524735; 	mso-list-type:hybrid; 	mso-list-template-ids:1932853032 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l2:level1 	{mso-level-number-format:bullet; 	mso-level-text:; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in; 	font-family:Symbol;} @list l3 	{mso-list-id:1315141469; 	mso-list-type:hybrid; 	mso-list-template-ids:509352152 67698691 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l3:level1 	{mso-level-number-format:bullet; 	mso-level-text:o; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in; 	font-family:"Courier New";} ol 	{margin-bottom:0in;} ul 	{margin-bottom:0in;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman"; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 11"&gt;&lt;meta name="Originator" content="Microsoft Word 11"&gt;&lt;link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CRKONKI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml"&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" latentstylecount="156"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman"; 	mso-fareast-font-family:"Times New Roman";} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.25in 1.0in 1.25in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman"; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="color:black;"&gt;ITDistributors is a Sun Microsystems Principal Partner specializing in the development of synchronized applications utilizing Sun's Glassfish Mobility Platform.  The Sun Glassfish Mobility Platform is the only open platform to deliver a complete solution for data synchronization to any smartphone.  Smartphones have become an increasingly popular extension to PC-based applications, both for consumers and business users.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="color:black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="color:black;"&gt;As a senior software architect at ITDistributors, I built a proof of concept of how the Sun GlassFish Mobility Platform can synchronize data from a cloud computing service, ITDistributors developed a mobile Twitter client by using the LWUIT api's and where all data transmissions are provided by  the Sun GlassFish Mobility Platform. It's important to note that although there are other network centric Twitter mobile clients available, you'll find their functionality limited since they are not using a synchronized technology. Example, any personal preferences such as changing your e-mail address or location is not done on other Twitter clients. Although it's not terribly important that these personal Twitter settings be changed on the mobile device, the point of this demo is to to emphasize that regardless what changes are made either from an Internet browser or your mobile smartphone, both environments are alway synchronized with the same data. We believe synchronized functionality becomes increasingly important and valuable when more complex cloud computing services come into play.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;The      main objective in choosing Twitter is to prove that SGMP connector can      call RESTful Web Services.&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;The      connector architecture is show in the following figure:&lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Dgw21WfjpPI/ScFF28QozdI/AAAAAAAAABo/UvckoHzXdk0/s1600-h/architecutre.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 192px;" src="http://3.bp.blogspot.com/_Dgw21WfjpPI/ScFF28QozdI/AAAAAAAAABo/UvckoHzXdk0/s320/architecutre.bmp" alt="" id="BLOGGER_PHOTO_ID_5314605845465058770" border="0" /&gt;&lt;/a&gt;&lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;The connector uses the Twitter SaaS operations, obtained using Netbeans IDE-Web Service Manager, to call the Twitter functionality exposed via API that confirms to the REST architecture.&lt;/p&gt;  &lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;Connector      calls the following Twitter APIs:&lt;/li&gt;&lt;ul style="margin-top: 0in;" type="circle"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;i style=""&gt;Authentication&lt;/i&gt;: &lt;a href="http://twitter.com/account/verify_credentials.format"&gt;http://twitter.com/account/verify_credentials.format&lt;/a&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;i style=""&gt;Friends Tweets&lt;/i&gt;: &lt;a href="http://twitter.com/statuses/friends_timeline.format"&gt;http://twitter.com/statuses/friends_timeline.format&lt;/a&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;i style=""&gt;Status Update&lt;/i&gt;: &lt;a href="http://twitter.com/statuses/update.format"&gt;http://twitter.com/statuses/update.format&lt;/a&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;i style=""&gt;Profile Update&lt;/i&gt;: &lt;a href="http://twitter.com/account/update_profile.format"&gt;http://twitter.com/account/update_profile.format&lt;/a&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;i style=""&gt;Delivery Device Update&lt;/i&gt;: &lt;a href="http://twitter.com/account/update_delivery_device.format"&gt;http://twitter.com/account/update_delivery_device.format&lt;/a&gt;&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;&lt;i style=""&gt;End Session&lt;/i&gt;: &lt;a href="http://twitter.com/account/end_session.format"&gt;http://twitter.com/account/end_session.format&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;There      is a one-to-one correspondence between api and methods used by connector. The      following method’s code snippets show getting and posting the data from      and to the Twitter account&lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;ul style="margin-top: 0in;" type="circle"&gt;&lt;li class="MsoNormal" style=""&gt;public       static RestResponse verifyCredentials(String format, String credentials)       throws IOException {&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in;"&gt;&lt;span style=""&gt;        &lt;/span&gt;String[][] pathParams = new String[][]{{"{format}", format}};&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in;"&gt;&lt;span style=""&gt;        &lt;/span&gt;String[][] queryParams = new String[][]{};&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 78pt;"&gt;RestConnection conn = new RestConnection("http://twitter.com/account/verify_credentials.{format}", pathParams, queryParams);&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in;"&gt;&lt;span style=""&gt;        &lt;/span&gt;sleep(1000);&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in;"&gt;&lt;span style=""&gt;        &lt;/span&gt;String[][] httpHeaders = new String[][]{{"authorization", credentials}};&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in;"&gt;&lt;span style=""&gt;        &lt;/span&gt;return conn.get(httpHeaders);&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in;"&gt;&lt;span style=""&gt;    &lt;/span&gt;}&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;o&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;public static RestResponse updateStatus(String status, String inReplyToStatusId, String format, String credentials) throws IOException {&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in;"&gt;&lt;span style=""&gt;        &lt;/span&gt;String[][] pathParams = new String[][]{{"{format}", format}};&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 78pt;"&gt;String[][] queryParams = new String[][]{{"status", status}, &lt;span style=""&gt;    &lt;/span&gt;{"in_reply_to_status_id", inReplyToStatusId}};&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 78pt;"&gt;RestConnection conn = new RestConnection("http://twitter.com/statuses/update.{format}", pathParams, null);&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in;"&gt;&lt;span style=""&gt;        &lt;/span&gt;sleep(1000);&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in;"&gt;&lt;span style=""&gt;        &lt;/span&gt;String[][] httpHeaders = new String[][]{{"authorization", credentials}};&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in;"&gt;&lt;span style=""&gt;        &lt;/span&gt;return conn.post(httpHeaders, queryParams);&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in;"&gt;&lt;span style=""&gt;    &lt;/span&gt;}&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;All      the above Twitter API methods require authentication; connector uses &lt;a href="http://en.wikipedia.org/wiki/Basic_authentication_scheme"&gt;HTTP Basic      Authentication&lt;/a&gt;. When authenticating via Basic Auth, user’s registered      username/email address and password are used. All responses are      relative to the context of the authenticating user. Hence, each method      that calls twitter api sends encoded user/password as part of basic      authentication. &lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;String credentials = BasicAuth.encode(loginName, password);&lt;span style=""&gt;  &lt;/span&gt;  &lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;Connector      is developed and deployed using MEP Connector Archetype (RAR) template. It      basically uses 5 template classes comprising business logic and few helper      classes.&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Business      Object uses the following attributes that correspond to the Twitter’s      personal account information. &lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style=""&gt;    &lt;/span&gt;private String userName;&lt;span style=""&gt;    &lt;/span&gt;//login name or screen name&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style=""&gt;    &lt;/span&gt;private String encodedUsrPswd; // BasicAuth.encode(loginName, password)&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style=""&gt;    &lt;/span&gt;private String location;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style=""&gt;    &lt;/span&gt;private String deviceDeliveryType;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style=""&gt;    &lt;/span&gt;private String statusMsg;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style=""&gt;    &lt;/span&gt;private String operationType;&lt;span style=""&gt;  &lt;/span&gt;//determines the method to be invoked &lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style=""&gt;    &lt;/span&gt;private String realName;&lt;span style=""&gt;    &lt;/span&gt;//name&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style=""&gt;    &lt;/span&gt;private String email;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style=""&gt;    &lt;/span&gt;private String url;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style=""&gt;    &lt;/span&gt;private String description;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style=""&gt;    &lt;/span&gt;private String message;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style=""&gt;    &lt;/span&gt;private String time;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style=""&gt;    &lt;/span&gt;private String userId;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style=""&gt;    &lt;/span&gt;private String profileImage;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;The      functionality has been divided under two categories: one for getting the      data from twitter and other for posting the data to the twitter. &lt;/li&gt;&lt;ul style="margin-top: 0in;" type="circle"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;i style=""&gt;Getting data&lt;/i&gt;: verifyCredentials and       getFriendsTimeline methods accomplish this task. &lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;  &lt;p class="MsoNormal" style="margin-left: 1in;"&gt;BusinessObjectProvider’s initialize() method calls &lt;span style=""&gt; &lt;/span&gt;verifyCredentials&lt;span style=""&gt;  &lt;/span&gt;method. The sample code snippet as follows:&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1in;"&gt;SessionContext &lt;span style=""&gt; &lt;/span&gt;sessionContext = getSessionContext();&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1in;"&gt;String credentials = sessionContext.getPassword();&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1in;"&gt;//basically password is formed at the client by calling //BasicAuth.encode(loginName, password);&lt;span style=""&gt;  &lt;/span&gt; &lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1in;"&gt;verifyCredentials("xml", credentials);&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1in;"&gt;BusinessObjectProvider’s getBusinessObjects() method calls&lt;span style=""&gt;  &lt;/span&gt;getFriendsTimeline method.&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;ul style="margin-top: 0in;" type="circle"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;i style=""&gt;Posting data&lt;/i&gt;: updateStatus, updateProfile,       updateDeliveryDevice and endSession methods accomplish this task.       InsertCommand’s execute method calls these methods based on the operation       selected by the user at the client. For example updateProfile method is       called in the following way:&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in; text-indent: 0.5in;"&gt;updateProfile(&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                            &lt;/span&gt;realName, email, url, location, description, format, encodedUsrPswd);&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;li class="MsoNormal" style=""&gt;Twitter      application allows multiple users to login to their personal Twitter accounts      using client. As part of this requirement, file names are made unique by      having the user’s login name as part of the file name.&lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;span style=""&gt;   &lt;/span&gt;&lt;span style=""&gt;                                                        &lt;/span&gt;&lt;b style=""&gt;CLIENT&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;Twitter Client has the following functionalities:&lt;/p&gt;  &lt;ul style="margin-top: 0in;" type="circle"&gt;&lt;li class="MsoNormal" style=""&gt;Login      form: This has username, password and server url fields. During sync      operation, client saves the username, password, url and encoded userpswd      in the record store. It syncs with the server by using encoded userpswd,      which would be sufficient to authenticate with twitter apis, in the setCredentials      method. As soon as the user opens the app, user sees this form for the      initial login.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Dgw21WfjpPI/ScFFcqhuXCI/AAAAAAAAABQ/wW6kf_qUne8/s1600-h/Login.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 199px; height: 320px;" src="http://4.bp.blogspot.com/_Dgw21WfjpPI/ScFFcqhuXCI/AAAAAAAAABQ/wW6kf_qUne8/s320/Login.jpg" alt="" id="BLOGGER_PHOTO_ID_5314605394028289058" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;ul style="margin-top: 0in;" type="circle"&gt;&lt;li class="MsoNormal" style=""&gt;Tweets      form: This displays the latest tweets. During sync operation, client calls      BusinessObjectStorage’s listBusinessObjectNames() method to get the      filenames of tweets objects comprising tweets information such as friend’s      real profile image, screen name, message and time.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Dgw21WfjpPI/ScFFtW5iMHI/AAAAAAAAABY/-S-0EIlEF58/s1600-h/Tweets.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 174px; height: 320px;" src="http://3.bp.blogspot.com/_Dgw21WfjpPI/ScFFtW5iMHI/AAAAAAAAABY/-S-0EIlEF58/s320/Tweets.jpg" alt="" id="BLOGGER_PHOTO_ID_5314605680817221746" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;ul style="margin-top: 0in;" type="circle"&gt;&lt;li class="MsoNormal" style=""&gt;Settings      form: This displays user’s personal information such as real name, email,      url, description, location and device delivery type. Settings object is      part of Tweets objects, which are formed at the server during sync      operation. User can change the personal information and sync with twitter      account. During sync operation, client creates a new BusinessObject      comprising the changed information along with setting operation info and      writes the object by calling BusinessObjectStorage’s writeBusinessObject      method.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Dgw21WfjpPI/ScFFx92zeII/AAAAAAAAABg/0cBrrg0eykQ/s1600-h/Settings.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 199px; height: 320px;" src="http://2.bp.blogspot.com/_Dgw21WfjpPI/ScFFx92zeII/AAAAAAAAABg/0cBrrg0eykQ/s320/Settings.jpg" alt="" id="BLOGGER_PHOTO_ID_5314605759994230914" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;ul style="margin-top: 0in;" type="circle"&gt;&lt;li class="MsoNormal" style=""&gt;Update      form: This has “what are you doing?” field. User can add the text and sync      with twitter account. During sync operation, client creates a new      BusinessObject comprising the added information along with update      operation info and writes the object by calling BusinessObjectStorage’s      writeBusinessObject method.&lt;/li&gt;&lt;li class="MsoNormal" style=""&gt;Logout      option: User can opt to logout if user decides to login to a different      twitter account. Client deletes the cached business object files and      record store containing credential information. During sync operation, client      creates a new BusinessObject comprising the logout operation info and      writes the object by calling BusinessObjectStorage’s writeBusinessObject      method.&lt;/li&gt;&lt;/ul&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5129155740138768789-2762939476208540451?l=rajivkonkimalla.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rajivkonkimalla.blogspot.com/feeds/2762939476208540451/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rajivkonkimalla.blogspot.com/2009/03/synchronizing-twitter-data-using-suns.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5129155740138768789/posts/default/2762939476208540451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5129155740138768789/posts/default/2762939476208540451'/><link rel='alternate' type='text/html' href='http://rajivkonkimalla.blogspot.com/2009/03/synchronizing-twitter-data-using-suns.html' title='Synchronizing Twitter data using Sun&apos;s GlassFish Mobility Platform'/><author><name>Rajiv Konkimalla</name><uri>http://www.blogger.com/profile/04132149846220145460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_Dgw21WfjpPI/ScE3yqxlngI/AAAAAAAAAAM/kWKTIoY4-Xc/S220/Rajiv1.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_Dgw21WfjpPI/ScFF28QozdI/AAAAAAAAABo/UvckoHzXdk0/s72-c/architecutre.bmp' height='72' width='72'/><thr:total>1</thr:total></entry></feed>
