|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <concept id="GUID-A5ED089C-8831-5E25-AE7C-8E6F1C21D3BE" xml:lang="en"><title>Writing |
|
13 a CSBEClient for Restore</title><shortdesc>This section describes the recommended <apiname>conn::CSBEClient</apiname> function |
|
14 calls for a partial and incremental restore. </shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
15 <section><title>Context</title> <p>A partial restore restores the data of |
|
16 specified data owners. The Security IDs (SIDs) of the specified data owners |
|
17 must be passed to the Backup Engine. </p> <p>An incremental restore restores |
|
18 files that are saved in the previous incremental backup. After each incremental |
|
19 backup, a snapshot, which saves the file list and details of each data owner, |
|
20 is saved. Before each incremental restore, the previously saved backup snapshots |
|
21 must be provided to the Backup Engine. </p> </section> |
|
22 <section id="GUID-FAF6DC1F-C569-5573-9503-EC65FF9C94E1"><title>Steps</title><ol id="GUID-5CF38BF0-1174-575C-929E-64C260260C0C"> |
|
23 <li id="GUID-AA22D309-4E70-527F-8B97-B18423E7A8CC"><p>The user application |
|
24 must instantiate <xref href="GUID-169BB4E2-5B0E-3719-A7B8-A3C0AAA602E2.dita#GUID-169BB4E2-5B0E-3719-A7B8-A3C0AAA602E2/GUID-FB671D02-0F15-396F-9FB7-EE3E9372093C"><apiname>conn::CSBEClient</apiname></xref> to connect to the Backup |
|
25 Engine. </p> <codeblock id="GUID-01B82F51-F453-5042-B77D-3AF1BC046A5F" xml:space="preserve">iRestoreClient = CSBEClient::NewL();</codeblock> </li> |
|
26 <li id="GUID-4DC27B19-1573-520F-98E7-FA77F524EEC1"><p>Supply the list of data |
|
27 owners got from the host PC to the Backup Engine. </p> <p>To restore the data |
|
28 of specified data owners, pass the array of the SID of these data owners to |
|
29 the Backup Engine. </p> <codeblock id="GUID-5F0F4CE6-AC01-5248-B9D5-BF15A3F7E38A" xml:space="preserve">iRestoreClient->SetSIDListForPartialBURL(RSIDArray& aSIDs);</codeblock> </li> |
|
30 <li id="GUID-1A91A122-BB2D-590F-8D3C-74BCA5100ABC"><p>Set the Back Engine |
|
31 to the restore mode which signals the start of a restore. </p> <p>The Backup |
|
32 Engine then <xref href="GUID-88A5F321-17BA-566B-B025-22DB11664E54.dita">publishes |
|
33 the mode to the subscribed data owners</xref>. This gives the data owners |
|
34 some time to prepare for the restore, for example they can release resources |
|
35 in case of file lock or data conflict. </p> <p>The mode contains the restore |
|
36 types: full or partial, base or incremental. </p> <codeblock id="GUID-223EE0DD-DBD2-543C-9917-CD4DB938154E" xml:space="preserve">iRestoreClient->SetBURModeL ( |
|
37 const TDriveList& aDriveList, |
|
38 |
|
39 //Specify partial restore, |
|
40 //defined in epoc32/include/connect/sbdefs.h |
|
41 TBURPartType aBURType, |
|
42 |
|
43 //Specifiy incremental restore, |
|
44 //defined in epoc32/include/connect/sbdefs.h |
|
45 TBackupIncType aBackupIncType |
|
46 ); |
|
47 </codeblock> </li> |
|
48 <li id="GUID-7F3051A3-BD5C-591A-ABCE-74DED46E9E3D"><p>Supply system files |
|
49 to the Backup Engine for restore. </p> <codeblock id="GUID-8E1098CB-B432-51CE-8D80-292B6E185A70" xml:space="preserve">iRestoreClient ->SupplyDataL( |
|
50 CSBGenericTransferType& aGenericTransferType, |
|
51 TBool aFinished |
|
52 );</codeblock> </li> |
|
53 <li id="GUID-89F6E682-8B16-5B83-A791-52BE036EBC89"><p>Signal that all system |
|
54 files have been restored. </p> <p>This step must be invoked to ensure that |
|
55 system files have been released for data owners to use. It triggers the Backup |
|
56 Engine to start data owners for the restore. </p> <codeblock id="GUID-9F669D8B-3BFB-5EB2-A4A3-456B2F75DC4E" xml:space="preserve">iRestoreClient->AllSystemFilesRestored();</codeblock> </li> |
|
57 <li id="GUID-7BCA299B-803F-5C10-B9FB-4833983B0619"><p>Request the state of |
|
58 active data owners. </p> <p>This step ensures that the data owners are ready |
|
59 to supply the data, for example file locks are released. </p> <codeblock id="GUID-80A8205B-5B54-5986-A285-F185587573E6" xml:space="preserve">iRestoreClient->SIDStatusL(RSIDStatusArray& aSIDStatus);</codeblock> </li> |
|
60 <li id="GUID-113A8BCF-B055-51A7-B54B-AF1A8FA57A21"><p>Supply passive private |
|
61 data and its snapshot to the Backup Engine for restore. </p> <codeblock id="GUID-32C548A1-A04D-5470-B6BF-72B994183DFB" xml:space="preserve">iRestoreClient->SupplyDataL( |
|
62 CSBGenericTransferType& aGenericTransferType, |
|
63 TBool aFinished |
|
64 );</codeblock> <p> <b>Note</b>: For more information |
|
65 about creating snapshot transfer types, refer to the <xref href="GUID-8BFC185E-91FD-5E04-A26C-728B06F31FDD-GENID-1-7-1-23-1-1-4-1-3-1-6-1-6-1.dita">Creating |
|
66 transfer types</xref> section. </p> </li> |
|
67 <li id="GUID-C5ED3083-8876-59CB-8D3C-CB404F1CCC71"><p>The backup server restores |
|
68 the public files. </p> <p>Similar to a backup, the Backup Engine does not |
|
69 restore public files. Device creators must get the public files from the host |
|
70 PC and restore them to the device in their backup server implementations. </p> </li> |
|
71 <li id="GUID-2BE0338B-6C06-5159-A3F1-4B8B85E56048"><p>Supply active private |
|
72 data to the Backup Engine for restore. </p> <codeblock id="GUID-9CC18592-E7F6-517B-8937-4E06A2EC1E80" xml:space="preserve">iRestoreClient->SupplyDataL( |
|
73 CSBGenericTransferType& aGenericTransferType, |
|
74 TBool aFinished |
|
75 );</codeblock> </li> |
|
76 <li id="GUID-04CC0D4A-F4C1-5515-ABA3-9D746309455D"><p>Set the Backup Engine |
|
77 into the normal mode. </p> <p>After the data is restored on the device, set |
|
78 the Backup Engine to the normal mode. The subscribed data owners respond to |
|
79 the signal and resume the state before the backup. For example resume file |
|
80 locks or a GUI application recovers to the state and view prior to the restore. </p> <codeblock id="GUID-DA11715F-2F70-5AA8-978E-982B2C857E37" xml:space="preserve">iRestoreClient->SetBURModeL( |
|
81 const TDriveList& aDriveList, |
|
82 TBURPartType aBURType, |
|
83 TBackupIncType aBackupIncType |
|
84 );</codeblock> </li> |
|
85 </ol> </section> |
|
86 </conbody><related-links> |
|
87 <link href="GUID-0BD22FDB-1A5C-56AA-A7FC-BD2271B2F928.dita"><linktext>Writing a |
|
88 Backup Engine Client (CSBEClient)</linktext></link> |
|
89 </related-links></concept> |