Skip to content

Commit 39977b1

Browse files
committed
Align DefaultStorageHandler requests with ProcessingStrategy.
1 parent 4b10040 commit 39977b1

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

here-naksha-lib-handlers/src/main/java/com/here/naksha/lib/handlers/DefaultStorageHandler.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,14 @@ private boolean isUpdateCollectionRequest(@NotNull WriteCollections<?, ?, ?> wc)
270270
@NotNull F1<Result, RuntimeException> reattempt,
271271
@NotNull StopWatch storageTimer) {
272272
try {
273-
if (wr instanceof WriteXyzCollections) {
273+
if (wr instanceof WriteXyzCollections wc) {
274274
return measuredStorageSupplier(
275-
() -> performAtomicWriteCollection(ctx, storageImpl, (WriteXyzCollections) wr), storageTimer);
275+
() -> performAtomicWriteCollection(ctx, storageImpl, wc), storageTimer);
276+
} else if (wr instanceof WriteFeatures<?, ?, ?> wf) {
277+
return measuredStorageSupplier(
278+
() -> performAtomicWriteFeatures(ctx, storageImpl, wf), storageTimer);
276279
} else {
277-
return measuredStorageSupplier(() -> performAtomicWriteFeatures(ctx, storageImpl, wr), storageTimer);
280+
return notImplemented(wr);
278281
}
279282
} catch (RuntimeException re) {
280283
return reattempt.call(re);
@@ -287,8 +290,8 @@ private boolean isUpdateCollectionRequest(@NotNull WriteCollections<?, ?, ?> wc)
287290
}
288291

289292
protected @NotNull Result performAtomicWriteFeatures(
290-
@NotNull NakshaContext ctx, @NotNull IStorage storageImpl, @NotNull WriteRequest<?, ?, ?> wr) {
291-
return singleWrite(ctx, storageImpl, wr);
293+
@NotNull NakshaContext ctx, @NotNull IStorage storageImpl, @NotNull WriteFeatures<?, ?, ?> wf) {
294+
return singleWrite(ctx, storageImpl, wf);
292295
}
293296

294297
private @NotNull Result singleWrite(

0 commit comments

Comments
 (0)