Commit graph

208 commits

Author SHA1 Message Date
Fabio Collini
58cdc5420d REFRESH_ON_STALE managed using a new scope (#6) 2019-06-30 13:14:22 -04:00
DigitalBuddha
b72122a5e5 fix tests 2019-06-30 12:38:46 -04:00
Fabio Collini
91217c8fa8 RealInternalStore refactoring (#1)
* AGP 3.5.0-beta04

* Stream implementation defined in the interface

* New class StoreWrapper

* Delete StoreBuilder

* Rename plus methods

* Move stalePolicy to Persister

* Simplify code

* Move inflight request management to a new class

* Move cache management to a new class

* Move wrappers to new package

* Delete StoreWrapper class

* New test

* Restored old versions

* Restored old versions

* Restored old versions

* Restored old versions

* Restored old versions

* Restored old versions

* Add runCatching to ignore exceptions on persisters

* Backward compatible RealStoreBuilder implementation

* Fix tests
2019-06-29 19:49:47 -04:00
fabioCollini
53f823548c Removed extra RealInternalStore constructor 2019-05-29 08:46:35 +02:00
fabioCollini
1861992d69 Removed class delegates in RealInternalStore 2019-05-29 08:43:28 +02:00
fabioCollini
805b19c533 Removed getRefreshing method 2019-05-29 08:40:20 +02:00
fabioCollini
7958f3a0e0 Removed deprecated clear methods 2019-05-29 08:37:26 +02:00
fabioCollini
fddea54d32 Never returns cached data on fetch 2019-05-28 09:54:15 +02:00
Brian Plummer
7981500102
Merge pull request #3 from friendlyrobotnyc/feature/remove-getWithResult
Remove getWithResult and freshWithResult
2019-05-27 15:58:29 -04:00
Fabio Collini
7480d5a9c4 Convert filesystem classes to Kotlin (#4) 2019-05-27 15:41:04 -04:00
fabioCollini
e65f18a4f4 Remove getWithResult and freshWithResult 2019-05-27 20:47:58 +02:00
Fabio Collini
a7edcf2aca Flow<Pair<V, T>> as stream result (#2) 2019-05-27 12:26:55 -04:00
fabioCollini
b50c41a5f3 Merge branch 'feature/coroutines' into feature/flow
# Conflicts:
#	store/src/main/java/com/nytimes/android/external/store3/base/impl/RealInternalStore.kt
2019-05-27 16:55:48 +02:00
fabioCollini
ca62ca14a1 Restore code format 2019-05-27 16:55:09 +02:00
fabioCollini
c3c2055047 Invalidate inFlightRequests on errors 2019-05-27 16:28:51 +02:00
fabioCollini
141908e42f Fix duplicated fetch call on error 2019-05-27 16:08:02 +02:00
fabioCollini
e038fc991d Stream methods returning flows instead of ReceiveChannel 2019-05-27 15:52:25 +02:00
fabioCollini
927e77954a Coroutines 1.2.1 2019-05-21 22:57:14 +02:00
fabioCollini
015140fbf0 Fix some tests 2019-05-21 21:32:54 +02:00
fabioCollini
d4ce82c468 Convert classes to kotlin 2019-02-23 17:59:29 +01:00
fabioCollini
664f60b0d0 Removed rxjava usages 2019-02-23 16:59:01 +01:00
fabioCollini
7c2bbae59f Removed rxjava on store module 2019-02-23 15:50:31 +01:00
fabioCollini
e0cf396a10 Removed StoreRoom 2019-02-23 15:46:15 +01:00
fabioCollini
4b27b64d0e Convert classes to kotlin 2019-02-23 08:49:28 -05:00
fabioCollini
0ad60262f1 Convert CacheFactory to Kotlin 2019-02-23 08:37:56 -05:00
fabioCollini
34d028337e Fix tests 2019-02-23 08:24:55 -05:00
fabioCollini
fb4ee1992d Removed rx classes and fixed tests 2019-02-22 22:17:45 -05:00
fabioCollini
b2976719c1 Don't cache errors 2019-02-22 20:49:43 -05:00
fabioCollini
b7e77512cd Fix some tests 2019-02-20 23:38:49 -05:00
fabioCollini
e2c0460964 Replaced Channel with BroadcastChannel 2019-02-20 23:23:35 -05:00
Mike Nakhimovich
c072f1532b Merge remote-tracking branch 'origin/feature/coroutines' into feature/coroutines 2019-02-12 11:41:01 -05:00
Mike Nakhimovich
e024b64e11 WIP 2019-02-12 11:40:39 -05:00
fabioCollini
77dfdd97fa Restored MultiParser 2019-02-11 17:40:53 -05:00
fabioCollini
2ceb990d5d Fix some tests 2019-02-11 16:10:16 -05:00
fabioCollini
7ada4fbc38 Fix compilation errors in tests 2019-02-11 16:00:38 -05:00
fabioCollini
d749b3a161 Restored interface 2019-02-11 15:34:40 -05:00
fabioCollini
1b9e79a565 Fix some tests 2019-02-11 15:15:08 -05:00
DigitalBuddha
b3a94fa1a8 fixing tests 2019-02-10 20:23:15 -05:00
DigitalBuddha
774e9d9c4b Merge remote-tracking branch 'origin/feature/kotlin_conversion' into feature/coroutines
# Conflicts:
#	app/build.gradle
#	app/src/main/java/com/nytimes/android/sample/SampleApp.kt
#	app/src/main/java/com/nytimes/android/sample/activity/PersistingStoreActivity.java
#	app/src/main/java/com/nytimes/android/sample/activity/StoreActivity.java
#	build.gradle
#	buildsystem/dependencies.gradle
#	filesystem/src/test/java/com/nytimes/android/external/fs3/FilePersisterTest.java
#	filesystem/src/test/java/com/nytimes/android/external/fs3/FileSystemRecordPersisterTest.java
#	filesystem/src/test/java/com/nytimes/android/external/fs3/RecordPersisterTest.java
#	filesystem/src/test/java/com/nytimes/android/external/fs3/SourcePersisterTest.java
#	middleware/src/main/java/com/nytimes/android/external/store3/middleware/GsonParserFactory.kt
#	middleware/src/main/java/com/nytimes/android/external/store3/middleware/GsonReaderParser.kt
#	middleware/src/main/java/com/nytimes/android/external/store3/middleware/GsonSourceParser.kt
#	middleware/src/main/java/com/nytimes/android/external/store3/middleware/GsonStringParser.kt
#	middleware/src/test/java/com/nytimes/android/external/store3/GenericParserStoreTest.java
#	middleware/src/test/java/com/nytimes/android/external/store3/GsonParserFactoryTest.java
#	middleware/src/test/java/com/nytimes/android/external/store3/GsonSourceListParserTest.java
#	store/build.gradle
2019-02-10 19:29:48 -05:00
DigitalBuddha
2d3596e4bb fixing tests 2019-02-10 19:23:00 -05:00
ychescale9
ecea787a3f Remove Deprecated annotation for stream(V key) (#368)
* Remove Deprecated annotation for stream(V key) which was meant to be undeprecated with https://github.com/NYTimes/Store/pull/252.

* Fix CI - remove https://plugins.gradle.org/m2 repository applied to all projects.
2018-10-25 10:43:29 -04:00
Brian Plummer
2da5e1e5fe
convert first half of store tests to kotlin (#353)
* configure kotlin, first test

* first half of store tests

* remove unused imports

* pr feedback, scope and el

* remove charsetTest
2018-07-18 21:54:59 +02:00
Mike Nakhimovich
6ac40cd371 StoreRoom (#338)
* roomStore

* kt the app class

* refactor

* fix compilation

* Update .travis.yml

* migrate relevant tests to RoomStore, mark new Room API with @Experimental

* pr feedback

* bump minor rev up

* cleanup store

* create factory, clean up example

* pr comments
2018-05-30 18:56:08 +02:00
Roberto Orgiu
ed378585c2
Merge pull request #328 from pavlospt/fix_memory_policy_default_size
Fix memory policy default size
2018-05-13 14:57:52 -07:00
Jorge Antonio Díaz-Benito Soriano
d26d50a5b6 Remove unnecessary Android-specific stuff (#319) 2018-05-03 09:39:37 -04:00
Tournaris Pavlos-Petros
7c9e28b573 Add test for MemoryPolicy default size 2018-03-29 23:00:15 +03:00
pavlospt
d40f02bd89
Return standard maxSize if not set 2018-03-29 17:13:54 +03:00
Saket Narayan
2232264fb2 Add missing reading of expire-after-policy when creating a NoopPersister (#315)
* Set missing expire-after-access policy to NoopPersister's cache (#312)

* Remove comment about PMD from NoopPersister#create()

* Add regression test for #312

* Deprecate MemoryPolicy#isDefaultPolicy() in favor of isDefaultWritePolicy() and isDefaultAccessPolicy()
2018-03-20 19:14:55 +01:00
Pavlos-Petros Tournaris
6f2f1c12fe Fix issues occured from RxJava1 dependency (#314)
* Remove RxJava1 dependencies
* Fixed an ErrorProne warning
2018-02-20 18:05:46 +01:00
Stefan M
792ad745d2
Changed weird MemoryPolicy to 24 hours 2017-11-14 10:27:00 +01:00
Mateusz Perlak
39a91966bb #275 feature - added ParsingFetcher that wraps Raw type Parser and Fetcher (#280) 2017-10-31 10:21:20 -04:00
Jorge Antonio Díaz-Benito Soriano
dac878e2ce Gradle updates (#266)
* Gradle Wrapper (all) 3.3 -> 4.1

* Gradle plugin for Android 2.3.2 -> 3.0.0-beta2

This requires upgrading the errorprone plugin to 0.0.11. Also, see
https://stackoverflow.com/questions/44196672/aapt2-compile-failed-invalid-dimen-on-android-3-0-canary-1

gradle plugin

* SDK Build Tools 25.0.2 -> 26.0.1

* Remove retrolambda

* Log error from subscription on PersistingStoreActivity for consistency

* Update dependency inclusion directives to those of the 3.0 plugin

Also, jsr305 and javax usages have been taken from compile to compileOnly
since they are not required beyond.

* Add dependencies that previously were resolved through leaked ones from other artifacts

Now dependency leaks are eliminated thanks to 'implementation' from the 3.0 version of the gradle plugin.

* Remove coupling between middlewares and cache

* Replace mockito-all by mockito-core

mockito-all causes problems related to hamcrest when used with JUnit. See
https://tedvinke.wordpress.com/2013/12/17/mixing-junit-hamcrest-and-mockito-explaining-nosuchmethoderror/

* Remove unused dependency.

* Build Tools 26.0.1 on Travis

* Suppress PMD.AvoidThrowingNullPointerException for the time being

* Avoid PMD synthetic accessor warning
2017-08-17 13:48:12 -04:00
Mike Nakhimovich
ad58fad050 fix stream for a single barcode (#252) 2017-07-26 11:23:18 -04:00
Vasilis Charalampakis
7e0198cbb4 Return object with meta data (#250)
* Add Result

* Make Store return Result<Parsed> objects

* Add basic tests

* Fix checkstyle & PMD

* Remove get name from Result

* Fix Result equality

* Enumerate Source

* Remove .DS_Store files
2017-07-25 17:31:10 -04:00
Brian Plummer
30b1771170 forward port of readAll/clearAll to rxjava2 branch (#254) 2017-07-24 16:40:37 -04:00
Pedro Carrillo
bf79676dad #225 Charset for rx2 branch (#239)
* #225 for rx2 branch

* adding end line
2017-07-07 11:31:19 -04:00
Jorge Antonio Díaz-Benito Soriano
10d0cf6d07 Add store-kotlin module (#229)
* Add store-kotlin module

* Remove useless file

* Fix package in AndroidManifest

* Refactor module tests to assertJ

* Remove wrong annotation

* Add store-kotlin artifact to README

* Add module README

* Add KDoc to Javadoc jar

* Add Experimental annotation

* Mark all public store-kotlin classes as @Experimental

* Replace use of rx's @Experimental with local one instead
2017-06-22 21:22:34 -04:00
Ramona Harrison
8b4b186aaf Refactor package name to store3 for the Rx2 branch (#220)
* Refactor package name to store3 for the Rx2 branch

* Fix cache autoimports

* Fix LocalCache imports
2017-05-23 13:27:32 -04:00
Ramona Harrison
2c2872504b Include develop changes in Rx2 branch (#214)
* Update README.md

* Update README.md

* Update README.md (#175)

* Update README.md

* Close source after  write to filesystem

* Refactor FSFileTest to rx2 package

* remove null check on source and annotate arg with NonNull

* Standardize store.stream() to only emit new items

* Standardize store.stream() to only emit new items

* Remove unneeded call to asObservable()

* Update README.md

* Update README.md

* Fixed PMD violation God Class for RealInternalStore (#179)

* Update README.md

* Fixing dependency importation typo (#186)

* Mike/test (#195)

* new test

* Refactor NoNetworkTest to rx2 package

* Typo fixed (#202)

* Typo fixed

* Simplified by removing generics

* Update build.gradle (#193)

rename app id for sample app

* Add a missing Source.close() call (#200)

* Add Retrolambda plugin on the rest modules (#205)

* Add Retrolambda plugin on the rest modules and modify sample app for new config

* Suppress PMD violation on equals()

* Add Raw to BufferedSource transformer (#198)

* expireAfterAccess added to MemoryPolicy (#199)

* Add test coverage for MemoryPolicyBuilder (#210)

* Add test coverage for MemoryPolicyBuilder

* Checkstyle new line at EOF

* Fix PMD

* Refactor MemoryPolicyBuilderTest to rx2 package

* Deprecate setExpireAfter and getExpireAfter (#211)
2017-05-19 10:25:04 -04:00
Shane Fitzpatrick
47c463ba8a Add lambdas to Store and Filesystem modules (rx2) (#189) 2017-05-01 16:44:44 -04:00
Tair
20445fff13 RxJava2 Migration: Return single/maybe where appropriate. (#185)
* RxJava2 Migration: Return single/maybe where appropriate.

* Remove no longer used class.

* Pull in the fix for #181 from develop.

* Re-iterated solution #181 issue.
2017-04-24 16:37:45 -04:00
Mike Nakhimovich
f009e11a0b Feature/rx2 package rename (#171)
* first pass at store2 artifacts
2017-03-23 17:48:16 -04:00
Maksim Moiseikin
a9ed871834 Port to RxJava 2 (#155)
* Port Store artifact to RxJava 2
2017-03-23 16:29:47 -04:00
Brian Plummer
554bb25a32 persisterIsStale() should return false if record is missing or policy is unspecified (#164)
* persisterIsStale() should return false if record is missing or policy is unspecified

* Updated store network stale test
2017-03-20 16:39:18 -04:00
Pavlos-Petros Tournaris
e216242040 Fix NoopPersister wrong caching duration (#151)
* Fix NoopPersister wrong caching duration
2017-03-10 13:20:57 -05:00
Brian Plummer
d6ed9c7916 modify clearMemory() to call regular clear() since they are equivalant… (#144)
* modify clearMemory() to call regular clear() since they are equivalant,  bullet-proof BreadthFirstFileTreeIterator
2017-03-02 11:24:24 -05:00
Mike Nakhimovich
9b512e7345 fix clear one barcode (#141) 2017-02-27 16:48:05 -05:00
digitalbuddha
f353a5ff8e add additional constructor for RealStore 2017-02-22 11:24:33 -05:00
Mike Nakhimovich
9b74a336f7 add KeyParseFunc for times when parser needs input val (#136)
* add KeyParser Func for times when parser needs input key val
2017-02-22 09:58:17 -05:00
Paul Woitaschek
a8293a5994 Test repeat when evicted (#128)
* Moved repeat when emits logic in a separate class
2017-02-10 11:22:43 -05:00
Paul Woitaschek
62c7ca39d7 Cleanup (#127)
* Fixed a race condition that would appear when the read was called but not immediately subscribed to. Defer the whole file check till subscription.

* Diamonds

* General cleanup, missing nullity annotations, missing override annotations

* More key naming conventions

* Dependency update

* More key naming conventions

* Parser, not func

* Name outer key different so cache can be evicted correctly

* Another missing override
2017-02-09 13:04:07 -08:00
Pavlos-Petros Tournaris
a600c90ac8 Fix name on occurences of Key (#125) 2017-02-09 12:19:43 -05:00
Pavlos-Petros Tournaris
71e56c4ea5 Create single instance of empty BarCode + naming cleanup (#124)
* Create private static final values for empty TYPE and KEY

* Use common variable name for Key variables

* Create static final instance for empty BarCode
2017-02-09 08:24:58 -08:00
Pavlos-Petros Tournaris
54c83d0402 Simplify Persister clear and RefreshSubject notify (#123) 2017-02-09 10:24:42 -05:00
Mike Nakhimovich
f3ba204e3c Store v1 removal in favor of Stores with generic keys (#122)
* remove old Store.java

* no more depracted Store.java
2017-02-08 18:18:17 -05:00
Mike Nakhimovich
d01f2abe45 Feature/filepersister (#115)
* generic file persister with path resolver
2017-02-08 15:46:35 -05:00
Mike Nakhimovich
f4fdd1e9d9 Feature/clear all cache (#117)
* public api to clear memory and disk caches
2017-02-08 15:44:12 -05:00
Mike Nakhimovich
1c7bc502b0 Tech/record stale fs (#111)
networkBeforeStale and refreshOnStale
2017-02-07 09:45:48 -05:00
Mike Nakhimovich
e76f29261d rework builders (#110) 2017-02-06 10:21:55 -05:00
Mike Nakhimovich
2c24357df9 Migrate Barcode to any Type (#86)
* migrate barcode to a generic key
2017-02-03 17:49:40 -05:00
Mike Nakhimovich
e3bf9584a5 GetRefreshing - Repeat when clear (#103)
*getRefreshing
2017-02-02 15:27:27 -05:00
Mike Nakhimovich
5af5c00d9a fixes inflight caching errors (#101) 2017-02-01 11:59:57 -05:00
Pavlos-Petros Tournaris
b93c431e24 Remove dead code and add/remove empty lines were needed (#99) 2017-01-31 17:17:18 -05:00
digitalbuddha
c9d1364c88 fix flaky test 2017-01-31 08:35:15 -05:00
digitalbuddha
ee377d538d pmd 2017-01-31 08:23:29 -05:00
digitalbuddha
aae31d7247 pr comments 2017-01-31 08:21:03 -05:00
digitalbuddha
9dfb6c5375 clear needs to call noop disk and inflight 2017-01-31 08:03:16 -05:00
Brian Plummer
6a6f281925 convert test to javax.annotations 2017-01-30 21:20:02 -05:00
Brian Plummer
5fe547cf42 convert store to javax.annotations 2017-01-30 21:16:30 -05:00
Plummer
405a15d3b6 start of conversion to javax.annotations 2017-01-30 17:46:05 -05:00
Mike Nakhimovich
e70687c6f7 fix in flight 1 minute debouncing (#92)
* fix in flight 1 minute debouncing

* fix pmd
2017-01-30 11:47:19 -05:00
Mike Nakhimovich
71220baf30 fixes race condition in memory cache (#90)
* fixes race condition in memory cache

* racy due to disk not being lazy

* pmd violations
2017-01-30 11:40:14 -05:00
Brian Plummer
62dec4bbbf minor test clean up, use isSameAs() instead of == (#87) 2017-01-29 18:28:01 -05:00
Brian Plummer
be5ba6443a convert store to java, #83 (#85)
convert store to java, #83
2017-01-28 20:52:55 -05:00
digitalbuddha
f7e3fc5566 fix test 2017-01-23 13:27:38 -05:00
digitalbuddha
24855b3ba9 fix race condition of 2 network requests very quickly 2017-01-23 13:12:55 -05:00
digitalbuddha
c711de75c8 fix race condition of 2 network requests very quickly 2017-01-23 13:10:24 -05:00
Paul Woitaschek
b700fc2868 Added missing nonnull and override annotations 2017-01-20 15:52:29 +01:00
Paul Woitaschek
232ff1040d Deprecated stream that takes a barcode. Added a stream without a barcode that will just passively stream new data. Fixes #72 2017-01-20 15:34:58 +01:00
digitalbuddha
56a84884d4 update version, make MultiParser public 2017-01-19 11:40:22 -05:00
shuny
250168647b implement equivalence test 2017-01-19 19:24:40 +09:00
shuny
16e3d3fd37 implements equals and hashCode 2017-01-19 19:24:29 +09:00
Michal Drabik
d085c013c9 Multi Parser (#61)
* Create multi parser class
2017-01-15 14:15:28 -05:00
Maksim Moiseikin
17987bf15f Add Nullability Annotations (#52) 2017-01-12 05:48:25 -05:00
Brian Plummer
382c00dbfb start of pmd inclusion (#50)
* start of pmd inclusion

* fix all pmd violations

* fail on pmd

* fail on pmd

* fail on pmd
2017-01-11 15:11:41 -05:00
Brian Plummer
eaa4219dd7 start of checkstyle inclusion... (#48)
* start of checkstyle inclusion

* checkstyle!
2017-01-11 10:04:44 -05:00
digitalbuddha
9badd11494 initial 2017-01-04 14:17:53 -05:00
digitalbuddha
7b86dae1b8 initialCommit 2016-11-29 13:59:48 -05:00