2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 using System.Collections.Generic;
19 using System.Runtime.InteropServices;
20 using System.Diagnostics.CodeAnalysis;
22 namespace Tizen.Pims.Calendar
25 /// Delegate for detecting the calendar database changes.
27 /// <param name="uri">The record uri</param>
29 /// The delegate must be registered using AddDBChangedDelegate.
30 /// It's invoked when the designated view changes.
32 public delegate void CalendarDBChanged(string uri);
35 /// CalendarDatabase provides methods to manage calendar information from/to the database.
38 /// This class allows user to access/create/update db operations for calendar information.
40 public class CalendarDatabase
42 private Object thisLock = new Object();
43 private Dictionary<string, CalendarDBChanged> _callbackMap = new Dictionary<string, CalendarDBChanged>();
44 private Dictionary<string, Interop.Database.DBChangedCallback> _delegateMap = new Dictionary<string, Interop.Database.DBChangedCallback>();
45 private Interop.Database.DBChangedCallback _dbChangedDelegate;
47 internal CalendarDatabase()
49 ///To be created in CalendarManager only
53 /// The calendar database version.
55 /// <value>The current calendar database version.</value>
56 [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
62 int error = Interop.Database.GetCurrentVersion(out version);
63 if (CalendarError.None != (CalendarError)error)
65 Log.Error(Globals.LogTag, "Version Failed with error " + error);
72 /// Gets last successful changed calendar database version on the current connection.
74 /// <returns>The last successful changed calendar database version on the current connection</returns>
75 /// <privilege>http://tizen.org/privilege/calendar.read</privilege>
76 /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
77 /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
78 /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
79 /// <value>The last successful changed calendar database version on the current connection.</value>
80 [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
81 public int LastChangeVersion
86 int error = Interop.Database.GetLastChangeVersion(out version);
87 if (CalendarError.None != (CalendarError)error)
89 Log.Error(Globals.LogTag, "LastChangeVersion Failed with error " + error);
96 /// Inserts a record into the calendar database.
98 /// <param name="record">The record to be inserted</param>
99 /// <returns>The ID of inserted record</returns>
100 /// <privilege>http://tizen.org/privilege/calendar.write</privilege>
101 /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
102 /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
103 /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
104 /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
105 /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
106 [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
107 public int Insert(CalendarRecord record)
110 int error = Interop.Database.Insert(record._recordHandle, out id);
111 if (CalendarError.None != (CalendarError)error)
113 Log.Error(Globals.LogTag, "Insert Failed with error " + error);
114 throw CalendarErrorFactory.GetException(error);
120 /// Gets a record from the calendar database.
122 /// <param name="viewUri">The view URI of a record</param>
123 /// <param name="recordId">The record ID</param>
125 /// The record associated with the record ID
127 /// <privilege>http://tizen.org/privilege/calendar.read</privilege>
128 /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
129 /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
130 /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
131 /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
132 /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
133 [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
134 [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")]
135 public CalendarRecord Get(string viewUri, int recordId)
138 int error = Interop.Database.Get(viewUri, recordId, out handle);
139 if (CalendarError.None != (CalendarError)error)
141 if (CalendarError.DBNotFound == (CalendarError)error)
143 Log.Error(Globals.LogTag, "No data" + error);
146 Log.Error(Globals.LogTag, "Get Failed with error " + error);
147 throw CalendarErrorFactory.GetException(error);
149 return new CalendarRecord(handle);
153 /// Updates a record in the calendar database.
155 /// <param name="record">The record to be updated</param>
156 /// <privilege>http://tizen.org/privilege/calendar.write</privilege>
157 /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
158 /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
159 /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
160 /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
161 /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
162 [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
163 public void Update(CalendarRecord record)
165 int error = Interop.Database.Update(record._recordHandle);
166 if (CalendarError.None != (CalendarError)error)
168 Log.Error(Globals.LogTag, "Update Failed with error " + error);
169 throw CalendarErrorFactory.GetException(error);
174 /// Deletes a record from the calendar database with related child records.
176 /// <param name="viewUri">The view URI of a record</param>
177 /// <param name="recordId">The record ID to be deleted</param>
178 /// <privilege>http://tizen.org/privilege/calendar.write</privilege>
179 /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
180 /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
181 /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
182 /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
183 /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
184 [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
185 [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")]
186 public void Delete(string viewUri, int recordId)
188 int error = Interop.Database.Delete(viewUri, recordId);
189 if (CalendarError.None != (CalendarError)error)
191 Log.Error(Globals.LogTag, "Delete Failed with error " + error);
192 throw CalendarErrorFactory.GetException(error);
197 /// Replaces a record in the calendar database.
199 /// <param name="record">The record to be replaced</param>
200 /// <param name="id">the record id</param>
201 /// <privilege>http://tizen.org/privilege/calendar.write</privilege>
202 /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
203 /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
204 /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
205 /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
206 /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
207 [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
208 public void Replace(CalendarRecord record, int id)
210 int error = Interop.Database.Replace(record._recordHandle, id);
211 if (CalendarError.None != (CalendarError)error)
213 Log.Error(Globals.LogTag, "Replace Failed with error " + error);
214 throw CalendarErrorFactory.GetException(error);
219 /// Retrieves all records as a list.
221 /// <param name="viewUri">The view URI to get records from</param>
222 /// <param name="offset">The index from which results are received</param>
223 /// <param name="limit">The maximum number of results(value 0 is used for all records)</param>
227 /// <privilege>http://tizen.org/privilege/calendar.read</privilege>
228 /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
229 /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
230 /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
231 /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
232 /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
233 [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
234 [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")]
235 public CalendarList GetAll(string viewUri, int offset, int limit)
238 int error = Interop.Database.GetAllRecords(viewUri, offset, limit, out handle);
239 if (CalendarError.None != (CalendarError)error)
241 Log.Error(Globals.LogTag, "GetAll Failed with error " + error);
242 throw CalendarErrorFactory.GetException(error);
244 return new CalendarList(handle);
248 /// Retrieves records using a query.
250 /// <param name="query">The query used to filter results</param>
251 /// <param name="offset">The index from which results are received</param>
252 /// <param name="limit">The maximum number of results(value 0 is used for all records)</param>
256 /// <privilege>http://tizen.org/privilege/calendar.read</privilege>
257 /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
258 /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
259 /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
260 /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
261 /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
262 [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
263 public CalendarList GetRecordsWithQuery(CalendarQuery query, int offset, int limit)
266 int error = Interop.Database.GetRecords(query._queryHandle, offset, limit, out handle);
267 if (CalendarError.None != (CalendarError)error)
269 Log.Error(Globals.LogTag, "GetAllWithQuery Failed with error " + error);
270 throw CalendarErrorFactory.GetException(error);
272 return new CalendarList(handle);
276 /// Inserts multiple records into the calendar database as a batch operation.
278 /// <param name="list">The record list</param>
280 /// The inserted record id array
282 /// <privilege>http://tizen.org/privilege/calendar.write</privilege>
283 /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
284 /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
285 /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
286 /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
287 /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
288 [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
289 public int[] Insert(CalendarList list)
293 int error = Interop.Database.InsertRecords(list._listHandle, out ids, out count);
294 if (CalendarError.None != (CalendarError)error)
296 Log.Error(Globals.LogTag, "Insert Failed with error " + error);
297 throw CalendarErrorFactory.GetException(error);
299 int[] idArr = new int[count];
300 Marshal.Copy(ids, idArr, 0, count);
306 /// Updates multiple records into the calendar database as a batch operation.
308 /// <param name="list">The record list</param>
309 /// <privilege>http://tizen.org/privilege/calendar.write</privilege>
310 /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
311 /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
312 /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
313 /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
314 /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
315 [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
316 public void Update(CalendarList list)
318 int error = Interop.Database.UpdateRecords(list._listHandle);
319 if (CalendarError.None != (CalendarError)error)
321 Log.Error(Globals.LogTag, "Update Failed with error " + error);
322 throw CalendarErrorFactory.GetException(error);
327 /// Deletes multiple records with related child records from the calendar database as a batch operation.
329 /// <param name="viewUri">The view URI of the records to delete</param>
330 /// <param name="idArray">The record IDs to delete</param>
331 /// <privilege>http://tizen.org/privilege/calendar.write</privilege>
332 /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
333 /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
334 /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
335 /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
336 /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
337 [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
338 [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")]
339 public void Delete(string viewUri, int[] idArray)
341 int error = Interop.Database.DeleteRecords(viewUri, idArray, idArray.Length);
342 if (CalendarError.None != (CalendarError)error)
344 Log.Error(Globals.LogTag, "Delete Failed with error " + error);
345 throw CalendarErrorFactory.GetException(error);
350 /// Deletes multiple records with related child records from the calendar database as a batch operation.
352 /// <param name="list">The record list</param>
353 /// <privilege>http://tizen.org/privilege/calendar.write</privilege>
354 /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
355 /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
356 /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
357 /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
358 /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
359 public void Delete(CalendarList list)
361 CalendarRecord record = null;
365 int[] ids = new int[list.Count];
369 for (i = 0; i < list.Count; i++)
371 record = list.GetCurrentRecord();
374 if (0 == String.Compare(CalendarViews.Book.Uri, record.Uri))
375 propertyId = CalendarViews.Book.Id;
376 else if (0 == String.Compare(CalendarViews.Event.Uri, record.Uri))
377 propertyId = CalendarViews.Event.Id;
378 else if (0 == String.Compare(CalendarViews.Todo.Uri, record.Uri))
379 propertyId = CalendarViews.Todo.Id;
380 else if (0 == String.Compare(CalendarViews.Timezone.Uri, record.Uri))
381 propertyId = CalendarViews.Timezone.Id;
382 else if (0 == String.Compare(CalendarViews.Extended.Uri, record.Uri))
383 propertyId = CalendarViews.Extended.Id;
386 Log.Error(Globals.LogTag, "Invalid uri [" + record.Uri + "]");
390 ids[i] = record.Get<int>(propertyId);
393 Delete(record.Uri, ids);
397 /// Replaces multiple records in the calendar database as a batch operation.
399 /// <param name="list">The record list</param>
400 /// <param name="idArray">The record IDs</param>
401 /// <privilege>http://tizen.org/privilege/calendar.write</privilege>
402 /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
403 /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
404 /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
405 /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
406 /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
407 [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
408 public void Replace(CalendarList list, int[] idArray)
410 int error = Interop.Database.ReplaceRecords(list._listHandle, idArray, idArray.Length);
411 if (CalendarError.None != (CalendarError)error)
413 Log.Error(Globals.LogTag, "Replace Failed with error " + error);
414 throw CalendarErrorFactory.GetException(error);
419 /// Retrieves records with the given calendar database version.
421 /// <param name="viewUri">The view URI to get records from</param>
422 /// <param name="BookId">The calendar book ID to filter</param>
423 /// <param name="calendarDBVersion">The calendar database version</param>
424 /// <param name="currentDBVersion">The current calendar database version</param>
428 /// <privilege>http://tizen.org/privilege/calendar.read</privilege>
429 /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
430 /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
431 /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
432 /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
433 /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
434 [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
435 [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")]
436 public CalendarList GetChangesByVersion(string viewUri, int BookId, int calendarDBVersion, out int currentDBVersion)
439 int error = Interop.Database.GetChangesByVersion(viewUri, BookId, calendarDBVersion, out recordList, out currentDBVersion);
440 if (CalendarError.None != (CalendarError)error)
442 Log.Error(Globals.LogTag, "GetChangesByVersion Failed with error " + error);
443 throw CalendarErrorFactory.GetException(error);
445 return new CalendarList(recordList);
449 /// Gets the record count of a specific view.
451 /// <param name="viewUri">The view URI to get records from</param>
453 /// The count of records
455 /// <privilege>http://tizen.org/privilege/calendar.read</privilege>
456 [SuppressMessage("Microsoft.Design", "CA1822:MarkMembersAsStatic")]
457 [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")]
458 public int GetCount(string viewUri)
461 int error = Interop.Database.GetCount(viewUri, out count);
462 if (CalendarError.None != (CalendarError)error)
464 Log.Error(Globals.LogTag, "GetCount Failed with error " + error);
465 throw CalendarErrorFactory.GetException(error);
471 /// Gets the record count with a query.
473 /// <param name="query">The query used for filtering the results</param>
475 /// The count of records
477 /// <privilege>http://tizen.org/privilege/calendar.read</privilege>
478 [SuppressMessage("Microsoft.Design", "CA1822:MarkMembersAsStatic")]
479 public int GetCount(CalendarQuery query)
482 int error = Interop.Database.GetCountWithQuery(query._queryHandle, out count);
483 if (CalendarError.None != (CalendarError)error)
485 Log.Error(Globals.LogTag, "GetCount Failed with error " + error);
486 throw CalendarErrorFactory.GetException(error);
492 /// Registers a callback function to be invoked when a record changes.
494 /// <param name="viewUri">The view URI of the record to subscribe for change notifications</param>
495 /// <param name="callback">The callback function to register</param>
496 /// <privilege>http://tizen.org/privilege/calendar.read</privilege>
497 [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")]
498 public void AddDBChangedDelegate(string viewUri, CalendarDBChanged callback)
500 Log.Debug(Globals.LogTag, "AddDBChangedDelegate");
502 _dbChangedDelegate = (string uri, IntPtr userData) =>
504 _callbackMap[uri](uri);
506 int error = Interop.Database.AddChangedCallback(viewUri, _dbChangedDelegate, IntPtr.Zero);
507 if (CalendarError.None != (CalendarError)error)
509 Log.Error(Globals.LogTag, "AddDBChangedDelegate Failed with error " + error);
510 throw CalendarErrorFactory.GetException(error);
512 _callbackMap[viewUri] += callback;
513 _delegateMap[viewUri] = _dbChangedDelegate;
517 /// Deregisters a callback function.
519 /// <param name="viewUri">The view URI of the record to subscribe for change notifications</param>
520 /// <param name="callback">The callback function to register</param>
521 /// <privilege>http://tizen.org/privilege/calendar.read</privilege>
522 [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")]
523 public void RemoveDBChangedDelegate(string viewUri, CalendarDBChanged callback)
525 Log.Debug(Globals.LogTag, "RemoveDBChangedDelegate");
527 int error = Interop.Database.RemoveChangedCallback(viewUri, _delegateMap[viewUri], IntPtr.Zero);
528 if (CalendarError.None != (CalendarError)error)
530 Log.Error(Globals.LogTag, "RemoveDBChangedDelegate Failed with error " + error);
531 throw CalendarErrorFactory.GetException(error);
533 _callbackMap[viewUri] -= callback;
534 _delegateMap.Remove(viewUri);
538 /// Link a record to another record.
540 /// <param name="baseId">The base record ID</param>
541 /// <param name="recordId">The record ID to link to</param>
542 /// <privilege>http://tizen.org/privilege/calendar.write</privilege>
543 /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
544 /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
545 /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
546 /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
547 /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
548 [SuppressMessage("Microsoft.Design", "CA1822:MarkMembersAsStatic")]
549 public void LinkRecord(int baseId, int recordId)
551 Log.Debug(Globals.LogTag, "LinkRecord");
552 int error = Interop.Database.LinkRecord(baseId, recordId);
553 if (CalendarError.None != (CalendarError)error)
555 Log.Error(Globals.LogTag, "LinkRecor Failed with error " + error);
556 throw CalendarErrorFactory.GetException(error);
561 /// Unlink a record from base record.
563 /// <param name="recordId">The record ID to unlink</param>
564 /// <privilege>http://tizen.org/privilege/calendar.write</privilege>
565 /// <exception cref="InvalidOperationException">Thrown when method failed due to invalid operation</exception>
566 /// <exception cref="NotSupportedException">Thrown when an invoked method is not supported</exception>
567 /// <exception cref="ArgumentException">Thrown when one of the arguments provided to a method is not valid</exception>
568 /// <exception cref="OutOfMemoryException">Thrown when failed due to out of memory</exception>
569 /// <exception cref="UnauthorizedAccessException">Thrown when application does not have proper privileges</exception>
570 [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
571 public void UnlinkRecord(int recordId)
573 Log.Debug(Globals.LogTag, "UnlinkRecord");
574 int error = Interop.Database.UnlinkRecord(recordId);
575 if (CalendarError.None != (CalendarError)error)
577 Log.Error(Globals.LogTag, "UnlinkRecor Failed with error " + error);
578 throw CalendarErrorFactory.GetException(error);