This is an automated email from the ASF dual-hosted git repository.
joergrade pushed a commit to branch ISIS-2505_Catch_Up_With_Demo_Examples
in repository https://gitbox.apache.org/repos/asf/isis.git
The following commit(s) were added to
refs/heads/ISIS-2505_Catch_Up_With_Demo_Examples by this push:
new 5454224 ISIS-2838 RequestProxy introduced as Facade for
RoXmlHttpRequest
5454224 is described below
commit 545422426169048e9b5e39c93bfb523647488ceb
Author: Jörg Rade <[email protected]>
AuthorDate: Mon Aug 16 10:06:29 2021 +0200
ISIS-2838 RequestProxy introduced as Facade for RoXmlHttpRequest
---
.../kroviz/core/aggregator/BaseAggregator.kt | 4 +-
.../kroviz/core/aggregator/CollectionAggregator.kt | 6 +--
.../kroviz/core/aggregator/ObjectAggregator.kt | 4 +-
.../isis/client/kroviz/core/event/RequestProxy.kt | 60 ++++++++++++++++++++++
.../client/kroviz/core/event/RoXmlHttpRequest.kt | 34 ++----------
.../isis/client/kroviz/core/model/ObjectDM.kt | 6 +--
.../isis/client/kroviz/ui/core/MenuFactory.kt | 12 ++---
.../apache/isis/client/kroviz/ui/dialog/Command.kt | 4 +-
.../isis/client/kroviz/ui/dialog/SvgInline.kt | 4 +-
.../client/kroviz/ui/panel/DynamicMenuBuilder.kt | 4 +-
.../apache/isis/client/kroviz/utils/UmlUtils.kt | 3 +-
.../isis/client/kroviz/handler/IconHandlerTest.kt | 4 +-
.../org/apache/isis/client/kroviz/to/ActionTest.kt | 4 +-
13 files changed, 91 insertions(+), 58 deletions(-)
diff --git
a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/BaseAggregator.kt
b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/BaseAggregator.kt
index bb129dc..1e3c1b1 100644
---
a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/BaseAggregator.kt
+++
b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/BaseAggregator.kt
@@ -19,7 +19,7 @@
package org.apache.isis.client.kroviz.core.aggregator
import org.apache.isis.client.kroviz.core.event.LogEntry
-import org.apache.isis.client.kroviz.core.event.RoXmlHttpRequest
+import org.apache.isis.client.kroviz.core.event.RequestProxy
import org.apache.isis.client.kroviz.core.model.DisplayModel
import org.apache.isis.client.kroviz.to.Link
import org.apache.isis.client.kroviz.to.TObject
@@ -83,7 +83,7 @@ abstract class BaseAggregator {
}
protected fun invoke(link: Link, aggregator: BaseAggregator, subType:
String = Constants.subTypeJson) {
- RoXmlHttpRequest().invoke(link, aggregator, subType)
+ RequestProxy().invoke(link, aggregator, subType)
}
}
diff --git
a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/CollectionAggregator.kt
b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/CollectionAggregator.kt
index a98be8e..84b11d4 100644
---
a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/CollectionAggregator.kt
+++
b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/CollectionAggregator.kt
@@ -20,7 +20,7 @@ package org.apache.isis.client.kroviz.core.aggregator
import org.apache.isis.client.kroviz.core.event.EventState
import org.apache.isis.client.kroviz.core.event.LogEntry
-import org.apache.isis.client.kroviz.core.event.RoXmlHttpRequest
+import org.apache.isis.client.kroviz.core.event.RequestProxy
import org.apache.isis.client.kroviz.core.model.CollectionDM
import org.apache.isis.client.kroviz.layout.Layout
import org.apache.isis.client.kroviz.to.*
@@ -123,11 +123,11 @@ class CollectionAggregator(actionTitle: String, val
parent: ObjectAggregator? =
private fun handleCollection(collection: Collection) {
collection.links.forEach {
if (it.relation() == Relation.DESCRIBED_BY) {
- RoXmlHttpRequest().invoke(it, this)
+ RequestProxy().invoke(it, this)
}
}
collection.value.forEach {
- RoXmlHttpRequest().invoke(it, this)
+ RequestProxy().invoke(it, this)
}
}
diff --git
a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/ObjectAggregator.kt
b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/ObjectAggregator.kt
index 3afce91..06e1161 100644
---
a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/ObjectAggregator.kt
+++
b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/ObjectAggregator.kt
@@ -19,7 +19,7 @@
package org.apache.isis.client.kroviz.core.aggregator
import org.apache.isis.client.kroviz.core.event.LogEntry
-import org.apache.isis.client.kroviz.core.event.RoXmlHttpRequest
+import org.apache.isis.client.kroviz.core.event.RequestProxy
import org.apache.isis.client.kroviz.core.model.CollectionDM
import org.apache.isis.client.kroviz.core.model.ObjectDM
import org.apache.isis.client.kroviz.layout.Layout
@@ -106,7 +106,7 @@ class ObjectAggregator(val actionTitle: String) :
AggregatorWithLayout() {
val aggregator = CollectionAggregator(key, this)
collectionMap.put(key, aggregator)
val link = it.links.first()
- RoXmlHttpRequest().invoke(link, aggregator)
+ RequestProxy().invoke(link, aggregator)
}
}
diff --git
a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/RequestProxy.kt
b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/RequestProxy.kt
new file mode 100644
index 0000000..ad46106
--- /dev/null
+++
b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/RequestProxy.kt
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.client.kroviz.core.event
+
+import org.apache.isis.client.kroviz.core.aggregator.BaseAggregator
+import org.apache.isis.client.kroviz.handler.ResponseHandler
+import org.apache.isis.client.kroviz.to.Link
+import org.apache.isis.client.kroviz.ui.core.Constants
+
+/**
+ * Facade for RoXmlHttpRequest. If a request is being issued, it:
+ *
+ * * looks in EventStore, if a (similar) request has been issued before and
can be retrieved from local storage, and if
+ * 1. No: issue the real request and handle the response via ResponseHandler
(chain)
+ * 2. Yes: use the cached response and pass it directly to the respective
Aggregator/Dispatcher
+ *
+ */
+class RequestProxy {
+
+ fun invoke(link: Link, aggregator: BaseAggregator? = null, subType: String
= Constants.subTypeJson) {
+ val rs = ResourceSpecification(link.href)
+ when {
+ EventStore.isCached(rs, link.method) -> processCached(rs)
+ else -> RoXmlHttpRequest().process(link, aggregator, subType)
+ }
+ }
+
+ private fun processCached(rs: ResourceSpecification) {
+ val le = EventStore.findBy(rs)!!
+ le.retrieveResponse()
+ ResponseHandler.handle(le)
+ EventStore.cached(rs)
+ }
+
+ fun invokeNonREST(link: Link, aggregator: BaseAggregator?, subType: String
= Constants.subTypeXml) {
+ val rs = ResourceSpecification(link.href)
+ when {
+ EventStore.isCached(rs, link.method) -> processCached(rs)
+ else -> RoXmlHttpRequest().processNonREST(link, aggregator,
subType)
+ }
+ }
+
+
+}
diff --git
a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/RoXmlHttpRequest.kt
b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/RoXmlHttpRequest.kt
index 16c0d29..2d8009c 100644
---
a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/RoXmlHttpRequest.kt
+++
b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/RoXmlHttpRequest.kt
@@ -39,27 +39,7 @@ class RoXmlHttpRequest {
private val CONTENT_TYPE = "Content-Type"
private val ACCEPT = "Accept"
- fun invoke(link: Link, aggregator: BaseAggregator? = null, subType: String
= Constants.subTypeJson) {
- val rs = ResourceSpecification(link.href)
- when {
- EventStore.isCached(rs, link.method) -> processCached(rs)
- else -> process(link, aggregator, subType)
- }
- }
-
- private fun processCached(rs: ResourceSpecification) {
- val le = EventStore.findBy(rs)!!
- le.retrieveResponse()
- getHandlerChain().handle(le)
- EventStore.cached(rs)
- }
-
- // encapsulate implementation (Singleton vs. Object vs. Pool)
- private fun getHandlerChain(): ResponseHandler {
- return ResponseHandler
- }
-
- private fun process(link: Link, aggregator: BaseAggregator?, subType:
String) {
+ internal fun process(link: Link, aggregator: BaseAggregator?, subType:
String) {
val method = link.method
var url = link.href
if (method != Method.POST.operation) {
@@ -100,15 +80,7 @@ class RoXmlHttpRequest {
}
}
- fun invokeNonREST(link: Link, aggregator: BaseAggregator?, subType: String
= Constants.subTypeXml) {
- val rs = ResourceSpecification(link.href)
- when {
- EventStore.isCached(rs, link.method) -> processCached(rs)
- else -> processNonREST(link, aggregator, subType)
- }
- }
-
- private fun processNonREST(link: Link, aggregator: BaseAggregator?,
subType: String) {
+ internal fun processNonREST(link: Link, aggregator: BaseAggregator?,
subType: String) {
val method = link.method
val url = link.href
@@ -154,7 +126,7 @@ class RoXmlHttpRequest {
private fun handleResult(rs: ResourceSpecification, body: String, xhr:
XMLHttpRequest) {
val response:Any? = xhr.response
val logEntry: LogEntry? = EventStore.end(rs, body, response)
- if (logEntry != null) getHandlerChain().handle(logEntry)
+ if (logEntry != null) ResponseHandler.handle(logEntry)
}
private fun handleError(rs: ResourceSpecification, xhr: XMLHttpRequest) {
diff --git
a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/model/ObjectDM.kt
b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/model/ObjectDM.kt
index d17cddd..74040c3 100644
---
a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/model/ObjectDM.kt
+++
b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/model/ObjectDM.kt
@@ -19,8 +19,8 @@
package org.apache.isis.client.kroviz.core.model
import org.apache.isis.client.kroviz.core.event.EventStore.findBy
+import org.apache.isis.client.kroviz.core.event.RequestProxy
import org.apache.isis.client.kroviz.core.event.ResourceSpecification
-import org.apache.isis.client.kroviz.core.event.RoXmlHttpRequest
import org.apache.isis.client.kroviz.to.*
class ObjectDM(override val title: String) : DisplayModelWithLayout() {
@@ -78,9 +78,9 @@ class ObjectDM(override val title: String) :
DisplayModelWithLayout() {
val aggregator = logEntry?.getAggregator()!!
// there may be more than one aggt - which may break this code
- RoXmlHttpRequest().invoke(putLink, aggregator)
+ RequestProxy().invoke(putLink, aggregator)
// now data should be reloaded
- RoXmlHttpRequest().invoke(getLink, aggregator)
+ RequestProxy().invoke(getLink, aggregator)
}
}
diff --git
a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/MenuFactory.kt
b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/MenuFactory.kt
index e1489cb..653a1bc 100644
---
a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/MenuFactory.kt
+++
b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/MenuFactory.kt
@@ -24,7 +24,7 @@ import io.kvision.dropdown.separator
import io.kvision.html.ButtonStyle
import io.kvision.utils.set
import org.apache.isis.client.kroviz.core.event.EventStore
-import org.apache.isis.client.kroviz.core.event.RoXmlHttpRequest
+import org.apache.isis.client.kroviz.core.event.RequestProxy
import org.apache.isis.client.kroviz.to.Link
import org.apache.isis.client.kroviz.to.TObject
import org.apache.isis.client.kroviz.to.mb.Menu
@@ -52,7 +52,7 @@ object MenuFactory {
val link = buildActionLink(it.id, text)
val invokeLink = it.getInvokeLink()!!
link.onClick {
- RoXmlHttpRequest().invoke(invokeLink)
+ RequestProxy().invoke(invokeLink)
}
dd.add(link)
}
@@ -77,7 +77,7 @@ object MenuFactory {
section.serviceAction.forEach { sa ->
val action = buildActionLink(sa.id!!, menuTitle)
action.onClick {
- RoXmlHttpRequest().invoke(sa.link!!)
+ RequestProxy().invoke(sa.link!!)
}
action.setDragDropData(Constants.stdMimeType, action.id!!)
dd.add(action)
@@ -120,7 +120,7 @@ object MenuFactory {
val action = buildActionLink(sa.id, menuTitle)
action.label = ""
action.onClick {
- RoXmlHttpRequest().invoke(sa.link!!)
+ RequestProxy().invoke(sa.link!!)
}
return action
}
@@ -172,7 +172,7 @@ object MenuFactory {
label = "save",
menuTitle = tObject.domainType)
saveAction.onClick {
- RoXmlHttpRequest().invoke(saveLink)
+ RequestProxy().invoke(saveLink)
}
dd.add(saveAction)
@@ -181,7 +181,7 @@ object MenuFactory {
label = "undo",
menuTitle = tObject.domainType)
undoAction.onClick {
- RoXmlHttpRequest().invoke(undoLink)
+ RequestProxy().invoke(undoLink)
}
dd.add(undoAction)
}
diff --git
a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/Command.kt
b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/Command.kt
index a315cef..393286e 100644
---
a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/Command.kt
+++
b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/Command.kt
@@ -19,7 +19,7 @@
package org.apache.isis.client.kroviz.ui.dialog
import org.apache.isis.client.kroviz.core.aggregator.ActionDispatcher
-import org.apache.isis.client.kroviz.core.event.RoXmlHttpRequest
+import org.apache.isis.client.kroviz.core.event.RequestProxy
import org.apache.isis.client.kroviz.to.Link
abstract class Command {
@@ -29,7 +29,7 @@ abstract class Command {
}
fun invoke(link: Link) {
- RoXmlHttpRequest().invoke(link, ActionDispatcher())
+ RequestProxy().invoke(link, ActionDispatcher())
}
}
diff --git
a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/SvgInline.kt
b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/SvgInline.kt
index a5ac6ca..4e06358 100644
---
a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/SvgInline.kt
+++
b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/SvgInline.kt
@@ -20,7 +20,7 @@
package org.apache.isis.client.kroviz.ui.dialog
import org.apache.isis.client.kroviz.core.aggregator.SvgDispatcher
-import org.apache.isis.client.kroviz.core.event.RoXmlHttpRequest
+import org.apache.isis.client.kroviz.core.event.RequestProxy
import org.apache.isis.client.kroviz.to.Link
import org.apache.isis.client.kroviz.to.Method
import org.apache.isis.client.kroviz.to.ValueType
@@ -52,7 +52,7 @@ class SvgInline : Command() {
val url =
"https://upload.wikimedia.org/wikipedia/commons/6/6c/Trajans-Column-lower-animated.svg"
val link = Link(href = url, method = Method.GET.operation)
val agr = SvgDispatcher(callBack)
- RoXmlHttpRequest().invokeNonREST(link, agr)
+ RequestProxy().invokeNonREST(link, agr)
}
}
diff --git
a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/DynamicMenuBuilder.kt
b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/DynamicMenuBuilder.kt
index f4d70c1..1d7c753 100644
---
a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/DynamicMenuBuilder.kt
+++
b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/DynamicMenuBuilder.kt
@@ -21,7 +21,7 @@ package org.apache.isis.client.kroviz.ui.panel
import io.kvision.utils.obj
import org.apache.isis.client.kroviz.core.event.EventStore
-import org.apache.isis.client.kroviz.core.event.RoXmlHttpRequest
+import org.apache.isis.client.kroviz.core.event.RequestProxy
import org.apache.isis.client.kroviz.to.TObject
import org.apache.isis.client.kroviz.ui.chart.ChartFactory
import org.apache.isis.client.kroviz.ui.core.UiManager
@@ -43,7 +43,7 @@ class DynamicMenuBuilder {
val title = StringUtils.deCamel(it.id)
val icon = IconManager.find(title)
val invokeLink = it.getInvokeLink()!!
- val command = { RoXmlHttpRequest().invoke(invokeLink) }
+ val command = { RequestProxy().invoke(invokeLink) }
val me = buildMenuEntry(icon, title, command)
menu.add(me)
}
diff --git
a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/UmlUtils.kt
b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/UmlUtils.kt
index 6841bf6..d63dad5 100644
---
a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/UmlUtils.kt
+++
b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/UmlUtils.kt
@@ -19,6 +19,7 @@
package org.apache.isis.client.kroviz.utils
import org.apache.isis.client.kroviz.core.aggregator.SvgDispatcher
+import org.apache.isis.client.kroviz.core.event.RequestProxy
import org.apache.isis.client.kroviz.core.event.RoXmlHttpRequest
import org.apache.isis.client.kroviz.to.Argument
import org.apache.isis.client.kroviz.to.Link
@@ -39,7 +40,7 @@ object UmlUtils {
val link = Link(href = Constants.krokiUrl, method =
Method.POST.operation, args = args)
val agr = SvgDispatcher(callBack)
- RoXmlHttpRequest().invokeNonREST(link, agr)
+ RequestProxy().invokeNonREST(link, agr)
}
fun generateJsonDiagram(pumlCode: String, callBack: Any) {
diff --git
a/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/handler/IconHandlerTest.kt
b/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/handler/IconHandlerTest.kt
index 690b176..fc99b9f 100644
---
a/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/handler/IconHandlerTest.kt
+++
b/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/handler/IconHandlerTest.kt
@@ -23,7 +23,7 @@ import io.kvision.html.Image
import kotlinx.browser.window
import org.apache.isis.client.kroviz.IntegrationTest
import org.apache.isis.client.kroviz.core.aggregator.DispatchInterceptor
-import org.apache.isis.client.kroviz.core.event.RoXmlHttpRequest
+import org.apache.isis.client.kroviz.core.event.RequestProxy
import org.apache.isis.client.kroviz.snapshots.demo2_0_0.OBJECT_ICON
import org.apache.isis.client.kroviz.to.Icon
import org.apache.isis.client.kroviz.to.Link
@@ -42,7 +42,7 @@ class IconHandlerTest : IntegrationTest() {
//given
val link = Link(href = OBJECT_ICON.url)
val di = DispatchInterceptor()
- RoXmlHttpRequest().invoke(link, di)
+ RequestProxy().invoke(link, di)
wait(1000)
val logEntry = di.logEntry!!
diff --git
a/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/to/ActionTest.kt
b/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/to/ActionTest.kt
index 9dc0c4a..c20e5e8 100644
---
a/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/to/ActionTest.kt
+++
b/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/to/ActionTest.kt
@@ -21,8 +21,8 @@ package org.apache.isis.client.kroviz.to
import org.apache.isis.client.kroviz.IntegrationTest
import org.apache.isis.client.kroviz.core.aggregator.ActionDispatcher
import org.apache.isis.client.kroviz.core.event.EventStore
+import org.apache.isis.client.kroviz.core.event.RequestProxy
import org.apache.isis.client.kroviz.core.event.ResourceSpecification
-import org.apache.isis.client.kroviz.core.event.RoXmlHttpRequest
import org.apache.isis.client.kroviz.handler.ActionHandler
import org.apache.isis.client.kroviz.snapshots.simpleapp1_16_0.*
import org.apache.isis.client.kroviz.utils.StringUtils
@@ -62,7 +62,7 @@ class ActionTest : IntegrationTest() {
console.log(body)
val json = JSON.parse<Argument>(body)
console.log(json)
- RoXmlHttpRequest().invoke(link, ActionDispatcher())
+ RequestProxy().invoke(link, ActionDispatcher())
val urlSpec = ResourceSpecification(url)
val le = EventStore.findBy(urlSpec)!!
console.log(EventStore.log)