-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Simon Dumas
committed
Nov 21, 2024
1 parent
1956c6c
commit 8953ace
Showing
26 changed files
with
449 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...p/src/main/scala/ch/epfl/bluebrain/nexus/delta/provisioning/ProvisioningCoordinator.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package ch.epfl.bluebrain.nexus.delta.provisioning | ||
|
||
import cats.syntax.all._ | ||
import cats.effect.IO | ||
import ch.epfl.bluebrain.nexus.delta.sdk.ProvisioningAction | ||
|
||
trait ProvisioningCoordinator | ||
|
||
object ProvisioningCoordinator extends ProvisioningCoordinator { | ||
|
||
def apply(actions: Vector[ProvisioningAction]): IO[ProvisioningCoordinator] = { | ||
actions.traverse(_.run).as(ProvisioningCoordinator) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
delta/kernel/src/main/scala/ch/epfl/bluebrain/nexus/delta/kernel/error/LoadFileError.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package ch.epfl.bluebrain.nexus.delta.kernel.error | ||
|
||
import java.nio.file.Path | ||
|
||
/** | ||
* Top level error type that represents error loading external files. | ||
* | ||
* @param reason | ||
* the reason of the error | ||
*/ | ||
abstract class LoadFileError(reason: String) extends Exception { self => | ||
override def fillInStackTrace(): Throwable = self | ||
final override def getMessage: String = reason | ||
} | ||
|
||
object LoadFileError { | ||
|
||
final case class UnaccessibleFile(path: Path, throwable: Throwable) | ||
extends LoadFileError(s"File at path '$path' could not be loaded because of '${throwable.getMessage}'.") | ||
|
||
final case class InvalidJson(path: Path, details: String) | ||
extends LoadFileError(s"File at path '$path' does not contain the expected json input: '$details'.") | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
delta/sdk/src/main/scala/ch/epfl/bluebrain/nexus/delta/sdk/ProvisioningAction.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package ch.epfl.bluebrain.nexus.delta.sdk | ||
|
||
import cats.effect.IO | ||
import ch.epfl.bluebrain.nexus.delta.sdk.ProvisioningAction.Outcome | ||
|
||
/** | ||
* Provisioning action to run at startup | ||
*/ | ||
trait ProvisioningAction { | ||
|
||
def run: IO[Outcome] | ||
|
||
} | ||
|
||
object ProvisioningAction { | ||
|
||
sealed trait Outcome | ||
|
||
object Outcome { | ||
case object Success extends Outcome | ||
case object Skipped extends Outcome | ||
case object Disabled extends Outcome | ||
case object Error extends Outcome | ||
} | ||
|
||
} |
Oops, something went wrong.