longleaf 0.2.0.pre.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (165) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +84 -0
  3. data/.gitignore +4 -2
  4. data/.rubocop.yml +42 -2
  5. data/.rubocop_todo.yml +390 -311
  6. data/.yardopts +1 -0
  7. data/Gemfile +16 -1
  8. data/README.md +67 -13
  9. data/Rakefile +6 -0
  10. data/bin/setup +16 -1
  11. data/docs/aboutlongleaf.md +28 -0
  12. data/docs/extra.css +32 -0
  13. data/docs/img/change-file.png +0 -0
  14. data/docs/img/ll-example-preserved.png +0 -0
  15. data/docs/index.md +19 -0
  16. data/docs/install.md +66 -0
  17. data/docs/ll-example/config-example-relative.yml +33 -0
  18. data/docs/ll-example/files-dir/LLexample-PDF.pdf +0 -0
  19. data/docs/ll-example/files-dir/LLexample-TOCHANGE.txt +15 -0
  20. data/docs/ll-example/files-dir/LLexample-tokeep.txt +10 -0
  21. data/docs/ll-example/metadata-dir/.gitkeep +0 -0
  22. data/docs/ll-example/replica-files/.gitkeep +0 -0
  23. data/docs/ll-example/replica-metadata/.gitkeep +0 -0
  24. data/docs/quickstart.md +270 -0
  25. data/docs/rdocs/Longleaf.html +135 -0
  26. data/docs/rdocs/Longleaf/AppFields.html +178 -0
  27. data/docs/rdocs/Longleaf/ApplicationConfigDeserializer.html +631 -0
  28. data/docs/rdocs/Longleaf/ApplicationConfigManager.html +610 -0
  29. data/docs/rdocs/Longleaf/ApplicationConfigValidator.html +238 -0
  30. data/docs/rdocs/Longleaf/CLI.html +909 -0
  31. data/docs/rdocs/Longleaf/ChecksumMismatchError.html +151 -0
  32. data/docs/rdocs/Longleaf/ConfigBuilder.html +1339 -0
  33. data/docs/rdocs/Longleaf/ConfigurationError.html +143 -0
  34. data/docs/rdocs/Longleaf/ConfigurationValidator.html +227 -0
  35. data/docs/rdocs/Longleaf/DeregisterCommand.html +420 -0
  36. data/docs/rdocs/Longleaf/DeregisterEvent.html +453 -0
  37. data/docs/rdocs/Longleaf/DeregistrationError.html +151 -0
  38. data/docs/rdocs/Longleaf/DigestHelper.html +419 -0
  39. data/docs/rdocs/Longleaf/EventError.html +147 -0
  40. data/docs/rdocs/Longleaf/EventNames.html +163 -0
  41. data/docs/rdocs/Longleaf/EventStatusTracking.html +656 -0
  42. data/docs/rdocs/Longleaf/FileCheckService.html +540 -0
  43. data/docs/rdocs/Longleaf/FileHelpers.html +520 -0
  44. data/docs/rdocs/Longleaf/FileRecord.html +716 -0
  45. data/docs/rdocs/Longleaf/FileSelector.html +901 -0
  46. data/docs/rdocs/Longleaf/FixityCheckService.html +691 -0
  47. data/docs/rdocs/Longleaf/IndexManager.html +1155 -0
  48. data/docs/rdocs/Longleaf/InvalidDigestAlgorithmError.html +143 -0
  49. data/docs/rdocs/Longleaf/InvalidStoragePathError.html +143 -0
  50. data/docs/rdocs/Longleaf/Logging.html +405 -0
  51. data/docs/rdocs/Longleaf/Logging/RedirectingLogger.html +1213 -0
  52. data/docs/rdocs/Longleaf/LongleafError.html +139 -0
  53. data/docs/rdocs/Longleaf/MDFields.html +193 -0
  54. data/docs/rdocs/Longleaf/MetadataBuilder.html +787 -0
  55. data/docs/rdocs/Longleaf/MetadataDeserializer.html +537 -0
  56. data/docs/rdocs/Longleaf/MetadataError.html +143 -0
  57. data/docs/rdocs/Longleaf/MetadataPersistenceManager.html +539 -0
  58. data/docs/rdocs/Longleaf/MetadataRecord.html +1411 -0
  59. data/docs/rdocs/Longleaf/MetadataSerializer.html +786 -0
  60. data/docs/rdocs/Longleaf/PreservationServiceError.html +147 -0
  61. data/docs/rdocs/Longleaf/PreserveCommand.html +410 -0
  62. data/docs/rdocs/Longleaf/PreserveEvent.html +491 -0
  63. data/docs/rdocs/Longleaf/RegisterCommand.html +428 -0
  64. data/docs/rdocs/Longleaf/RegisterEvent.html +628 -0
  65. data/docs/rdocs/Longleaf/RegisteredFileSelector.html +446 -0
  66. data/docs/rdocs/Longleaf/RegistrationError.html +151 -0
  67. data/docs/rdocs/Longleaf/ReindexCommand.html +576 -0
  68. data/docs/rdocs/Longleaf/RsyncReplicationService.html +1180 -0
  69. data/docs/rdocs/Longleaf/SequelIndexDriver.html +1978 -0
  70. data/docs/rdocs/Longleaf/ServiceCandidateFilesystemIterator.html +572 -0
  71. data/docs/rdocs/Longleaf/ServiceCandidateIndexIterator.html +532 -0
  72. data/docs/rdocs/Longleaf/ServiceCandidateLocator.html +333 -0
  73. data/docs/rdocs/Longleaf/ServiceClassCache.html +725 -0
  74. data/docs/rdocs/Longleaf/ServiceDateHelper.html +425 -0
  75. data/docs/rdocs/Longleaf/ServiceDefinition.html +683 -0
  76. data/docs/rdocs/Longleaf/ServiceDefinitionManager.html +371 -0
  77. data/docs/rdocs/Longleaf/ServiceDefinitionValidator.html +269 -0
  78. data/docs/rdocs/Longleaf/ServiceFields.html +173 -0
  79. data/docs/rdocs/Longleaf/ServiceManager.html +1229 -0
  80. data/docs/rdocs/Longleaf/ServiceMappingManager.html +410 -0
  81. data/docs/rdocs/Longleaf/ServiceMappingValidator.html +347 -0
  82. data/docs/rdocs/Longleaf/ServiceRecord.html +821 -0
  83. data/docs/rdocs/Longleaf/StorageLocation.html +985 -0
  84. data/docs/rdocs/Longleaf/StorageLocationManager.html +729 -0
  85. data/docs/rdocs/Longleaf/StorageLocationUnavailableError.html +143 -0
  86. data/docs/rdocs/Longleaf/StorageLocationValidator.html +373 -0
  87. data/docs/rdocs/Longleaf/StoragePathValidator.html +253 -0
  88. data/docs/rdocs/Longleaf/SystemConfigBuilder.html +441 -0
  89. data/docs/rdocs/Longleaf/SystemConfigFields.html +163 -0
  90. data/docs/rdocs/Longleaf/ValidateConfigCommand.html +451 -0
  91. data/docs/rdocs/Longleaf/ValidateMetadataCommand.html +408 -0
  92. data/docs/rdocs/_index.html +660 -0
  93. data/docs/rdocs/class_list.html +51 -0
  94. data/docs/rdocs/css/common.css +1 -0
  95. data/docs/rdocs/css/full_list.css +58 -0
  96. data/docs/rdocs/css/style.css +496 -0
  97. data/docs/rdocs/file.README.html +165 -0
  98. data/docs/rdocs/file_list.html +56 -0
  99. data/docs/rdocs/frames.html +17 -0
  100. data/docs/rdocs/index.html +165 -0
  101. data/docs/rdocs/js/app.js +303 -0
  102. data/docs/rdocs/js/full_list.js +216 -0
  103. data/docs/rdocs/js/jquery.js +4 -0
  104. data/docs/rdocs/method_list.html +2051 -0
  105. data/docs/rdocs/top-level-namespace.html +110 -0
  106. data/lib/longleaf/candidates/file_selector.rb +47 -15
  107. data/lib/longleaf/candidates/registered_file_selector.rb +67 -0
  108. data/lib/longleaf/candidates/service_candidate_filesystem_iterator.rb +29 -35
  109. data/lib/longleaf/candidates/service_candidate_index_iterator.rb +84 -0
  110. data/lib/longleaf/candidates/service_candidate_locator.rb +9 -4
  111. data/lib/longleaf/cli.rb +162 -80
  112. data/lib/longleaf/commands/deregister_command.rb +12 -11
  113. data/lib/longleaf/commands/preserve_command.rb +13 -8
  114. data/lib/longleaf/commands/register_command.rb +9 -6
  115. data/lib/longleaf/commands/reindex_command.rb +92 -0
  116. data/lib/longleaf/commands/validate_config_command.rb +27 -6
  117. data/lib/longleaf/commands/validate_metadata_command.rb +11 -9
  118. data/lib/longleaf/errors.rb +12 -12
  119. data/lib/longleaf/events/deregister_event.rb +13 -15
  120. data/lib/longleaf/events/event_status_tracking.rb +7 -7
  121. data/lib/longleaf/events/preserve_event.rb +24 -14
  122. data/lib/longleaf/events/register_event.rb +21 -35
  123. data/lib/longleaf/helpers/digest_helper.rb +4 -4
  124. data/lib/longleaf/helpers/service_date_helper.rb +5 -6
  125. data/lib/longleaf/indexing/index_manager.rb +101 -0
  126. data/lib/longleaf/indexing/sequel_index_driver.rb +324 -0
  127. data/lib/longleaf/logging.rb +4 -4
  128. data/lib/longleaf/logging/redirecting_logger.rb +20 -20
  129. data/lib/longleaf/models/app_fields.rb +2 -1
  130. data/lib/longleaf/models/file_record.rb +10 -6
  131. data/lib/longleaf/models/md_fields.rb +1 -1
  132. data/lib/longleaf/models/metadata_record.rb +22 -12
  133. data/lib/longleaf/models/service_definition.rb +3 -3
  134. data/lib/longleaf/models/service_fields.rb +1 -1
  135. data/lib/longleaf/models/service_record.rb +6 -5
  136. data/lib/longleaf/models/storage_location.rb +26 -7
  137. data/lib/longleaf/models/system_config_fields.rb +9 -0
  138. data/lib/longleaf/preservation_services/file_check_service.rb +58 -0
  139. data/lib/longleaf/preservation_services/fixity_check_service.rb +16 -14
  140. data/lib/longleaf/preservation_services/rsync_replication_service.rb +32 -31
  141. data/lib/longleaf/services/application_config_deserializer.rb +55 -18
  142. data/lib/longleaf/services/application_config_manager.rb +16 -4
  143. data/lib/longleaf/services/application_config_validator.rb +1 -2
  144. data/lib/longleaf/services/configuration_validator.rb +6 -4
  145. data/lib/longleaf/services/metadata_deserializer.rb +40 -38
  146. data/lib/longleaf/services/metadata_persistence_manager.rb +46 -0
  147. data/lib/longleaf/services/metadata_serializer.rb +23 -22
  148. data/lib/longleaf/services/service_class_cache.rb +15 -15
  149. data/lib/longleaf/services/service_definition_manager.rb +5 -6
  150. data/lib/longleaf/services/service_definition_validator.rb +5 -6
  151. data/lib/longleaf/services/service_manager.rb +37 -17
  152. data/lib/longleaf/services/service_mapping_manager.rb +9 -9
  153. data/lib/longleaf/services/service_mapping_validator.rb +9 -10
  154. data/lib/longleaf/services/storage_location_manager.rb +22 -8
  155. data/lib/longleaf/services/storage_location_validator.rb +11 -8
  156. data/lib/longleaf/services/storage_path_validator.rb +1 -1
  157. data/lib/longleaf/specs/config_builder.rb +30 -17
  158. data/lib/longleaf/specs/custom_matchers.rb +1 -1
  159. data/lib/longleaf/specs/file_helpers.rb +15 -14
  160. data/lib/longleaf/specs/metadata_builder.rb +91 -0
  161. data/lib/longleaf/specs/system_config_builder.rb +27 -0
  162. data/lib/longleaf/version.rb +1 -1
  163. data/longleaf.gemspec +17 -7
  164. data/mkdocs.yml +20 -0
  165. metadata +233 -22
@@ -0,0 +1,143 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Exception: Longleaf::ConfigurationError
8
+
9
+ &mdash; Documentation by YARD 0.9.19
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ pathId = "Longleaf::ConfigurationError";
19
+ relpath = '../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../_index.html">Index (C)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../Longleaf.html" title="Longleaf (module)">Longleaf</a></span></span>
41
+ &raquo;
42
+ <span class="title">ConfigurationError</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Exception: Longleaf::ConfigurationError
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName"><span class='object_link'><a href="LongleafError.html" title="Longleaf::LongleafError (class)">LongleafError</a></span></span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">StandardError</li>
78
+
79
+ <li class="next"><span class='object_link'><a href="LongleafError.html" title="Longleaf::LongleafError (class)">LongleafError</a></span></li>
80
+
81
+ <li class="next">Longleaf::ConfigurationError</li>
82
+
83
+ </ul>
84
+ <a href="#" class="inheritanceTree">show all</a>
85
+
86
+ </dd>
87
+ </dl>
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+ <dl>
100
+ <dt>Defined in:</dt>
101
+ <dd>lib/longleaf/errors.rb</dd>
102
+ </dl>
103
+
104
+ </div>
105
+
106
+ <h2>Overview</h2><div class="docstring">
107
+ <div class="discussion">
108
+
109
+ <p>Invalid application configuration error</p>
110
+
111
+
112
+ </div>
113
+ </div>
114
+ <div class="tags">
115
+
116
+
117
+ </div>
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+ </div>
134
+
135
+ <div id="footer">
136
+ Generated on Tue May 28 15:48:00 2019 by
137
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
138
+ 0.9.19 (ruby-2.6.3).
139
+ </div>
140
+
141
+ </div>
142
+ </body>
143
+ </html>
@@ -0,0 +1,227 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Class: Longleaf::ConfigurationValidator
8
+
9
+ &mdash; Documentation by YARD 0.9.19
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ pathId = "Longleaf::ConfigurationValidator";
19
+ relpath = '../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../_index.html">Index (C)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../Longleaf.html" title="Longleaf (module)">Longleaf</a></span></span>
41
+ &raquo;
42
+ <span class="title">ConfigurationValidator</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Class: Longleaf::ConfigurationValidator
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">Object</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">Longleaf::ConfigurationValidator</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+ <dl>
96
+ <dt>Defined in:</dt>
97
+ <dd>lib/longleaf/services/configuration_validator.rb</dd>
98
+ </dl>
99
+
100
+ </div>
101
+
102
+ <h2>Overview</h2><div class="docstring">
103
+ <div class="discussion">
104
+
105
+ <p>Abstract configuration validator class</p>
106
+
107
+
108
+ </div>
109
+ </div>
110
+ <div class="tags">
111
+
112
+
113
+ </div><div id="subclasses">
114
+ <h2>Direct Known Subclasses</h2>
115
+ <p class="children"><span class='object_link'><a href="ServiceDefinitionValidator.html" title="Longleaf::ServiceDefinitionValidator (class)">ServiceDefinitionValidator</a></span>, <span class='object_link'><a href="ServiceMappingValidator.html" title="Longleaf::ServiceMappingValidator (class)">ServiceMappingValidator</a></span>, <span class='object_link'><a href="StorageLocationValidator.html" title="Longleaf::StorageLocationValidator (class)">StorageLocationValidator</a></span></p>
116
+ </div>
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+ <h2>
126
+ Class Method Summary
127
+ <small><a href="#" class="summary_toggle">collapse</a></small>
128
+ </h2>
129
+
130
+ <ul class="summary">
131
+
132
+ <li class="protected ">
133
+ <span class="summary_signature">
134
+
135
+ <a href="#assert-class_method" title="assert (class method)">.<strong>assert</strong>(fail_message, assertion_passed) &#x21d2; Object </a>
136
+
137
+
138
+
139
+ </span>
140
+
141
+
142
+
143
+ <span class="note title protected">protected</span>
144
+
145
+
146
+
147
+
148
+
149
+ <span class="summary_desc"><div class='inline'></div></span>
150
+
151
+ </li>
152
+
153
+
154
+ </ul>
155
+
156
+
157
+
158
+
159
+ <div id="class_method_details" class="method_details_list">
160
+ <h2>Class Method Details</h2>
161
+
162
+
163
+ <div class="method_details first">
164
+ <h3 class="signature first" id="assert-class_method">
165
+
166
+ .<strong>assert</strong>(fail_message, assertion_passed) &#x21d2; <tt>Object</tt> <span class="extras">(protected)</span>
167
+
168
+
169
+
170
+
171
+
172
+ </h3><div class="docstring">
173
+ <div class="discussion">
174
+
175
+
176
+ </div>
177
+ </div>
178
+ <div class="tags">
179
+
180
+ <p class="tag_title">Raises:</p>
181
+ <ul class="raise">
182
+
183
+ <li>
184
+
185
+
186
+ <span class='type'>(<tt><span class='object_link'><a href="ConfigurationError.html" title="Longleaf::ConfigurationError (class)">ConfigurationError</a></span></tt>)</span>
187
+
188
+
189
+
190
+ </li>
191
+
192
+ </ul>
193
+
194
+ </div><table class="source_code">
195
+ <tr>
196
+ <td>
197
+ <pre class="lines">
198
+
199
+
200
+ 6
201
+ 7
202
+ 8</pre>
203
+ </td>
204
+ <td>
205
+ <pre class="code"><span class="info file"># File 'lib/longleaf/services/configuration_validator.rb', line 6</span>
206
+
207
+ <span class='kw'>def</span> <span class='id identifier rubyid_assert'>assert</span><span class='lparen'>(</span><span class='id identifier rubyid_fail_message'>fail_message</span><span class='comma'>,</span> <span class='id identifier rubyid_assertion_passed'>assertion_passed</span><span class='rparen'>)</span>
208
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="ConfigurationError.html" title="Longleaf::ConfigurationError (class)">ConfigurationError</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_fail_message'>fail_message</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_assertion_passed'>assertion_passed</span>
209
+ <span class='kw'>end</span></pre>
210
+ </td>
211
+ </tr>
212
+ </table>
213
+ </div>
214
+
215
+ </div>
216
+
217
+ </div>
218
+
219
+ <div id="footer">
220
+ Generated on Tue May 28 15:48:02 2019 by
221
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
222
+ 0.9.19 (ruby-2.6.3).
223
+ </div>
224
+
225
+ </div>
226
+ </body>
227
+ </html>
@@ -0,0 +1,420 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Class: Longleaf::DeregisterCommand
8
+
9
+ &mdash; Documentation by YARD 0.9.19
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ pathId = "Longleaf::DeregisterCommand";
19
+ relpath = '../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../_index.html">Index (D)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../Longleaf.html" title="Longleaf (module)">Longleaf</a></span></span>
41
+ &raquo;
42
+ <span class="title">DeregisterCommand</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Class: Longleaf::DeregisterCommand
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">Object</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">Longleaf::DeregisterCommand</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+
89
+
90
+ <dl>
91
+ <dt>Includes:</dt>
92
+ <dd><span class='object_link'><a href="EventStatusTracking.html" title="Longleaf::EventStatusTracking (module)">EventStatusTracking</a></span></dd>
93
+ </dl>
94
+
95
+
96
+
97
+
98
+
99
+
100
+ <dl>
101
+ <dt>Defined in:</dt>
102
+ <dd>lib/longleaf/commands/deregister_command.rb</dd>
103
+ </dl>
104
+
105
+ </div>
106
+
107
+ <h2>Overview</h2><div class="docstring">
108
+ <div class="discussion">
109
+
110
+ <p>Command for deregistering files with longleaf</p>
111
+
112
+
113
+ </div>
114
+ </div>
115
+ <div class="tags">
116
+
117
+
118
+ </div>
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+ <h2>
127
+ Instance Method Summary
128
+ <small><a href="#" class="summary_toggle">collapse</a></small>
129
+ </h2>
130
+
131
+ <ul class="summary">
132
+
133
+ <li class="public ">
134
+ <span class="summary_signature">
135
+
136
+ <a href="#execute-instance_method" title="#execute (instance method)">#<strong>execute</strong>(file_selector:, force: false) &#x21d2; Integer </a>
137
+
138
+
139
+
140
+ </span>
141
+
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+ <span class="summary_desc"><div class='inline'>
151
+ <p>Execute the deregister command on the given parameters.</p>
152
+ </div></span>
153
+
154
+ </li>
155
+
156
+
157
+ <li class="public ">
158
+ <span class="summary_signature">
159
+
160
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(app_manager) &#x21d2; DeregisterCommand </a>
161
+
162
+
163
+
164
+ </span>
165
+
166
+
167
+ <span class="note title constructor">constructor</span>
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+
176
+ <span class="summary_desc"><div class='inline'>
177
+ <p>A new instance of DeregisterCommand.</p>
178
+ </div></span>
179
+
180
+ </li>
181
+
182
+
183
+ </ul>
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+ <h3 class="inherited">Methods included from <span class='object_link'><a href="EventStatusTracking.html" title="Longleaf::EventStatusTracking (module)">EventStatusTracking</a></span></h3>
196
+ <p class="inherited"><span class='object_link'><a href="EventStatusTracking.html#record_failure-instance_method" title="Longleaf::EventStatusTracking#record_failure (method)">#record_failure</a></span>, <span class='object_link'><a href="EventStatusTracking.html#record_success-instance_method" title="Longleaf::EventStatusTracking#record_success (method)">#record_success</a></span>, <span class='object_link'><a href="EventStatusTracking.html#return_status-instance_method" title="Longleaf::EventStatusTracking#return_status (method)">#return_status</a></span>, <span class='object_link'><a href="EventStatusTracking.html#track_failure-instance_method" title="Longleaf::EventStatusTracking#track_failure (method)">#track_failure</a></span>, <span class='object_link'><a href="EventStatusTracking.html#track_status-instance_method" title="Longleaf::EventStatusTracking#track_status (method)">#track_status</a></span>, <span class='object_link'><a href="EventStatusTracking.html#track_success-instance_method" title="Longleaf::EventStatusTracking#track_success (method)">#track_success</a></span></p>
197
+
198
+
199
+
200
+
201
+
202
+
203
+
204
+
205
+
206
+ <h3 class="inherited">Methods included from <span class='object_link'><a href="Logging.html" title="Longleaf::Logging (module)">Logging</a></span></h3>
207
+ <p class="inherited"><span class='object_link'><a href="Logging.html#initialize_logger-instance_method" title="Longleaf::Logging#initialize_logger (method)">#initialize_logger</a></span>, <span class='object_link'><a href="Logging.html#initialize_logger-class_method" title="Longleaf::Logging.initialize_logger (method)">initialize_logger</a></span>, <span class='object_link'><a href="Logging.html#logger-instance_method" title="Longleaf::Logging#logger (method)">#logger</a></span>, <span class='object_link'><a href="Logging.html#logger-class_method" title="Longleaf::Logging.logger (method)">logger</a></span></p>
208
+ <div id="constructor_details" class="method_details_list">
209
+ <h2>Constructor Details</h2>
210
+
211
+ <div class="method_details first">
212
+ <h3 class="signature first" id="initialize-instance_method">
213
+
214
+ #<strong>initialize</strong>(app_manager) &#x21d2; <tt><span class='object_link'><a href="" title="Longleaf::DeregisterCommand (class)">DeregisterCommand</a></span></tt>
215
+
216
+
217
+
218
+
219
+
220
+ </h3><div class="docstring">
221
+ <div class="discussion">
222
+
223
+ <p>Returns a new instance of DeregisterCommand</p>
224
+
225
+
226
+ </div>
227
+ </div>
228
+ <div class="tags">
229
+
230
+
231
+ </div><table class="source_code">
232
+ <tr>
233
+ <td>
234
+ <pre class="lines">
235
+
236
+
237
+ 12
238
+ 13
239
+ 14</pre>
240
+ </td>
241
+ <td>
242
+ <pre class="code"><span class="info file"># File 'lib/longleaf/commands/deregister_command.rb', line 12</span>
243
+
244
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_app_manager'>app_manager</span><span class='rparen'>)</span>
245
+ <span class='ivar'>@app_manager</span> <span class='op'>=</span> <span class='id identifier rubyid_app_manager'>app_manager</span>
246
+ <span class='kw'>end</span></pre>
247
+ </td>
248
+ </tr>
249
+ </table>
250
+ </div>
251
+
252
+ </div>
253
+
254
+
255
+ <div id="instance_method_details" class="method_details_list">
256
+ <h2>Instance Method Details</h2>
257
+
258
+
259
+ <div class="method_details first">
260
+ <h3 class="signature first" id="execute-instance_method">
261
+
262
+ #<strong>execute</strong>(file_selector:, force: false) &#x21d2; <tt>Integer</tt>
263
+
264
+
265
+
266
+
267
+
268
+ </h3><div class="docstring">
269
+ <div class="discussion">
270
+
271
+ <p>Execute the deregister command on the given parameters</p>
272
+
273
+
274
+ </div>
275
+ </div>
276
+ <div class="tags">
277
+ <p class="tag_title">Parameters:</p>
278
+ <ul class="param">
279
+
280
+ <li>
281
+
282
+ <span class='name'>file_selector</span>
283
+
284
+
285
+ <span class='type'>(<tt><span class='object_link'><a href="FileSelector.html" title="Longleaf::FileSelector (class)">FileSelector</a></span></tt>)</span>
286
+
287
+
288
+
289
+ &mdash;
290
+ <div class='inline'>
291
+ <p>selector for files to deregister</p>
292
+ </div>
293
+
294
+ </li>
295
+
296
+ <li>
297
+
298
+ <span class='name'>force</span>
299
+
300
+
301
+ <span class='type'>(<tt>Boolean</tt>)</span>
302
+
303
+
304
+
305
+ &mdash;
306
+ <div class='inline'>
307
+ <p>force flag</p>
308
+ </div>
309
+
310
+ </li>
311
+
312
+ </ul>
313
+
314
+ <p class="tag_title">Returns:</p>
315
+ <ul class="return">
316
+
317
+ <li>
318
+
319
+
320
+ <span class='type'>(<tt>Integer</tt>)</span>
321
+
322
+
323
+
324
+ &mdash;
325
+ <div class='inline'>
326
+ <p>status code</p>
327
+ </div>
328
+
329
+ </li>
330
+
331
+ </ul>
332
+
333
+ </div><table class="source_code">
334
+ <tr>
335
+ <td>
336
+ <pre class="lines">
337
+
338
+
339
+ 20
340
+ 21
341
+ 22
342
+ 23
343
+ 24
344
+ 25
345
+ 26
346
+ 27
347
+ 28
348
+ 29
349
+ 30
350
+ 31
351
+ 32
352
+ 33
353
+ 34
354
+ 35
355
+ 36
356
+ 37
357
+ 38
358
+ 39
359
+ 40
360
+ 41
361
+ 42
362
+ 43
363
+ 44
364
+ 45
365
+ 46
366
+ 47
367
+ 48
368
+ 49</pre>
369
+ </td>
370
+ <td>
371
+ <pre class="code"><span class="info file"># File 'lib/longleaf/commands/deregister_command.rb', line 20</span>
372
+
373
+ <span class='kw'>def</span> <span class='id identifier rubyid_execute'>execute</span><span class='lparen'>(</span><span class='label'>file_selector:</span><span class='comma'>,</span> <span class='label'>force:</span> <span class='kw'>false</span><span class='rparen'>)</span>
374
+ <span class='id identifier rubyid_start_time'>start_time</span> <span class='op'>=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span>
375
+ <span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_info'>info</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Performing deregister command</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
376
+ <span class='kw'>begin</span>
377
+ <span class='comment'># Perform deregister events on each of the file paths provided
378
+ </span> <span class='id identifier rubyid_loop'>loop</span> <span class='kw'>do</span>
379
+ <span class='id identifier rubyid_f_path'>f_path</span> <span class='op'>=</span> <span class='id identifier rubyid_file_selector'>file_selector</span><span class='period'>.</span><span class='id identifier rubyid_next_path'>next_path</span>
380
+ <span class='kw'>break</span> <span class='kw'>if</span> <span class='id identifier rubyid_f_path'>f_path</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
381
+
382
+ <span class='id identifier rubyid_storage_location'>storage_location</span> <span class='op'>=</span> <span class='ivar'>@app_manager</span><span class='period'>.</span><span class='id identifier rubyid_location_manager'>location_manager</span><span class='period'>.</span><span class='id identifier rubyid_get_location_by_path'>get_location_by_path</span><span class='lparen'>(</span><span class='id identifier rubyid_f_path'>f_path</span><span class='rparen'>)</span>
383
+
384
+ <span class='id identifier rubyid_file_rec'>file_rec</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FileRecord.html" title="Longleaf::FileRecord (class)">FileRecord</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="FileRecord.html#initialize-instance_method" title="Longleaf::FileRecord#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_f_path'>f_path</span><span class='comma'>,</span> <span class='id identifier rubyid_storage_location'>storage_location</span><span class='rparen'>)</span>
385
+ <span class='kw'>unless</span> <span class='id identifier rubyid_file_rec'>file_rec</span><span class='period'>.</span><span class='id identifier rubyid_metadata_present?'>metadata_present?</span>
386
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="DeregistrationError.html" title="Longleaf::DeregistrationError (class)">DeregistrationError</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Cannot deregister </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_f_path'>f_path</span><span class='embexpr_end'>}</span><span class='tstring_content'>, file is not registered.</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
387
+ <span class='kw'>end</span>
388
+
389
+ <span class='ivar'>@app_manager</span><span class='period'>.</span><span class='id identifier rubyid_md_manager'>md_manager</span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span><span class='lparen'>(</span><span class='id identifier rubyid_file_rec'>file_rec</span><span class='rparen'>)</span>
390
+
391
+ <span class='id identifier rubyid_event'>event</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="DeregisterEvent.html" title="Longleaf::DeregisterEvent (class)">DeregisterEvent</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="DeregisterEvent.html#initialize-instance_method" title="Longleaf::DeregisterEvent#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>file_rec:</span> <span class='id identifier rubyid_file_rec'>file_rec</span><span class='comma'>,</span> <span class='label'>force:</span> <span class='id identifier rubyid_force'>force</span><span class='comma'>,</span> <span class='label'>app_manager:</span> <span class='ivar'>@app_manager</span><span class='rparen'>)</span>
392
+ <span class='id identifier rubyid_track_status'>track_status</span><span class='lparen'>(</span><span class='id identifier rubyid_event'>event</span><span class='period'>.</span><span class='id identifier rubyid_perform'>perform</span><span class='rparen'>)</span>
393
+ <span class='kw'>end</span>
394
+ <span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="RegistrationError.html" title="Longleaf::RegistrationError (class)">RegistrationError</a></span></span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="DeregistrationError.html" title="Longleaf::DeregistrationError (class)">DeregistrationError</a></span></span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="InvalidStoragePathError.html" title="Longleaf::InvalidStoragePathError (class)">InvalidStoragePathError</a></span></span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="StorageLocationUnavailableError.html" title="Longleaf::StorageLocationUnavailableError (class)">StorageLocationUnavailableError</a></span></span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_err'>err</span>
395
+ <span class='id identifier rubyid_record_failure'>record_failure</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="EventNames.html" title="Longleaf::EventNames (class)">EventNames</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="EventNames.html#DEREGISTER-constant" title="Longleaf::EventNames::DEREGISTER (constant)">DEREGISTER</a></span></span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_err'>err</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span>
396
+ <span class='kw'>rescue</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_err'>err</span>
397
+ <span class='id identifier rubyid_record_failure'>record_failure</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="EventNames.html" title="Longleaf::EventNames (class)">EventNames</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="EventNames.html#DEREGISTER-constant" title="Longleaf::EventNames::DEREGISTER (constant)">DEREGISTER</a></span></span><span class='comma'>,</span> <span class='label'>error:</span> <span class='id identifier rubyid_err'>err</span><span class='rparen'>)</span>
398
+ <span class='kw'>end</span>
399
+
400
+ <span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_info'>info</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Completed deregister command in </span><span class='embexpr_beg'>#{</span><span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span> <span class='op'>-</span> <span class='id identifier rubyid_start_time'>start_time</span><span class='embexpr_end'>}</span><span class='tstring_content'>s</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
401
+ <span class='id identifier rubyid_return_status'>return_status</span>
402
+ <span class='kw'>end</span></pre>
403
+ </td>
404
+ </tr>
405
+ </table>
406
+ </div>
407
+
408
+ </div>
409
+
410
+ </div>
411
+
412
+ <div id="footer">
413
+ Generated on Tue May 28 15:48:01 2019 by
414
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
415
+ 0.9.19 (ruby-2.6.3).
416
+ </div>
417
+
418
+ </div>
419
+ </body>
420
+ </html>