zonewriter_inc.cc 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. // Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
  2. //
  3. // Permission to use, copy, modify, and/or distribute this software for any
  4. // purpose with or without fee is hereby granted, provided that the above
  5. // copyright notice and this permission notice appear in all copies.
  6. //
  7. // THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
  8. // REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  9. // AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
  10. // INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  11. // LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  12. // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  13. // PERFORMANCE OF THIS SOFTWARE.
  14. namespace {
  15. const char* const ZoneWriter_doc = "\
  16. Does an update to a zone.\n\
  17. \n\
  18. This represents the work of a (re)load of a zone. The work is divided\n\
  19. into three stages load(), install() and cleanup(). They should be\n\
  20. called in this order for the effect to take place.\n\
  21. \n\
  22. We divide them so the update of zone data can be done asynchronously,\n\
  23. in a different thread. The install() operation is the only one that\n\
  24. needs to be done in a critical section.\n\
  25. \n\
  26. This class provides strong exception guarantee for each public method.\n\
  27. That is, when any of the methods throws, the entire state stays the\n\
  28. same as before the call.\n\
  29. \n\
  30. ZoneWriter objects cannot be constructed directly. They have to be\n\
  31. obtained by using get_cached_zone_writer() on a ConfigurableClientList.\n\
  32. \n\
  33. ";
  34. const char* const ZoneWriter_load_doc = "\
  35. load() -> err_msg\n\
  36. \n\
  37. Get the zone data into memory.\n\
  38. \n\
  39. This is the part that does the time-consuming loading into the memory.\n\
  40. This can be run in a separate thread, for example. It has no effect on\n\
  41. the data actually served, it only prepares them for future use.\n\
  42. \n\
  43. This is the first method you should call on the object. Never call it\n\
  44. multiple times.\n\
  45. \n\
  46. If the zone loads successfully, this method returns None. In the case of\n\
  47. a load error, if the ZoneWriter was constructed with the\n\
  48. catch_load_error option (see\n\
  49. ConfigurableClientList.get_cached_zone_writer()), this method will\n\
  50. return an error message string; if it was created without the\n\
  51. catch_load_error option, this method will raise a DataSourceError\n\
  52. exception.\n\
  53. \n\
  54. Exceptions:\n\
  55. isc.InvalidOperation if called second time.\n\
  56. DataSourceError load related error (not thrown if constructed not to).\n\
  57. \n\
  58. ";
  59. const char* const ZoneWriter_install_doc = "\
  60. install() -> void\n\
  61. \n\
  62. Put the changes to effect.\n\
  63. \n\
  64. This replaces the old version of zone with the one previously prepared\n\
  65. by load(). It takes ownership of the old zone data, if any.\n\
  66. \n\
  67. You may call it only after successful load() and at most once. It\n\
  68. includes the case the writer is constructed to allow load errors,\n\
  69. and load() encountered and caught a DataSourceError exception.\n\
  70. In this case this method installs a special empty zone to\n\
  71. the table.\n\
  72. \n\
  73. The operation is expected to be fast and is meant to be used inside a\n\
  74. critical section.\n\
  75. \n\
  76. This may throw in rare cases. If it throws, you still need to call\n\
  77. cleanup().\n\
  78. \n\
  79. Exceptions:\n\
  80. isc.InvalidOperation if called without previous load() or for the\n\
  81. second time or cleanup() was called already.\n\
  82. \n\
  83. ";
  84. const char* const ZoneWriter_cleanup_doc = "\
  85. cleanup() -> void\n\
  86. \n\
  87. Clean up resources.\n\
  88. \n\
  89. This releases all resources held by owned zone data. That means the\n\
  90. one loaded by load() in case install() was not called or was not\n\
  91. successful, or the one replaced in install().\n\
  92. \n\
  93. Exceptions:\n\
  94. none\n\
  95. \n\
  96. ";
  97. } // unnamed namespace