Skip to content
This repository has been archived by the owner on Aug 9, 2020. It is now read-only.

Commit

Permalink
fix link in readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
ipcjs committed Sep 17, 2018
1 parent 45767e6 commit 05a6c34
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 36 deletions.
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,20 +91,20 @@ RxCache exposes `evictAll()` method to evict the entire cache in a row.
RxCache accepts as argument a set of classes to indicate how the provider needs to handle the cached data:

* A Reactive type is the only object required to create a provider. This Reactive type must be equal to the one specified by the returning value of the provider.
* [EvictProvider](https://github.com/VictorAlbertos/RxCache/blob/master/core/src/main/java/io/rx_cache/EvictProvider.java) allows to explicitly evict all the data associated with the provider.
* [@ProviderKey](https://github.com/VictorAlbertos/RxCache/blob/master/core/src/main/java/io/rx_cache/ProviderKey.java) is an annotation for provider methods that is highly recommended to use and proguard users MUST use this annotation, if not used the method names will be used as provider keys (cache keys) and proguard users will quickly run into problems, please see [Proguard](proguard) for detailed information. Using the annotaiton is also useful when not using Proguard as it makes sure you can change your method names without having to write a migration for old cache files.
* [EvictDynamicKey](https://github.com/VictorAlbertos/RxCache/blob/master/core/src/main/java/io/rx_cache/EvictDynamicKey.java) allows to explicitly evict the data of an specific [DynamicKey](https://github.com/VictorAlbertos/RxCache/blob/master/runtime/src/main/java/io/rx_cache/DynamicKey.java).
* [EvictDynamicKeyGroup](https://github.com/VictorAlbertos/RxCache/blob/master/core/src/main/java/io/rx_cache/EvictDynamicKeyGroup.java) allows to explicitly evict the data of an specific [DynamicKeyGroup](https://github.com/VictorAlbertos/RxCache/blob/master/runtime/src/main/java/io/rx_cache/DynamicKeyGroup.java).
* [DynamicKey](https://github.com/VictorAlbertos/RxCache/blob/master/runtime/src/main/java/io/rx_cache/DynamicKey.java) is a wrapper around the key object for those providers which need to handle multiple records, so they need to provide multiple keys, such us endpoints with pagination, ordering or filtering requirements. To evict the data associated with one particular key use `EvictDynamicKey`.
* [DynamicKeyGroup](https://github.com/VictorAlbertos/RxCache/blob/master/runtime/src/main/java/io/rx_cache/DynamicKeyGroup.java) is a wrapper around the key and the group for those providers which need to handle multiple records grouped, so they need to provide multiple keys organized in groups, such us endpoints with filtering AND pagination requirements. To evict the data associated with the key of one particular group, use `EvictDynamicKeyGroup`.
* [EvictProvider](https://github.com/VictorAlbertos/RxCache/blob/2.x/core/src/main/java/io/rx_cache2/EvictProvider.java) allows to explicitly evict all the data associated with the provider.
* [@ProviderKey](https://github.com/VictorAlbertos/RxCache/blob/2.x/core/src/main/java/io/rx_cache2/ProviderKey.java) is an annotation for provider methods that is highly recommended to use and proguard users MUST use this annotation, if not used the method names will be used as provider keys (cache keys) and proguard users will quickly run into problems, please see [Proguard](proguard) for detailed information. Using the annotaiton is also useful when not using Proguard as it makes sure you can change your method names without having to write a migration for old cache files.
* [EvictDynamicKey](https://github.com/VictorAlbertos/RxCache/blob/2.x/core/src/main/java/io/rx_cache2/EvictDynamicKey.java) allows to explicitly evict the data of an specific [DynamicKey](https://github.com/VictorAlbertos/RxCache/blob/2.x/runtime/src/main/java/io/rx_cache2/DynamicKey.java).
* [EvictDynamicKeyGroup](https://github.com/VictorAlbertos/RxCache/blob/2.x/core/src/main/java/io/rx_cache2/EvictDynamicKeyGroup.java) allows to explicitly evict the data of an specific [DynamicKeyGroup](https://github.com/VictorAlbertos/RxCache/blob/2.x/runtime/src/main/java/io/rx_cache2/DynamicKeyGroup.java).
* [DynamicKey](https://github.com/VictorAlbertos/RxCache/blob/2.x/runtime/src/main/java/io/rx_cache2/DynamicKey.java) is a wrapper around the key object for those providers which need to handle multiple records, so they need to provide multiple keys, such us endpoints with pagination, ordering or filtering requirements. To evict the data associated with one particular key use `EvictDynamicKey`.
* [DynamicKeyGroup](https://github.com/VictorAlbertos/RxCache/blob/2.x/runtime/src/main/java/io/rx_cache2/DynamicKeyGroup.java) is a wrapper around the key and the group for those providers which need to handle multiple records grouped, so they need to provide multiple keys organized in groups, such us endpoints with filtering AND pagination requirements. To evict the data associated with the key of one particular group, use `EvictDynamicKeyGroup`.

Supported annotations:

* [@LifeCache](https://github.com/VictorAlbertos/RxCache/blob/master/runtime/src/main/java/io/rx_cache/LifeCache.java) sets the amount of time before the data would be evicted. If `@LifeCache` is not supplied, the data will be never evicted unless it is required explicitly using [EvictProvider](https://github.com/VictorAlbertos/RxCache/blob/master/core/src/main/java/io/rx_cache/EvictProvider.java), [EvictDynamicKey](https://github.com/VictorAlbertos/RxCache/blob/master/core/src/main/java/io/rx_cache/EvictDynamicKey.java) or [EvictDynamicKeyGroup](https://github.com/VictorAlbertos/RxCache/blob/master/core/src/main/java/io/rx_cache/EvictDynamicKeyGroup.java) .
* [@Actionable](https://github.com/VictorAlbertos/RxCache/blob/master/runtime/src/main/java/io/rx_cache/Actionable.java) offers an easy way to perform write operations using providers. More details [here](#actionable_section)
* [@SchemeMigration](https://github.com/VictorAlbertos/RxCache/blob/master/runtime/src/main/java/io/rx_cache/SchemeMigration.java) and [@Migration](https://github.com/VictorAlbertos/RxCache/blob/master/runtime/src/main/java/io/rx_cache/Migration.java) provides a simple mechanism for handling migrations between releases. More details [here](#migrations_section)
* [@Expirable](https://github.com/VictorAlbertos/RxCache/blob/master/runtime/src/main/java/io/rx_cache/Expirable.java) determines if that provider will be excluded from the evicting process or not. More details [here](#expirable_section)
* [@EncryptKey](https://github.com/VictorAlbertos/RxCache/blob/master/runtime/src/main/java/io/rx_cache/EncryptKey.java) and [@Encrypt](https://github.com/VictorAlbertos/RxCache/blob/master/runtime/src/main/java/io/rx_cache/Encrypt.java) provides a simple way to encrypt/decrypt the data on persistence layer. More details [here](#encryption_section)
* [@LifeCache](https://github.com/VictorAlbertos/RxCache/blob/2.x/runtime/src/main/java/io/rx_cache2/LifeCache.java) sets the amount of time before the data would be evicted. If `@LifeCache` is not supplied, the data will be never evicted unless it is required explicitly using [EvictProvider](https://github.com/VictorAlbertos/RxCache/blob/2.x/core/src/main/java/io/rx_cache2/EvictProvider.java), [EvictDynamicKey](https://github.com/VictorAlbertos/RxCache/blob/2.x/core/src/main/java/io/rx_cache2/EvictDynamicKey.java) or [EvictDynamicKeyGroup](https://github.com/VictorAlbertos/RxCache/blob/2.x/core/src/main/java/io/rx_cache2/EvictDynamicKeyGroup.java) .
* [@Actionable](https://github.com/VictorAlbertos/RxCache/blob/2.x/runtime/src/main/java/io/rx_cache2/Actionable.java) offers an easy way to perform write operations using providers. More details [here](#actionable_section)
* [@SchemeMigration](https://github.com/VictorAlbertos/RxCache/blob/2.x/runtime/src/main/java/io/rx_cache2/SchemeMigration.java) and [@Migration](https://github.com/VictorAlbertos/RxCache/blob/2.x/runtime/src/main/java/io/rx_cache2/Migration.java) provides a simple mechanism for handling migrations between releases. More details [here](#migrations_section)
* [@Expirable](https://github.com/VictorAlbertos/RxCache/blob/2.x/runtime/src/main/java/io/rx_cache2/Expirable.java) determines if that provider will be excluded from the evicting process or not. More details [here](#expirable_section)
* [@EncryptKey](https://github.com/VictorAlbertos/RxCache/blob/2.x/runtime/src/main/java/io/rx_cache2/EncryptKey.java) and [@Encrypt](https://github.com/VictorAlbertos/RxCache/blob/2.x/runtime/src/main/java/io/rx_cache2/Encrypt.java) provides a simple way to encrypt/decrypt the data on persistence layer. More details [here](#encryption_section)

### Build an instance of Providers and use it

Expand Down Expand Up @@ -257,7 +257,7 @@ Nevertheless, there are complete examples for [Android and Java projects](https:

**Limitation: This actionable API only support `Observable` as Reactive type.**

This actionable api offers an easy way to perform write operations using providers. Although write operations could be achieved using the classic api too, it's much complex and error-prone. Indeed, the [Actions](https://github.com/VictorAlbertos/RxCache/blob/master/runtime/src/main/java/io/rx_cache/ActionsList.java) class it's a wrapper around the classic api which play with evicting scopes and lists.
This actionable api offers an easy way to perform write operations using providers. Although write operations could be achieved using the classic api too, it's much complex and error-prone. Indeed, the [Actions](https://github.com/VictorAlbertos/RxCache/blob/2.x/runtime/src/main/java/io/rx_cache2/ActionsList.java) class it's a wrapper around the classic api which play with evicting scopes and lists.

In order to use this actionable api, first you need to add the [repository compiler](https://github.com/VictorAlbertos/RxCache/tree/master/compiler) as a dependency to your project using an annotation processor. For Android, it would be as follows:

Expand All @@ -282,7 +282,7 @@ dependencies {
}
```

After this configuration, every provider annotated with [@Actionable](https://github.com/VictorAlbertos/RxCache/blob/master/runtime/src/main/java/io/rx_cache/Actionable.java) `annotation`
After this configuration, every provider annotated with [@Actionable](https://github.com/VictorAlbertos/RxCache/blob/2.x/runtime/src/main/java/io/rx_cache2/Actionable.java) `annotation`
will expose an accessor method in a new generated class called with the same name as the interface, but appending an 'Actionable' suffix.

The order in the params supplies must be as in the following example:
Expand All @@ -309,7 +309,7 @@ RxProvidersActionable.mocksDynamicKey(RxProviders proxy, DynamicKey dynamicKey);
RxProvidersActionable.mocksDynamicKeyGroup(RxProviders proxy, DynamicKeyGroup dynamicKeyGroup);
```

These methods return an instance of the `Actions` class, so now you are ready to use every write operation available in the [Actions](https://github.com/VictorAlbertos/RxCache/blob/master/runtime/src/main/java/io/rx_cache/ActionsList.java) class. It is advisable to explore the [ActionsTest](https://github.com/VictorAlbertos/RxCache/blob/master/runtime/src/test/java/io/rx_cache/internal/ActionsListTest.java) class to see what action fits better for your case. If you feel that some action has been missed please don't hesitate to open an issue to request it.
These methods return an instance of the `Actions` class, so now you are ready to use every write operation available in the [Actions](https://github.com/VictorAlbertos/RxCache/blob/2.x/runtime/src/main/java/io/rx_cache2/ActionsList.java) class. It is advisable to explore the [ActionsTest](https://github.com/VictorAlbertos/RxCache/blob/master/runtime/src/test/java/io/rx_cache/internal/ActionsListTest.java) class to see what action fits better for your case. If you feel that some action has been missed please don't hesitate to open an issue to request it.

Some actions examples:

Expand Down Expand Up @@ -350,7 +350,7 @@ Every one of the previous actions will be execute only after the composed observ

RxCache provides a simple mechanism for handling migrations between releases.

You need to annotate your providers `interface` with [@SchemeMigration](https://github.com/VictorAlbertos/RxCache/blob/master/runtime/src/main/java/io/rx_cache/SchemeMigration.java). This `annotation` accepts an array of [@Migration](https://github.com/VictorAlbertos/RxCache/blob/master/runtime/src/main/java/io/rx_cache/Migration.java) annotations, and, in turn, `@Migration` annotation accepts both, a version number and an array of `Class`es which will be deleted from persistence layer.
You need to annotate your providers `interface` with [@SchemeMigration](https://github.com/VictorAlbertos/RxCache/blob/2.x/runtime/src/main/java/io/rx_cache2/SchemeMigration.java). This `annotation` accepts an array of [@Migration](https://github.com/VictorAlbertos/RxCache/blob/2.x/runtime/src/main/java/io/rx_cache2/Migration.java) annotations, and, in turn, `@Migration` annotation accepts both, a version number and an array of `Class`es which will be deleted from persistence layer.

```java
@SchemeMigration({
Expand Down Expand Up @@ -392,9 +392,9 @@ Because RxCache has an internal process to clean memory when it is required, the

RxCache provides a simple mechanism to encrypt the data.

You need to annotate your providers `interface` with [@EncryptKey](https://github.com/VictorAlbertos/RxCache/blob/master/runtime/src/main/java/io/rx_cache/EncryptKey.java). This `annotation` accepts a string as the `key` necessary to encrypt/decrypt the data. But you will need to annotate your provider's records with [@Encrypt](https://github.com/VictorAlbertos/RxCache/blob/master/runtime/src/main/java/io/rx_cache/Encrypt.java) in order to saved the data encrypted. If no [@Encrypt](https://github.com/VictorAlbertos/RxCache/blob/master/runtime/src/main/java/io/rx_cache/Encrypt.java) is set, then no encryption will be held.
You need to annotate your providers `interface` with [@EncryptKey](https://github.com/VictorAlbertos/RxCache/blob/2.x/runtime/src/main/java/io/rx_cache2/EncryptKey.java). This `annotation` accepts a string as the `key` necessary to encrypt/decrypt the data. But you will need to annotate your provider's records with [@Encrypt](https://github.com/VictorAlbertos/RxCache/blob/2.x/runtime/src/main/java/io/rx_cache2/Encrypt.java) in order to saved the data encrypted. If no [@Encrypt](https://github.com/VictorAlbertos/RxCache/blob/2.x/runtime/src/main/java/io/rx_cache2/Encrypt.java) is set, then no encryption will be held.

**Important:** If the value of the `key` supplied on [@EncryptKey](https://github.com/VictorAlbertos/RxCache/blob/master/runtime/src/main/java/io/rx_cache/EncryptKey.java) is modified between compilations, then the previous persisted data will not be able to be evicted/retrieved by RxCache.
**Important:** If the value of the `key` supplied on [@EncryptKey](https://github.com/VictorAlbertos/RxCache/blob/2.x/runtime/src/main/java/io/rx_cache2/EncryptKey.java) is modified between compilations, then the previous persisted data will not be able to be evicted/retrieved by RxCache.

```java
@EncryptKey("myStrongKey-1234")
Expand Down Expand Up @@ -425,7 +425,7 @@ This limit ensure that the disk will no grow up limitless in case you have provi

When this limit is reached, RxCache will not be able to persist in disk new data. That's why RxCache has an automated process to evict any record when the threshold memory assigned to the persistence layer is close to be reached, even if the record life time has not been fulfilled.

But provider's record annotated with [@Expirable](https://github.com/VictorAlbertos/RxCache/blob/master/runtime/src/main/java/io/rx_cache/Expirable.java) annotation and set its value to false will be excluded from the process.
But provider's record annotated with [@Expirable](https://github.com/VictorAlbertos/RxCache/blob/2.x/runtime/src/main/java/io/rx_cache2/Expirable.java) annotation and set its value to false will be excluded from the process.

```java
interface Providers {
Expand Down
Loading

0 comments on commit 05a6c34

Please sign in to comment.