Skip to content

Commit 61d2dc3

Browse files
authored
Fix readonly snapshot invocation (#4725)
1 parent f23ae7d commit 61d2dc3

File tree

2 files changed

+23
-80
lines changed

2 files changed

+23
-80
lines changed

app/src/main/java/io/apicurio/registry/storage/decorator/RegistryStorageDecoratorReadOnlyBase.java

+10-74
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,7 @@
66
import io.apicurio.registry.model.GA;
77
import io.apicurio.registry.model.GAV;
88
import io.apicurio.registry.storage.RegistryStorage;
9-
import io.apicurio.registry.storage.dto.ArtifactMetaDataDto;
10-
import io.apicurio.registry.storage.dto.ArtifactReferenceDto;
11-
import io.apicurio.registry.storage.dto.ArtifactSearchResultsDto;
12-
import io.apicurio.registry.storage.dto.ArtifactVersionMetaDataDto;
13-
import io.apicurio.registry.storage.dto.CommentDto;
14-
import io.apicurio.registry.storage.dto.ContentWrapperDto;
15-
import io.apicurio.registry.storage.dto.GroupMetaDataDto;
16-
import io.apicurio.registry.storage.dto.GroupSearchResultsDto;
17-
import io.apicurio.registry.storage.dto.OrderBy;
18-
import io.apicurio.registry.storage.dto.OrderDirection;
19-
import io.apicurio.registry.storage.dto.RoleMappingDto;
20-
import io.apicurio.registry.storage.dto.RoleMappingSearchResultsDto;
21-
import io.apicurio.registry.storage.dto.RuleConfigurationDto;
22-
import io.apicurio.registry.storage.dto.SearchFilter;
23-
import io.apicurio.registry.storage.dto.StoredArtifactVersionDto;
24-
import io.apicurio.registry.storage.dto.VersionSearchResultsDto;
9+
import io.apicurio.registry.storage.dto.*;
2510
import io.apicurio.registry.storage.error.ArtifactNotFoundException;
2611
import io.apicurio.registry.storage.error.ContentNotFoundException;
2712
import io.apicurio.registry.storage.error.GroupNotFoundException;
@@ -47,11 +32,9 @@ public abstract class RegistryStorageDecoratorReadOnlyBase implements RegistrySt
4732

4833
protected RegistryStorage delegate;
4934

50-
5135
protected RegistryStorageDecoratorReadOnlyBase() {
5236
}
5337

54-
5538
public void setDelegate(RegistryStorage delegate) {
5639
this.delegate = delegate;
5740
}
@@ -71,239 +54,205 @@ public boolean isReady() {
7154
return delegate.isReady();
7255
}
7356

74-
7557
@Override
7658
public boolean isAlive() {
7759
return delegate.isAlive();
7860
}
7961

80-
8162
@Override
8263
public boolean isReadOnly() {
8364
return delegate.isReadOnly();
8465
}
8566

86-
8767
@Override
8868
public ContentWrapperDto getContentById(long contentId)
8969
throws ContentNotFoundException, RegistryStorageException {
9070
return delegate.getContentById(contentId);
9171
}
9272

93-
9473
@Override
9574
public ContentWrapperDto getContentByHash(String contentHash)
9675
throws ContentNotFoundException, RegistryStorageException {
9776
return delegate.getContentByHash(contentHash);
9877
}
9978

100-
10179
@Override
10280
public List<ArtifactVersionMetaDataDto> getArtifactVersionsByContentId(long contentId) {
10381
return delegate.getArtifactVersionsByContentId(contentId);
10482
}
10583

106-
10784
@Override
10885
public Set<String> getArtifactIds(Integer limit) {
10986
return delegate.getArtifactIds(limit);
11087
}
11188

112-
11389
@Override
11490
public ArtifactSearchResultsDto searchArtifacts(Set<SearchFilter> filters, OrderBy orderBy,
11591
OrderDirection orderDirection, int offset, int limit) {
11692
return delegate.searchArtifacts(filters, orderBy, orderDirection, offset, limit);
11793
}
11894

119-
12095
@Override
12196
public ArtifactMetaDataDto getArtifactMetaData(String groupId, String artifactId)
12297
throws ArtifactNotFoundException, RegistryStorageException {
12398
return delegate.getArtifactMetaData(groupId, artifactId);
12499
}
125100

126-
127101
@Override
128102
public ArtifactVersionMetaDataDto getArtifactVersionMetaDataByContent(String groupId, String artifactId,
129-
boolean canonical, ContentHandle content, List<ArtifactReferenceDto> artifactReferences)
103+
boolean canonical, ContentHandle content, List<ArtifactReferenceDto> artifactReferences)
130104
throws ArtifactNotFoundException, RegistryStorageException {
131105
return delegate.getArtifactVersionMetaDataByContent(groupId, artifactId, canonical, content, artifactReferences);
132106
}
133107

134-
135108
@Override
136109
public List<RuleType> getArtifactRules(String groupId, String artifactId)
137110
throws ArtifactNotFoundException, RegistryStorageException {
138111
return delegate.getArtifactRules(groupId, artifactId);
139112
}
140113

141-
142114
@Override
143115
public void createArtifactRule(String groupId, String artifactId, RuleType rule,
144116
RuleConfigurationDto config)
145117
throws ArtifactNotFoundException, RuleAlreadyExistsException, RegistryStorageException {
146118
delegate.createArtifactRule(groupId, artifactId, rule, config);
147119
}
148120

149-
150121
@Override
151122
public RuleConfigurationDto getArtifactRule(String groupId, String artifactId, RuleType rule)
152123
throws ArtifactNotFoundException, RuleNotFoundException, RegistryStorageException {
153124
return delegate.getArtifactRule(groupId, artifactId, rule);
154125
}
155126

156-
157127
@Override
158128
public List<String> getArtifactVersions(String groupId, String artifactId)
159129
throws ArtifactNotFoundException, RegistryStorageException {
160130
return delegate.getArtifactVersions(groupId, artifactId);
161131
}
162132

163133
@Override
164-
public VersionSearchResultsDto searchVersions(String groupId, String artifactId, OrderBy orderBy, OrderDirection orderDirection, int offset, int limit) throws RegistryStorageException {
134+
public VersionSearchResultsDto searchVersions(String groupId, String artifactId, OrderBy orderBy, OrderDirection orderDirection, int offset, int limit)
135+
throws RegistryStorageException {
165136
return delegate.searchVersions(groupId, artifactId, orderBy, orderDirection, offset, limit);
166137
}
167138

168-
169139
@Override
170140
public StoredArtifactVersionDto getArtifactVersionContent(long globalId)
171141
throws ArtifactNotFoundException, RegistryStorageException {
172142
return delegate.getArtifactVersionContent(globalId);
173143
}
174144

175-
176145
@Override
177146
public StoredArtifactVersionDto getArtifactVersionContent(String groupId, String artifactId, String version)
178147
throws ArtifactNotFoundException, VersionNotFoundException, RegistryStorageException {
179148
return delegate.getArtifactVersionContent(groupId, artifactId, version);
180149
}
181150

182-
183151
@Override
184152
public ArtifactVersionMetaDataDto getArtifactVersionMetaData(String groupId, String artifactId,
185153
String version)
186154
throws ArtifactNotFoundException, VersionNotFoundException, RegistryStorageException {
187155
return delegate.getArtifactVersionMetaData(groupId, artifactId, version);
188156
}
189-
190-
157+
191158
@Override
192159
public ArtifactVersionMetaDataDto getArtifactVersionMetaData(Long globalId)
193160
throws VersionNotFoundException, RegistryStorageException {
194161
return delegate.getArtifactVersionMetaData(globalId);
195162
}
196163

197-
198164
@Override
199165
public List<RuleType> getGlobalRules() throws RegistryStorageException {
200166
return delegate.getGlobalRules();
201167
}
202168

203-
204169
@Override
205170
public RuleConfigurationDto getGlobalRule(RuleType rule)
206171
throws RuleNotFoundException, RegistryStorageException {
207172
return delegate.getGlobalRule(rule);
208173
}
209174

210-
211175
@Override
212176
public List<String> getGroupIds(Integer limit) throws RegistryStorageException {
213177
return delegate.getGroupIds(limit);
214178
}
215179

216-
217180
@Override
218181
public GroupMetaDataDto getGroupMetaData(String groupId)
219182
throws GroupNotFoundException, RegistryStorageException {
220183
return delegate.getGroupMetaData(groupId);
221184
}
222185

223-
224186
@Override
225187
public void exportData(Function<Entity, Void> handler) throws RegistryStorageException {
226188
delegate.exportData(handler);
227189
}
228190

229-
230191
@Override
231192
public long countArtifacts() throws RegistryStorageException {
232193
return delegate.countArtifacts();
233194
}
234195

235-
236196
@Override
237197
public long countArtifactVersions(String groupId, String artifactId) throws RegistryStorageException {
238198
return delegate.countArtifactVersions(groupId, artifactId);
239199
}
240-
241-
200+
242201
@Override
243202
public long countActiveArtifactVersions(String groupId, String artifactId) throws RegistryStorageException {
244203
return delegate.countActiveArtifactVersions(groupId, artifactId);
245204
}
246205

247-
248206
@Override
249207
public long countTotalArtifactVersions() throws RegistryStorageException {
250208
return delegate.countTotalArtifactVersions();
251209
}
252210

253-
254211
@Override
255212
public RoleMappingDto getRoleMapping(String principalId) throws RegistryStorageException {
256213
return delegate.getRoleMapping(principalId);
257214
}
258215

259-
260216
@Override
261217
public String getRoleForPrincipal(String principalId) throws RegistryStorageException {
262218
return delegate.getRoleForPrincipal(principalId);
263219
}
264220

265-
266221
@Override
267222
public List<RoleMappingDto> getRoleMappings() throws RegistryStorageException {
268223
return delegate.getRoleMappings();
269224
}
270-
225+
271226
@Override
272227
public RoleMappingSearchResultsDto searchRoleMappings(int offset, int limit) throws RegistryStorageException {
273228
return delegate.searchRoleMappings(offset, limit);
274229
}
275230

276-
277231
@Override
278232
public List<DynamicConfigPropertyDto> getConfigProperties() throws RegistryStorageException {
279233
return delegate.getConfigProperties();
280234
}
281235

282-
283236
@Override
284237
public DynamicConfigPropertyDto getConfigProperty(String propertyName) {
285238
return delegate.getConfigProperty(propertyName);
286239
}
287240

288-
289241
@Override
290242
public List<DynamicConfigPropertyDto> getStaleConfigProperties(Instant since) {
291243
return delegate.getStaleConfigProperties(since);
292244
}
293245

294-
295246
@Override
296247
public DynamicConfigPropertyDto getRawConfigProperty(String propertyName) {
297248
return delegate.getRawConfigProperty(propertyName);
298249
}
299250

300-
301251
@Override
302252
public Map<String, ContentHandle> resolveReferences(List<ArtifactReferenceDto> references) {
303253
return delegate.resolveReferences(references);
304254
}
305255

306-
307256
@Override
308257
public boolean isArtifactExists(String groupId, String artifactId) throws RegistryStorageException {
309258
return delegate.isArtifactExists(groupId, artifactId);
@@ -314,98 +263,85 @@ public boolean isGroupExists(String groupId) throws RegistryStorageException {
314263
return delegate.isGroupExists(groupId);
315264
}
316265

317-
318266
@Override
319267
public boolean isArtifactVersionExists(String groupId, String artifactId, String version) throws RegistryStorageException {
320268
return delegate.isArtifactVersionExists(groupId, artifactId, version);
321269
}
322270

323-
324271
@Override
325272
public List<Long> getContentIdsReferencingArtifactVersion(String groupId, String artifactId, String version) {
326273
return delegate.getContentIdsReferencingArtifactVersion(groupId, artifactId, version);
327274
}
328275

329-
330276
@Override
331277
public List<Long> getGlobalIdsReferencingArtifactVersion(String groupId, String artifactId, String version) {
332278
return delegate.getGlobalIdsReferencingArtifactVersion(groupId, artifactId, version);
333279
}
334280

335-
336281
@Override
337282
public List<ArtifactReferenceDto> getInboundArtifactReferences(String groupId, String artifactId, String version) {
338283
return delegate.getInboundArtifactReferences(groupId, artifactId, version);
339284
}
340285

341-
342286
@Override
343287
public GroupSearchResultsDto searchGroups(Set<SearchFilter> filters, OrderBy orderBy, OrderDirection orderDirection, Integer offset, Integer limit) {
344288
return delegate.searchGroups(filters, orderBy, orderDirection, offset, limit);
345289
}
346290

347-
348291
@Override
349292
public List<CommentDto> getArtifactVersionComments(String groupId, String artifactId, String version) {
350293
return delegate.getArtifactVersionComments(groupId, artifactId, version);
351294
}
352295

353-
354296
@Override
355297
public boolean isContentExists(String contentHash) throws RegistryStorageException {
356298
return delegate.isContentExists(contentHash);
357299
}
358300

359-
360301
@Override
361302
public boolean isArtifactRuleExists(String groupId, String artifactId, RuleType rule) throws RegistryStorageException {
362303
return delegate.isArtifactRuleExists(groupId, artifactId, rule);
363304
}
364305

365-
366306
@Override
367307
public boolean isGlobalRuleExists(RuleType rule) throws RegistryStorageException {
368308
return delegate.isGlobalRuleExists(rule);
369309
}
370310

371-
372311
@Override
373312
public boolean isRoleMappingExists(String principalId) {
374313
return delegate.isRoleMappingExists(principalId);
375314
}
376315

377-
378316
@Override
379317
public Optional<Long> contentIdFromHash(String contentHash) {
380318
return delegate.contentIdFromHash(contentHash);
381319
}
382320

383-
384321
@Override
385322
public List<Long> getEnabledArtifactContentIds(String groupId, String artifactId) {
386323
return delegate.getEnabledArtifactContentIds(groupId, artifactId);
387324
}
388325

389326
@Override
390-
public List<String> getArtifactVersions(String groupId, String artifactId, ArtifactRetrievalBehavior behavior) throws ArtifactNotFoundException, RegistryStorageException {
327+
public List<String> getArtifactVersions(String groupId, String artifactId, ArtifactRetrievalBehavior behavior)
328+
throws ArtifactNotFoundException, RegistryStorageException {
391329
return delegate.getArtifactVersions(groupId, artifactId, behavior);
392330
}
393331

394-
395332
@Override
396333
public GAV getArtifactBranchTip(GA ga, BranchId branchId, ArtifactRetrievalBehavior behavior) {
397334
return delegate.getArtifactBranchTip(ga, branchId, behavior);
398335
}
399336

400-
401337
@Override
402338
public Map<BranchId, List<GAV>> getArtifactBranches(GA ga) {
403339
return delegate.getArtifactBranches(ga);
404340
}
405341

406-
407342
@Override
408343
public List<GAV> getArtifactBranch(GA ga, BranchId branchId, ArtifactRetrievalBehavior behavior) {
409344
return delegate.getArtifactBranch(ga, branchId, behavior);
410345
}
346+
411347
}

0 commit comments

Comments
 (0)