SyncML Apresentação –Introdução Motivação Iniciativa SyncML –XML (eXtensible Markup...
-
Upload
edison-natal-ramires -
Category
Documents
-
view
231 -
download
0
Transcript of SyncML Apresentação –Introdução Motivação Iniciativa SyncML –XML (eXtensible Markup...
SyncML
• Apresentação– Introdução
• Motivação• Iniciativa SyncML
– XML (eXtensible Markup Language)– Protocolos SyncML– Sincronização em duas vias– Conclusões
Introdução
• Necessidade de sincronização• Vários protocolos no mercado
– Nem todos os servidores de dados podem sincronizar com qualquer aparelho.
– Nem todo aparelho pode sincronizar com qualquer servidor de dados
– Inconvenientes para o usuário final
Introdução
• Ericsson, IBM, Lotus, Motorola, Nokia, Palm Inc., Psion e Starfish Software– Iniciativa SyncML
• Uma especificação de arquitetura• Duas especificações de protocolo• Interface em uma linguagem de programação
comum
Introdução
• Protocolo de sincronização– Conectar dados em um repositório– Atualizar dados– Reconectar a rede– Resolver Conflitos
• Um protocolo de sincronização de dados define fluxo de trabalho para comunicação durante uma sessão de sincronização de dados em que o aparelho móvel está conectado à rede.
Introdução
• Benefícios de um protocolo de sincronização comum– Usuário final– Empresas que fabricam os aparelhos– Desenvolvedores de Aplicações
Introdução
• Características de um protocolo de sincronização comum– Operar efetivamente sobre rede fixa e rede móvel– Suportar uma variedade de protocolos de
transporte– Suportar uma variedade de base de dados.– Habilitar acessa de dados de uma variedade de
aplicações
Introdução
– Ser compatível com as limitações de recursos de aparelhos móveis
– Ser construído sob uma tecnologia de internet e web existentes.
eXtensible Markup Language
• XML é uma meta linguagem de marcação• Fornece um formato padrão para a
descrição de dados estruturados.• Vantagens
– Declarações mais precisas quanto ao conteúdo– Resultados mais significativos para consultas
em diferentes plataformas.
eXtensible Markup Language
– A especificação XML descreve um dialeto SGML extremamente simples.
• <previsao_tempo> <data>09 Mai 2000 </data> <hora>08:00</hora> <area> <cidade>Rio de Janeiro </cidade> <estado>RJ</estado> <regiao>Sudeste</regiao> <pais>Brasil</pais> </area> <medicao> <tempo>parcialmente nublado</tempo> <temperatura>25</temperatura> <vento> <direcao>SE</direcao> <velocidade>6</ velocidade> </vento> <umidade>87</umidade> <visibilidade>10</visibilidade> </medicao></ previsao_tempo>
<DevI nf xml ns=’ syncml : devi nf ’ ><VerDTD>1. 1</ VerDTD><Man>Bi g Factory, Ltd. </Man><Mod>4119</Mod><OEM>J ane’ s phones</ OEM><FwV>2. 0e</ FwV><SwV>2. 0</ SwV><HwV>1. 22I </ HwV><DevI D>1218182THD000001- 2</ DevI D><DevTyp>phone</ DevTyp></ UTC></ SupportLargeObj s></ SupportNumberOf Changes><DataStore>
<SourceRef>. / contacts</ SourceRef><Di spl ayName>Phonebook</ Di spl ayName><MaxGUI DSi ze>32</MaxGUI DSi ze><Rx- Pref>
<CTType>text / vcard</ CTType><VerCT>3. 0</ VerCT>
</ Rx- Pref><Tx- Pref>
<CTType>text / vcard</ CTType><VerCT>3. 0</ VerCT>
</ Tx- Pref><Tx>
<CTType>text / x- vcard</ CTType><VerCT>2. 1</ VerCT>
</ Tx><DSMem>
<MaxMem>32650</MaxMem><MaxI D>250</MaxID>
</ DSMem><SyncCap>
<SyncType>1</ SyncType><SyncType>7</ SyncType>
</ SyncCap>
. . . . . .</ DataStore>
</ DevI nf>
1
Protocolos SyncML
Protocolos SyncML• Protocolo de representação
– Foca sob a organização dos conteúdos dos dados da sincronização.
– Define métodos para identificar e nomear arquivos de maneira única.
– Add, Alert, Atomic, Copy, Delete, Get, ...• Protocolo de Sincronização
– Foca sob a administração das operações de sincronização.
– Define fluxo de mensagens entre um SyncML cliente e um servidor durante a sessão de sincronização de dados.
Protocolos SyncML• Protocolo de Representação
– Formato de dados• MIME media Type
– Capacidade de Troca• Get, Put
– Restaurando dados• refresh
– Deleção Forte e suave• Delete
– Arquivando dados• Archive
– Substituindo Dados• Replace
• Protocolo de representação– Procurando dados
• Search
– Localização– Endereço de Alvo e Fonte
• LocURI– URI ou URN, ou ainda um identificador local único– Display opcional
<SyncML><SyncHdr><VerDTD>1. 0</ VerDTD><VerProto>SyncML/ 1. 0</ VerProto><Sessi onI D>1</ Sessi onI D><MsgI D>2</MsgI D><Target><LocURI >my_phone</ LocURI ></ Target><Source>
<LocURI >ht tp: / / www. webyu.com/ servl et s/ samsbook</ LocURI ></ Source>
</ SyncHdr><SyncBody>
<Sync><CmdI D>1</ CmdI D><Target><LocURI >Cal endarDB</ LocURI ></ Target><Source><LocURI >samsbook.nsf</ LocURI ></ Source><!- - Add a new record to the Cal endarDB, record I D 2021 - -><Add>
<CmdI D>4</ CmdI D><Meta><mi : Type>text / x-vCal endar</mi : Type></Meta><I tem>
<Source><LocURI >2021</ LocURI ></ Source><Data><!- - The vCal endar data woul d be pl aced here. - ->
BEGI N: VCALENDARVERSI ON: 1. 0BEGI N: VEVENTDTSTART: 20010510T063000ZDTEND: 20010510T073000ZSUMMARY: SyncML Test Checkpoi nt DB002021DESCRI PTI ON; ENCODI NG=QUOTED- PRI NTABLE: J ohn =
Smi th i s st i l l t he presenter . =0D=0ASyncML =i s the topi c.CLASS: PUBLI CCATEGORI ES: APPOINTMENTAALARM: 20010510T061500ZEND: VEVENTEND: VCALENDAR
</ Data></ I tem>
</ Add>
1
<!- - Del ete a record, record I D 2022 - -><Del ete>
<CmdI D>5</ CmdI D><Meta><mi : Type>text / x-vCal endar</mi : Type></Meta><I tem>
<Source><LocURI >2022</ LocURI ></ Source></ I tem>
</ Del ete></ Sync>
</ SyncBody></ SyncML>
1
• Protocolo de Sincronização– Tipos de Sincronização
• Duas vias• Sincronização Lenta• Uma via
– Servidor para cliente– Cliente para servidor
• Revigorante– Do cliente– Do servidor
• Alertada pelo servidor.
• Resolução de Conflitos– São resolvidas por uma máquina de
sincronização no aparelho servidor– Notifica aos clientes a respeito dos conflitos
resolvidos– A administração, e como a resolução de
conflito é configurada, não é tratada nos protocolos SyncML
<Status><MsgRef>1</MsgRef><CmdRef>2</ CmdRef><Cmd>Repl ace<Cmd><SourceRef>1212</ SourceRef><Data>208</ Data>
</ Status>
1
• Autenticação da sincronização– Autenticação Básica ou MD5– Exemplo:
<SyncML><SyncHdr>
<VerDTD>1. 0</ VerDTD><VerProto>SyncML/ 1. 0</ VerProto><Sessi onI D>1</ Sessi onI D><MsgI D>1</MsgI D><Target><LocURI >ht tp: / / www. syncml . org/ sync- server</ LocURI ></ Target><Source><LocURI >I MEI : 493005100592800</ LocURI ></ Source>
</ SyncHdr><SyncBody>. . .</ SyncBody>
</ SyncML>
1
<SyncML><SyncHdr>
<VerDTD>1. 0</ VerDTD><VerProto>SyncML/ 1. 0</ VerProto><Sessi onI D>1</ Sessi onI D><MsgI D>1</MsgI D><Target><LocURI >I MEI : 493005100592800</ LocURI ></ Target><Source><LocURI >ht tp: / / www. syncml . org/ sync- server</ LocURI ></ Source>
</ SyncHdr><SyncBody>
<Status><MsgRef>1</MsgRef><CmdRef>0</ CmdRef><Cmd>SyncHdr</ Cmd><TargetRef>ht tp: / / www.syncml . org/ sync- server</ TargetRef><SourceRef>I MEI : 493005100592800</ SourceRef><Chal >
<Meta><Type xml ns=’ syncml :met i nf ’ >syncml : auth- basi c</ Type><Format xml ns=’ syncml :met i nf ’ >b64</ Format>
</Meta></ Chal ><Data>407</ Data> <!- - Credenci al perdi da- ->
</ Status>. . .
</ SyncBody></ SyncML>
1
<SyncML><SyncHdr>
<VerDTD>1. 0</ VerDTD><VerProto>SyncML/ 1. 0</ VerProto><Sessi onI D>1</ Sessi onI D><MsgI D>2</MsgI D><Target><LocURI >ht tp: / / www. syncml . org/ sync- server</ LocURI ></ Target><Source><LocURI >I MEI : 493005100592800</ LocURI ></ Source>
<Cred><Meta><Type xml ns=’syncml :met i nf ’ >syncml : auth- basi c</ Type></Meta><Data>QnJ 1Y2UyOk9oQmVoYXZl </ Data>
<! - - - base64 f ormat t i ng of "user i d: password"- -></ Cred>
</ SyncHdr><SyncBody>
. . .</ SyncBody>
</ SyncML>
1
<SyncML><SyncHdr>
<VerDTD>1. 0</ VerDTD><VerProto>SyncML/ 1. 0</ VerProto><Sessi onI D>1</ Sessi onI D>
<MsgI D>2</MsgI D><Target><LocURI >I MEI : 493005100592800</ LocURI ></ Target><Source><LocURI >ht tp: / / www. syncml . org/ sync- server</ LocURI ></ Source>
</ SyncHdr><SyncBody>
<Status><MsgRef>1</MsgRef><CmdRef>0</ CmdRef><Cmd>SyncHdr</ Cmd><TargetRef>ht tp: / / www.syncml . org/ sync- server</ TargetRef><SourceRef>I MEI : 493005100592800</ SourceRef><Data>212</ Data> <!- - Sessao autent i cada- ->
</ Status>. . .
</ SyncBody></ SyncML>
1
• Inicialização da sincronização– Processar a autenticação entre o cliente e o
servidor– Indicar que a base de dados tem necessidade de
ser sincronizada e que tipo de sincronização será usada.
– Habilitar troca de capacidades de serviço do aparelho.
Sincronização em Duas vias
<SyncML><SyncHdr>
<VerDTD>1. 0</ VerDTD><VerProto>SyncML/ 1. 0</ VerProto><Sessi onI D>1</ Sessi onI D><MsgI D>1</MsgI D><Target><LocURI >ht tp: / / www. syncml . org/ sync- server</ LocURI ></ Target><Source><LocURI >I MEI : 493005100592800</ LocURI ></ Source><Cred> <!- - A autent i cao eh opci onal . - ->
<Meta><Type xml ns=’ syncml :met i nf ’ >syncml : auth- basi c</ Type></Meta><Data>QnJ 1Y2UyOk9oQmVoYXZl </ Data><!- - base64 f ormat t i ng of "user i d: password"- ->
</ Cred></ SyncHdr><SyncBody>
<Al ert><CmdI D>1</ CmdI D><Data>200</ Data> <!- - 200 = TWO_WAY_ALERT - -><I tem>
<Target><LocURI >. / contacts/ j ames_bond</ LocURI ></ Target><Source><LocURI >. / dev- contacts</ LocURI ></ Source><Meta>
<Anchor xml ns=’ syncml :met i nf ’ ><Last>234</ Last><Next>276</ Next>
</ Anchor></Meta>
</ I tem></ Al ert>
1
<Sync><CmdI D>2</ CmdI D><Target><LocURI >. / contacts/ j ames_bond</ LocURI ></ Target><Source><LocURI >. / dev-contacts</ LocURI ></ Source><Meta>
<Memxml ns=’ syncml :met i nf ’ ><FreeMem>8100</ FreeMem><!- - Free memory (bytes) i n Cal endar database on a devi ce - - >
<FreeI d>81</ FreeI d><!- - Number of f ree records i n Cal endar database- ->
</Mem></Meta><Repl ace>
<CmdI D>3</ CmdI D><Meta><Type xml ns=’syncml :met i nf ’ >text / x- vcard</ Type></Meta><I tem>
<Source><LocURI >1012</ LocURI ></ Source><Data><!- - The vCard data woul d be pl aced here. - -></ Data>
</ I tem></ Repl ace>
</ Sync><Fi nal / >
</ SyncBody></ SyncML>
1
<SyncML><SyncHdr>
<VerDTD>1. 0</ VerDTD><VerProto>SyncML/ 1. 0</ VerProto><Sessi onI D>1</ Sessi onI D><MsgI D>1</MsgI D><Target><LocURI >I MEI : 493005100592800</ LocURI ></ Target><Source><LocURI >ht tp: / / www. syncml . org/ sync- server</ LocURI ></ Source>
</ SyncHdr><SyncBody>
<Status><MsgRef>1</MsgRef><CmdRef>0</ CmdRef><Cmd>SyncHdr</ Cmd><TargetRef>ht tp: / / www.syncml . org/ sync- server</ TargetRef><SourceRef>I MEI : 493005100592800</ SourceRef><Data>212</ Data><!- - Statuscode f or OK, authent i cated f or sessi on- ->
</ Status><Status>
<MsgRef>1</MsgRef><CmdRef>1</ CmdRef><Cmd>Al ert</ Cmd><TargetRef>. / contacts/ j ames_bond</ TargetRef><SourceRef>. / dev- contacts</ SourceRef><Data>200</ Data> <!- - Statuscode f or OK- -><I tem>
<Data><Anchor xml ns=’ syncml :met i nf ’ ><Next>276</ Next></ Anchor></Data></ I tem>
</ Status><Status>
<MsgRef>1</MsgRef><CmdRef>2</ CmdRef><Cmd>Sync</ Cmd><TargetRef>. / contacts/ j ames_bond</ TargetRef><SourceRef>. / dev- contacts</ SourceRef><Data>200</ Data><!- - Statuscode f or Success- ->
</ Status><Status>
<MsgRef>1</MsgRef><CmdRef>3</ CmdRef><Cmd>Repl ace</ Cmd><SourceRef>1012</ SourceRef><Data>200</ Data> <!- - Statuscode f or Success- ->
</ Status>
1
<Al ert><CmdI D>1</ CmdI D><Data>200</Data><!- - 200 = TWO_WAY_ALERT - -><I tem>
<Target><LocURI >. / dev- contacts</ LocURI ></ Target><Source><LocURI >. / contacts/ j ames_bond</ LocURI ></ Source><Meta>
<Anchor xml ns=’ syncml :met i nf ’ ><Last>200005021T081812Z </ Last><Next>200005022T093223Z </ Next>
</ Anchor></Meta>
</ I tem></ Al ert><Sync>
<CmdI D>2</ CmdI D><Target><LocURI >. / dev-contacts</ LocURI ></ Target><Source><LocURI >. / contacts/ j ames_bond</ LocURI ></ Source><Repl ace>
<CmdI D>3</ CmdI D><Meta><Type xml ns=’syncml :met i nf ’ >text / x- vcard</ Type></Meta><I tem>
<Target><LocURI >1023</ LocURI ></ Target><Data><!- - The vCard data woul d be pl aced here. - -></ Data>
</ I tem></ Repl ace><Add>
<CmdI D>4</ CmdI D><Meta><Type xml ns=’syncml :met i nf ’ >text / x- vcard</ Type></Meta><I tem>
<Source><LocURI >10536681</ LocURI ></ Source><Data><!- - The vCard data woul d be pl aced here. - -></ Data>
</ I tem></ Add>
</ Sync><Fi nal / ></ SyncBody>
</ SyncML>
1
<SyncML><SyncHdr>
<VerDTD>1. 0</ VerDTD><VerProto>SyncML/ 1. 0</ VerProto><Sessi onI D>1</ Sessi onI D><MsgI D>3</MsgI D><Target><LocURI >ht tp: / / www. syncml . org/ sync- server</ LocURI ></ Target><Source><LocURI >I MEI : 493005100592800</ LocURI ></ Source>
</ SyncHdr><SyncBody>
<Status><MsgRef>2</MsgRef><CmdRef>0</ CmdRef><Cmd>SyncHdr</ Cmd><TargetRef>I MEI : 493005100592800</ TargetRef><SourceRef> ht tp: / / www. syncml . org/ sync- server </ SourceRef><Data>200</ Data>
</ Status><Status>
<MsgRef>2</MsgRef><CmdRef>1</ CmdRef><Cmd>Sync</ Cmd><TargetRef>. / dev- contacts</ TargetRef><SourceRef>. / contacts/ j ames_bond</ SourceRef><Data>200</ Data>
</ Status><Status>
<MsgRef>2</MsgRef><CmdRef>2</ CmdRef><Cmd>Repl ace</ Cmd><TargetRef>1023</ TargetRef><Data>200</ Data>
</ Status><Status>
<MsgRef>2</MsgRef><CmdRef>3</ CmdRef><Cmd>Add</ Cmd><SourceRef>10536681</ SourceRef><Data>200</ Data>
</ Status><Map>
<CmdI D>1</ CmdI D><Target><LocURI >. / contact s/ j ames_bond</ LocURI ></ Target><Source><LocURI >. / dev-contact s</ LocURI ></ Source><MapI tem>
<Target><LocURI >10536681</ LocURI ></ Target><Source><LocURI >1024</ LocURI ></ Source>
</MapI tem></Map><Fi nal / >
</ SyncBody></ SyncML>
1
<SyncML><SyncHdr>
<VerDTD>1. 0</ VerDTD><VerProto>SyncML/ 1. 0</ VerProto><Sessi onI D>1</ Sessi onI D><MsgI D>3</MsgI D><Target><LocURI >I MEI : 493005100592800</ LocURI ></ Target><Source><LocURI >ht tp: / / www. syncml . org/ sync- server</ LocURI ></ Source>
</ SyncHdr><SyncBody>
<Status><MsgRef>3</MsgRef><CmdRef>0</ CmdRef><Cmd>SyncHdr</ Cmd><TargetRef>ht tp: / / www.syncml . org/ sync- server</ TargetRef><SourceRef>I MEI : 493005100592800</ SourceRef><Data>200</ Data>
</ Status><Status>
<MsgRef>3</MsgRef><CmdRef>1</ CmdRef><Cmd>Map</ Cmd><TargetRef>. / contacts/ j ames_bond </ TargetRef><SourceRef>. / dev- contacts</ SourceRef><Data>200</ Data>
</ Status><Fi nal / >
</ SyncBody></ SyncML>
1
Conclusões
• Especificação aberta para sincronização universal de dados– Iniciada no final de 2000– Possui mais de 650 empresas
• Satisfaz todos pré-requisitos de um protocolo de sincronização.