@Test void getQuotaUserShouldReturnEmptyByDefault() { assertThat(sieveQuotaDAO.getQuota(USERNAME).block()) .isEmpty(); }
public Mono<Optional<QuotaSizeLimit>> getQuota() { return cassandraAsyncExecutor.executeSingleRowOptional( selectClusterQuotaStatement.bind() .setString(CassandraSieveClusterQuotaTable.NAME, CassandraSieveClusterQuotaTable.DEFAULT_NAME)) .map(optional -> optional.map(row -> QuotaSizeLimit.size(row.getLong(CassandraSieveClusterQuotaTable.VALUE)))); }
CassandraSieveQuotaDAO { public Mono<Optional<QuotaSizeLimit>> getQuota() { return cassandraAsyncExecutor.executeSingleRowOptional( selectClusterQuotaStatement.bind() .setString(CassandraSieveClusterQuotaTable.NAME, CassandraSieveClusterQuotaTable.DEFAULT_NAME)) .map(optional -> optional.map(row -> QuotaSizeLimit.size(row.getLong(CassandraSieveClusterQuotaTable.VALUE)))); } }
CassandraSieveQuotaDAO { public Mono<Optional<QuotaSizeLimit>> getQuota() { return cassandraAsyncExecutor.executeSingleRowOptional( selectClusterQuotaStatement.bind() .setString(CassandraSieveClusterQuotaTable.NAME, CassandraSieveClusterQuotaTable.DEFAULT_NAME)) .map(optional -> optional.map(row -> QuotaSizeLimit.size(row.getLong(CassandraSieveClusterQuotaTable.VALUE)))); } @Inject  CassandraSieveQuotaDAO(Session session); }
CassandraSieveQuotaDAO { public Mono<Optional<QuotaSizeLimit>> getQuota() { return cassandraAsyncExecutor.executeSingleRowOptional( selectClusterQuotaStatement.bind() .setString(CassandraSieveClusterQuotaTable.NAME, CassandraSieveClusterQuotaTable.DEFAULT_NAME)) .map(optional -> optional.map(row -> QuotaSizeLimit.size(row.getLong(CassandraSieveClusterQuotaTable.VALUE)))); } @Inject  CassandraSieveQuotaDAO(Session session); Mono<Long> spaceUsedBy(Username username); Mono<Void> updateSpaceUsed(Username username, long spaceUsed); Mono<Optional<QuotaSizeLimit>> getQuota(); Mono<Void> setQuota(QuotaSizeLimit quota); Mono<Void> removeQuota(); Mono<Optional<QuotaSizeLimit>> getQuota(Username username); Mono<Void> setQuota(Username username, QuotaSizeLimit quota); Mono<Void> removeQuota(Username username); }
CassandraSieveQuotaDAO { public Mono<Optional<QuotaSizeLimit>> getQuota() { return cassandraAsyncExecutor.executeSingleRowOptional( selectClusterQuotaStatement.bind() .setString(CassandraSieveClusterQuotaTable.NAME, CassandraSieveClusterQuotaTable.DEFAULT_NAME)) .map(optional -> optional.map(row -> QuotaSizeLimit.size(row.getLong(CassandraSieveClusterQuotaTable.VALUE)))); } @Inject  CassandraSieveQuotaDAO(Session session); Mono<Long> spaceUsedBy(Username username); Mono<Void> updateSpaceUsed(Username username, long spaceUsed); Mono<Optional<QuotaSizeLimit>> getQuota(); Mono<Void> setQuota(QuotaSizeLimit quota); Mono<Void> removeQuota(); Mono<Optional<QuotaSizeLimit>> getQuota(Username username); Mono<Void> setQuota(Username username, QuotaSizeLimit quota); Mono<Void> removeQuota(Username username);  }