-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add documentation for configuring a StoreResolver
- Loading branch information
1 parent
abfccdd
commit 972059f
Showing
4 changed files
with
37 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
spring-content-rest/src/main/asciidoc/rest-storeresolver.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
== Store Resolver | ||
Every REST request must map to one store and one store only. However, it is entirely possible to define an application | ||
with multiple stores that make this impossible. | ||
|
||
For these situations you need to provide a `StoreResolver` that, based on runtime context, can resolve these conflicts. | ||
|
||
.Configuring a StoreResolver | ||
==== | ||
[source, java] | ||
---- | ||
@Configuration | ||
@EnableS3Stores | ||
public static class ApplicationConfig { | ||
@Bean | ||
public ContentRestConfigurer contentRestConfigurer() { | ||
return new ContentRestConfigurer() { | ||
@Override | ||
public void configure(RestConfiguration config) { | ||
config.addStoreResolver("examples", new StoreResolver() { <1> | ||
@Override | ||
public StoreInfo resolve(StoreInfo... stores) { | ||
/* your resolver implementation */ | ||
} | ||
}); | ||
} | ||
}; | ||
} | ||
} | ||
---- | ||
<1> This store resolver resolves conflicts for stores exported through the path "examples" | ||
==== | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters