Skip to content

Commit

Permalink
fix: refactor service classes to be in correct package to reduce visi…
Browse files Browse the repository at this point in the history
…bility
  • Loading branch information
cake-lier committed Jul 28, 2023
1 parent 44a6987 commit 9f7fd45
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 44 deletions.
8 changes: 4 additions & 4 deletions src/main/scala/tuples/space/client/JsonTupleSpace.scala
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ import io.circe.parser.*
import io.circe.syntax.*

import tuples.space.*
import tuples.space.request.*
import tuples.space.request.RequestSerializer.given
import tuples.space.response.*
import tuples.space.response.ResponseDeserializer.given
import tuples.space.client.request.*
import request.RequestSerializer.given
import tuples.space.client.response.*
import response.ResponseDeserializer.given
import AnyOps.*

/** A coordination medium to be used to exchange pieces of information and coordinate with other entities, implemented to be used
Expand Down
11 changes: 4 additions & 7 deletions src/main/scala/tuples/space/client/request/Request.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,14 @@
*/

package io.github.cakelier
package tuples.space.request
package tuples.space.client.request

import java.util.UUID
import tuples.space.*

import io.circe.Decoder
import io.circe.DecodingFailure
import io.circe.Encoder
import io.circe.Json
import io.circe.syntax.*
import io.circe.{Decoder, DecodingFailure, Encoder, Json}

import tuples.space.*
import java.util.UUID

/** A request that a [[io.github.cakelier.tuples.space.client.JsonTupleSpace]] can make to its server.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@
*/

package io.github.cakelier
package tuples.space.request

import io.circe.Encoder
import io.circe.Json
import io.circe.syntax.*
package tuples.space.client.request

import AnyOps.*
import tuples.space.*
import tuples.space.JsonSerializable.given
import AnyOps.*

import io.circe.{Encoder, Json}
import io.circe.syntax.*

/** This object contains all serializers for the [[Request]] sub-types. */
private[client] object RequestSerializer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/

package io.github.cakelier
package tuples.space.request
package tuples.space.client.request

/** The enum representing all the different types of operations that can be carried on using a [[TemplateRequest]]. */
private[client] enum TemplateRequestType {
Expand Down
12 changes: 6 additions & 6 deletions src/main/scala/tuples/space/client/response/Response.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
*/

package io.github.cakelier
package tuples.space.response

import java.util.UUID
package tuples.space.client.response

import tuples.space.*

import java.util.UUID

/** A response that a [[io.github.cakelier.tuples.space.client.JsonTupleSpace]] can receive from its server.
*
* This trait represents a generic response that a [[io.github.cakelier.tuples.space.client.JsonTupleSpace]] client can receive
Expand All @@ -37,10 +37,10 @@ import tuples.space.*
* client, for example for signalling that the connection has been established with success and a new id is provided to the
* client or that the client wants to use another id instead.
*/
private[response] sealed trait Response
private[client] sealed trait Response

/** Companion object to the [[Response]] trait, containing its implementations. */
private[response] object Response {
private[client] object Response {

/** A [[Response]] which associated request has as content a single [[JsonTuple]].
*
Expand Down Expand Up @@ -325,7 +325,7 @@ private[response] object Response {
* the client will reappear or not. This [[Response]] is sent from the server to confirm just that: the server is telling that
* a client previously connected has now reconnected and its id is now the one given in the previously sent
* [[io.github.cakelier.tuples.space.request.Request]]. This way, the client can regain access to the
* [[io.github.cakelier.tuples.space.response.Response]]s associated to the [[Request]]s placed before the disconnection.
* [[Response]]s associated to the [[Request]]s placed before the disconnection.
*/
sealed trait MergeSuccessResponse extends Response {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,17 @@
*/

package io.github.cakelier
package tuples.space.response

import io.circe.Decoder
import io.circe.DecodingFailure
import io.circe.syntax.*
package tuples.space.client.response

import AnyOps.*
import tuples.space.*
import tuples.space.JsonSerializable.given

import io.circe.{Decoder, DecodingFailure}
import io.circe.syntax.*

/** This object contains all deserializers for the [[Response]] sub-types. */
private[space] object ResponseDeserializer {
private[client] object ResponseDeserializer {

/* The Decoder given instance for the TupleResponse trait. */
private given Decoder[TupleResponse] = c =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
*/

package io.github.cakelier
package tuples.space.response
package tuples.space.client.response

/** The enum representing all the different types of operations that can receive a result using a [[TemplateMaybeTupleResponse]].
*/
private[response] enum TemplateMaybeTupleResponseType {
private[client] enum TemplateMaybeTupleResponseType {

/** The enum instance representing the "inp" operation. */
case Inp extends TemplateMaybeTupleResponseType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
*/

package io.github.cakelier
package tuples.space.response
package tuples.space.client.response

/** The enum representing all the different types of operations that can receive a result using a [[TemplateSeqTupleResponse]]. */
private[response] enum TemplateSeqTupleResponseType {
private[client] enum TemplateSeqTupleResponseType {

/** The enum instance representing the "inAll" operation. */
case InAll extends TemplateSeqTupleResponseType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
*/

package io.github.cakelier
package tuples.space.response
package tuples.space.client.response

/** The enum representing all the different types of operations that can receive a result using a [[TemplateTupleResponse]]. */
private[response] enum TemplateTupleResponseType {
private[client] enum TemplateTupleResponseType {

/** The enum instance representing the "in" operation. */
case In extends TemplateTupleResponseType
Expand Down
9 changes: 4 additions & 5 deletions src/test/scala/tuples/space/client/JsonTupleSpaceTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,11 @@ import org.scalatest.time.Span

import AnyOps.*
import tuples.space.*
import tuples.space.client.request.*
import tuples.space.client.request.RequestDeserializer.given
import tuples.space.client.response.*
import tuples.space.client.response.ResponseSerializer.given
import tuples.space.JsonTuple.JsonNil
import tuples.space.request.*
import tuples.space.request.RequestDeserializer.given
import tuples.space.response.*
import tuples.space.response.Response.{ConnectionSuccessResponse, MergeSuccessResponse}
import tuples.space.response.ResponseSerializer.given

@SuppressWarnings(
Array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@
*/

package io.github.cakelier
package tuples.space.request
package tuples.space.client.request

import io.circe.Decoder
import io.circe.DecodingFailure

import tuples.space.request.*
import tuples.space.{JsonTemplate, JsonTuple}
import tuples.space.JsonSerializable.given
import AnyOps.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/

package io.github.cakelier
package tuples.space.response
package tuples.space.client.response

import io.circe.Encoder
import io.circe.Json
Expand Down

0 comments on commit 9f7fd45

Please sign in to comment.