Skip to content

Questions about durability with scopes and collections #1329

Closed
@jorgerod

Description

@jorgerod

Hello

I've been looking at the added feature of scopes and collections and I've seen an issue that I don't know if it's correct.

  • This methods of interfaces {Operation}ByIdWithDurability return {Operation}ByIdInScope:

interface UpsertByIdWithDurability<T> extends UpsertByIdInScope<T>, WithDurability<T> {
@Override
UpsertByIdInScope<T> withDurability(DurabilityLevel durabilityLevel);
@Override
UpsertByIdInScope<T> withDurability(PersistTo persistTo, ReplicateTo replicateTo);

interface ReplaceByIdWithDurability<T> extends ReplaceByIdInScope<T>, WithDurability<T> {
@Override
ReplaceByIdInScope<T> withDurability(DurabilityLevel durabilityLevel);
@Override
ReplaceByIdInScope<T> withDurability(PersistTo persistTo, ReplicateTo replicateTo);
}

  • and this methods return {Operation}ByInCollection:

interface InsertByIdWithDurability<T> extends InsertByIdInScope<T>, WithDurability<T> {
@Override
InsertByIdInCollection<T> withDurability(DurabilityLevel durabilityLevel);
@Override
InsertByIdInCollection<T> withDurability(PersistTo persistTo, ReplicateTo replicateTo);

interface UpsertByIdWithDurability<T> extends UpsertByIdInScope<T>, WithDurability<T> {
@Override
UpsertByIdInCollection<T> withDurability(DurabilityLevel durabilityLevel);
@Override
UpsertByIdInCollection<T> withDurability(PersistTo persistTo, ReplicateTo replicateTo);

interface ReplaceByIdWithDurability<T> extends ReplaceByIdInScope<T>, WithDurability<T> {
ReplaceByIdInCollection<T> withDurability(DurabilityLevel durabilityLevel);
ReplaceByIdInCollection<T> withDurability(PersistTo persistTo, ReplicateTo replicateTo);
}

interface InsertByIdWithDurability<T> extends InsertByIdInScope<T>, WithDurability<T> {
@Override
InsertByIdInCollection<T> withDurability(DurabilityLevel durabilityLevel);
@Override
InsertByIdInCollection<T> withDurability(PersistTo persistTo, ReplicateTo replicateTo);

interface RemoveByIdWithDurability extends RemoveByIdInScope, WithDurability<RemoveResult> {
@Override
RemoveByIdInCollection withDurability(DurabilityLevel durabilityLevel);
@Override
RemoveByIdInCollection withDurability(PersistTo persistTo, ReplicateTo replicateTo);

interface RemoveByIdWithDurability extends RemoveByIdInScope, WithDurability<RemoveResult> {
@Override
RemoveByIdInCollection withDurability(DurabilityLevel durabilityLevel);
@Override
RemoveByIdInCollection withDurability(PersistTo persistTo, ReplicateTo replicateTo);

I think the correct thing to do would be for those methods to return {Operation}ByInScope because then we could do .withDurability().withScope("").withCollection("")

How do you see it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions