|
21 | 21 | package io.spine.server.storage.datastore; |
22 | 22 |
|
23 | 23 | import com.google.cloud.datastore.Datastore; |
| 24 | +import com.google.cloud.datastore.Value; |
24 | 25 | import com.google.common.annotations.VisibleForTesting; |
25 | 26 | import com.google.common.collect.Iterables; |
26 | 27 | import com.google.errorprone.annotations.CanIgnoreReturnValue; |
|
31 | 32 | import io.spine.server.aggregate.AggregateStorage; |
32 | 33 | import io.spine.server.delivery.InboxStorage; |
33 | 34 | import io.spine.server.entity.Entity; |
| 35 | +import io.spine.server.entity.storage.TypeRegistry; |
34 | 36 | import io.spine.server.projection.Projection; |
35 | 37 | import io.spine.server.projection.ProjectionStorage; |
36 | 38 | import io.spine.server.storage.RecordStorage; |
|
41 | 43 | import io.spine.server.storage.datastore.tenant.NamespaceSupplier; |
42 | 44 | import io.spine.server.storage.datastore.tenant.NsConverterFactory; |
43 | 45 | import io.spine.server.storage.datastore.tenant.PrefixedNsConverterFactory; |
| 46 | +import io.spine.server.storage.datastore.type.DsTypeRegistry; |
44 | 47 | import io.spine.server.tenant.TenantIndex; |
45 | 48 |
|
46 | 49 | import java.util.Map; |
@@ -83,7 +86,7 @@ public class DatastoreStorageFactory implements StorageFactory { |
83 | 86 | */ |
84 | 87 | private final Map<Class<? extends Storage>, DatastoreWrapper> sysWrappers = newConcurrentMap(); |
85 | 88 |
|
86 | | - private final ColumnTypeRegistry typeRegistry; |
| 89 | + private final TypeRegistry<Value<?>> typeRegistry; |
87 | 90 |
|
88 | 91 | private final NsConverterFactory converterFactory; |
89 | 92 |
|
@@ -153,7 +156,7 @@ public InboxStorage createInboxStorage(boolean multitenant) { |
153 | 156 | return new DsInboxStorage(wrapper, multitenant); |
154 | 157 | } |
155 | 158 |
|
156 | | - public ColumnTypeRegistry getTypeRegistry() { |
| 159 | + public TypeRegistry<Value<?>> getTypeRegistry() { |
157 | 160 | return typeRegistry; |
158 | 161 | } |
159 | 162 |
|
@@ -265,7 +268,7 @@ public static Builder newBuilder() { |
265 | 268 | public static class Builder { |
266 | 269 |
|
267 | 270 | private Datastore datastore; |
268 | | - private ColumnTypeRegistry typeRegistry; |
| 271 | + private TypeRegistry<Value<?>> typeRegistry; |
269 | 272 | private NamespaceConverter namespaceConverter; |
270 | 273 | private NsConverterFactory converterFactory; |
271 | 274 |
|
@@ -293,16 +296,16 @@ public Datastore getDatastore() { |
293 | 296 | } |
294 | 297 |
|
295 | 298 | /** |
296 | | - * Sets a {@link ColumnTypeRegistry} for handling the Entity Columns. |
| 299 | + * Sets a {@link TypeRegistry} for handling the Entity Columns. |
297 | 300 | * |
298 | | - * <p>Default value is {@link DefaultColumnTypeRegistry}. |
| 301 | + * <p>Default value is {@link DsTypeRegistry}. |
299 | 302 | * |
300 | 303 | * @param typeRegistry |
301 | 304 | * the type registry containing all the supported |
302 | 305 | * {@linkplain io.spine.server.entity.storage.Column column} types |
303 | 306 | * @return self for method chaining |
304 | 307 | */ |
305 | | - public Builder setTypeRegistry(ColumnTypeRegistry typeRegistry) { |
| 308 | + public Builder setTypeRegistry(TypeRegistry<Value<?>> typeRegistry) { |
306 | 309 | this.typeRegistry = checkNotNull(typeRegistry); |
307 | 310 | return this; |
308 | 311 | } |
@@ -333,7 +336,7 @@ public Builder setNamespaceConverter(NamespaceConverter converter) { |
333 | 336 | public DatastoreStorageFactory build() { |
334 | 337 | checkNotNull(datastore); |
335 | 338 | if (typeRegistry == null) { |
336 | | - typeRegistry = new DefaultColumnTypeRegistry(); |
| 339 | + typeRegistry = new DsTypeRegistry(); |
337 | 340 | } |
338 | 341 | if (namespaceConverter == null) { |
339 | 342 | converterFactory = NsConverterFactory.defaults(); |
|
0 commit comments