From 470953c78c2509224bb452c16f8bbea54e53b3d7 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Mon, 8 Oct 2018 22:11:21 +0200 Subject: Better server class abstraction. --- .../kotlin/pl/treksoft/kvision/remote/Jooby.kt | 37 ---------------------- .../kotlin/pl/treksoft/kvision/remote/KVServer.kt | 37 ++++++++++++++++++++++ .../pl/treksoft/kvision/remote/ServiceManager.kt | 4 +-- 3 files changed, 39 insertions(+), 39 deletions(-) delete mode 100644 kvision-modules/kvision-common/src/main/kotlin/pl/treksoft/kvision/remote/Jooby.kt create mode 100644 kvision-modules/kvision-common/src/main/kotlin/pl/treksoft/kvision/remote/KVServer.kt (limited to 'kvision-modules/kvision-common/src/main/kotlin') diff --git a/kvision-modules/kvision-common/src/main/kotlin/pl/treksoft/kvision/remote/Jooby.kt b/kvision-modules/kvision-common/src/main/kotlin/pl/treksoft/kvision/remote/Jooby.kt deleted file mode 100644 index ec348a25..00000000 --- a/kvision-modules/kvision-common/src/main/kotlin/pl/treksoft/kvision/remote/Jooby.kt +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2017-present Robert Jaros - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -package pl.treksoft.kvision.remote - -/** - * A Jooby based server. - */ -expect open class JoobyServer - -/** - * A server request. - */ -expect interface Request - -/** - * A user profile. - */ -expect class Profile diff --git a/kvision-modules/kvision-common/src/main/kotlin/pl/treksoft/kvision/remote/KVServer.kt b/kvision-modules/kvision-common/src/main/kotlin/pl/treksoft/kvision/remote/KVServer.kt new file mode 100644 index 00000000..cf822e66 --- /dev/null +++ b/kvision-modules/kvision-common/src/main/kotlin/pl/treksoft/kvision/remote/KVServer.kt @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2017-present Robert Jaros + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +package pl.treksoft.kvision.remote + +/** + * A server. + */ +expect open class KVServer + +/** + * A server request. + */ +expect interface Request + +/** + * A user profile. + */ +expect class Profile diff --git a/kvision-modules/kvision-common/src/main/kotlin/pl/treksoft/kvision/remote/ServiceManager.kt b/kvision-modules/kvision-common/src/main/kotlin/pl/treksoft/kvision/remote/ServiceManager.kt index 8225a785..07f60851 100644 --- a/kvision-modules/kvision-common/src/main/kotlin/pl/treksoft/kvision/remote/ServiceManager.kt +++ b/kvision-modules/kvision-common/src/main/kotlin/pl/treksoft/kvision/remote/ServiceManager.kt @@ -128,9 +128,9 @@ expect open class ServiceManager(service: T) { /** * Applies all defined routes to the given server. - * @param k a Jooby server + * @param k a server */ - fun applyRoutes(k: JoobyServer) + fun applyRoutes(k: KVServer) /** * Returns the map of defined paths. -- cgit