diff --git a/storage/rest/service-sparkjava/README.md b/storage/rest/service-sparkjava/README.md index 19e31f0c4..7deac5a86 100644 --- a/storage/rest/service-sparkjava/README.md +++ b/storage/rest/service-sparkjava/README.md @@ -5,20 +5,20 @@ sparkjava# Storage Viewer HowTo: - [Usage](#2-usage) - [Example](#3-example) - [Routes](#4-available-routes) - - [typeDictionary](#4-1-typedictionary) - - [object](#4-2-object) - - [root](#4-3-root) - - [filesStatistics](#4-4-filesstatistics) + - [typeDictionary](#41-typedictionary) + - [object](#42-object) + - [root](#43-root) + - [filesStatistics](#44-filesstatistics) - [Configuration](#5-configuration) - - [Server](#5-1-server) - - [URL](#5-1-1-url-root) - - [port](#5-1-2-port) - - [Logging](#5-2-logging) + - [Server](#51-server) + - [URL](#511-url-root) + - [port](#512-port) + - [Logging](#52-logging) ## 1. Setup: ### Maven Dependencies -``` +```xml one.microstream microstream-storage-restservice-sparkjava @@ -34,7 +34,7 @@ one.microstream.storage.restservice.types.StorageRestService ## 2. Usage ### 2.1. Start the Microstream storage as usual: -``` +```java EmbeddedStorageManager storage = EmbeddedStorage .Foundation(storageDir) .start(); @@ -44,19 +44,19 @@ EmbeddedStorageManager storage = EmbeddedStorage - Start the server By default the server will listen on port 4567 -``` +```java final StorageRestService service = RestServiceResolver.getType(storage, StorageRestServiceSparkJava.class); service.start(); ``` ### 2.3 Stoping the viewer server -``` +```java service.stop(); ``` the EmbeddedStorageManager will not be stopped. ## 3. Example -``` +```java public class MainTestStorageRestService { public static void main(final String[] args) @@ -81,7 +81,7 @@ public class MainTestStorageRestService /[InstanceName]/ dictionary Get the typeDictionary as String ``` -http://localhost:4567/microstream/dictionary" +http://localhost:4567/microstream/dictionary ``` ### 4.2 Object @@ -134,15 +134,15 @@ optional, default is default is java.lang.Long.MAX_VALUE \ limit the number of returned resolved references to supplied count.\ requires “references=true” -### 4.3. Root -/[InstanceName]/root +### 4.3. Root +`/[InstanceName]/root` Get Name and object ID of the current storage root element ``` http://localhost:4567/microstream/root ``` ### 4.4. FilesStatistics -/[InstanceName]/maintenance/filesStatistics +`/[InstanceName]/maintenance/filesStatistics` Get some statistics about the used storage files ``` http://localhost:4567/microstream/maintenance/filesStatistics @@ -154,7 +154,7 @@ The Storage viewer uses the Spark micro framework from http://sparkjava.com/ as To provide a custom configured server just create an Spark.service and initialize the StorageRestService with this Spark.service -``` +```java final Service service = Service.ignite().port(port); final StorageRestServiceSparkJava service = RestServiceResolver.getType(storage, StorageRestServiceSparkJava.class); service.setSparkService(sparkService); @@ -162,29 +162,27 @@ service.start(); ``` #### 5.1.1 Url Root -To set an other url root then 'microstream' use the constructor: +To set another url root then 'microstream' use the constructor: -``` +```java final StorageRestServiceSparkJava service = RestServiceResolver.getType(storage, StorageRestServiceSparkJava.class); service.setInstanceName(storageName); service.start(); - ``` #### 5.1.2 Port -To set an other port then the default port 4567 it is required to provide a custom configured Spark Server session to the StorageRestService constructor: +To set another port then the default port 4567 it is required to provide a custom configured Spark Server session to the StorageRestService constructor: -``` +```java final Service service = Service.ignite().port(port); final StorageRestServiceSparkJava service = RestServiceResolver.getType(storage, StorageRestServiceSparkJava.class); service.setSparkService(sparkService); service.start(); - ``` ### 5.2 Logging To enable logging add the following dependency to the project: -``` +```xml org.slf4j slf4j-simple