Skip to content

Commit affc348

Browse files
Added docs for rest-api
1 parent 3ef78ad commit affc348

File tree

4 files changed

+60
-3
lines changed

4 files changed

+60
-3
lines changed

docs/antora.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
name: ROOT
22
title: Spring-Data-Eclipse-Store
33
version: master
4-
display_version: '2.4.0'
4+
display_version: '2.4.1'
55
start_page: index.adoc
66
nav:
77
- modules/ROOT/nav.adoc
88
asciidoc:
99
attributes:
1010
product-name: 'Spring-Data-Eclipse-Store'
11-
display-version: '2.4.0'
12-
maven-version: '2.4.0'
11+
display-version: '2.4.1'
12+
maven-version: '2.4.1'
1313
page-editable: false
1414
page-out-of-support: false

docs/modules/ROOT/nav.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
** xref:features/queries.adoc[Queries]
99
** xref:features/transactions.adoc[Transactions]
1010
** xref:features/versions.adoc[Versions]
11+
** xref:features/rest-api.adoc[REST Interface]
1112
* xref:migration.adoc[Migration from JPA]
1213
* xref:known-issues.adoc[Known issues]

docs/modules/ROOT/pages/features/features.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
* xref:features/queries.adoc[Queries]
66
* xref:features/transactions.adoc[Transactions]
77
* xref:features/versions.adoc[Versions]
8+
* xref:features/rest-api.adoc[REST Interface]
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
= REST Interface
2+
3+
To utilize the https://docs.eclipsestore.io/manual/storage/rest-interface/index.html[REST interface provided by EclipseStore], only a small adjustment is needed.
4+
5+
First add the dependency described in the https://docs.eclipsestore.io/manual/storage/rest-interface/setup.html#_spring_boot_rest_service[EclipseStore documentation]:
6+
7+
[source,xml,subs=attributes+,title="Maven [pom.xml]"]
8+
----
9+
<dependencies>
10+
<dependency>
11+
<groupId>org.eclipse.store</groupId>
12+
<artifactId>storage-restservice-springboot</artifactId>
13+
</dependency>
14+
<dependency>
15+
<groupId>org.springframework.boot</groupId>
16+
<artifactId>spring-boot-starter-web</artifactId>
17+
</dependency>
18+
</dependencies>
19+
----
20+
21+
Next a few adjustments are needed in your configuration:
22+
23+
[source,java,title="https://github.com/xdev-software/spring-data-eclipse-store/blob/develop/spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/complex/ComplexConfiguration.java[Example from complex demo]"]
24+
----
25+
package software.xdev.spring.data.eclipse.store.demo.complex;
26+
27+
//...
28+
import org.eclipse.store.storage.restadapter.types.StorageRestAdapter;
29+
import org.springframework.context.annotation.Bean;
30+
import org.springframework.context.annotation.ComponentScan;
31+
import org.springframework.context.annotation.Configuration;
32+
33+
import software.xdev.spring.data.eclipse.store.repository.config.EclipseStoreClientConfiguration;
34+
import software.xdev.spring.data.eclipse.store.repository.config.EnableEclipseStoreRepositories;
35+
36+
37+
@ComponentScan({"org.eclipse.store.storage.restservice.spring.boot.types.rest"})
38+
@Configuration
39+
@EnableEclipseStoreRepositories
40+
public class ComplexConfiguration extends EclipseStoreClientConfiguration
41+
{
42+
//...
43+
@Bean
44+
@DependsOn({"embeddedStorageFoundationFactory"})
45+
public Map<String, StorageRestAdapter> storageRestAdapters(final Map<String, EmbeddedStorageManager> storages)
46+
{
47+
return Map.of(
48+
"defaultStorageManager", StorageRestAdapter.New(this.storageInstance.getInstanceOfStorageManager())
49+
);
50+
}
51+
//...
52+
----
53+
54+
After that the API is usable just like https://docs.eclipsestore.io/manual/storage/rest-interface/rest-api.html[plain EclipseStore].
55+
The ``instance-name`` in this case would be ``default`` which means, the active URL in the ComplexDemo is ``http://localhost:8080/store-data/default/root``.

0 commit comments

Comments
 (0)