Package-level declarations

Types

Link copied to clipboard
interface ActorIdentity
Link copied to clipboard
data class ArgCommandContextReader<P, C : KlerkContext, V>(val command: Command<out Any, P>, val context: C, val reader: Reader<C, V>)
Link copied to clipboard
data class ArgContextReader<C : KlerkContext, V>(val context: C, val reader: Reader<C, V>)
Link copied to clipboard
data class ArgForInstanceEvent<T : Any, P, C : KlerkContext, V>(val model: Model<T>, val command: Command<T, P>, val context: C, val reader: Reader<C, V>)
Link copied to clipboard
data class ArgForInstanceNonEvent<T : Any, C : KlerkContext, V>(val model: Model<T>, val time: Instant, val reader: Reader<C, V>)
Link copied to clipboard
data class ArgForVoidEvent<T : Any, P, C : KlerkContext, V>(val command: Command<T, P>, val context: C, val reader: Reader<C, V>)
Link copied to clipboard
data class ArgModelContextReader<C : KlerkContext, V>(val model: Model<out Any>, val context: C, val reader: Reader<C, V>)
Link copied to clipboard
data class ArgsForPropertyAuth<C : KlerkContext, V>(val property: DataContainer<*>, val model: Model<out Any>, val context: C, val reader: Reader<C, V>)
Link copied to clipboard
Link copied to clipboard
data class AuthorizationConfig<C : KlerkContext, V>(val readModelPositiveRules: Set<(ArgModelContextReader<C, V>) -> PositiveAuthorization>, val readModelNegativeRules: Set<(ArgModelContextReader<C, V>) -> NegativeAuthorization>, val readPropertyPositiveRules: Set<(ArgsForPropertyAuth<C, V>) -> PositiveAuthorization>, val readPropertyNegativeRules: Set<(ArgsForPropertyAuth<C, V>) -> NegativeAuthorization>, val eventPositiveRules: Set<(ArgCommandContextReader<*, C, V>) -> PositiveAuthorization>, val eventNegativeRules: Set<(ArgCommandContextReader<*, C, V>) -> NegativeAuthorization>, val eventLogPositiveRules: Set<(args: ArgContextReader<C, V>) -> PositiveAuthorization>, val eventLogNegativeRules: Set<(args: ArgContextReader<C, V>) -> NegativeAuthorization>)
Link copied to clipboard
Link copied to clipboard
class AuthorizationProblem(message: String? = null) : Problem
Link copied to clipboard
class BadRequestProblem(message: String?) : Problem
Link copied to clipboard
data class BasicEmail(val from: BasicEmail.EmailAndName, val to: List<BasicEmail.EmailAndName>, val cc: List<BasicEmail.EmailAndName> = emptyList(), val bcc: List<BasicEmail.EmailAndName> = emptyList(), val subject: String, val htmlBody: String?, val textBody: String?, val replyTo: BasicEmail.EmailAndName?)
Link copied to clipboard
data class CollectionId(val modelName: String, val shortId: String)
Link copied to clipboard
sealed class CommandResult<T : Any, C : KlerkContext, V>
Link copied to clipboard
data class Config<C : KlerkContext, V>(collections: V, val authorization: AuthorizationConfig<C, V>, val meterRegistry: MeterRegistry, val managedModels: Set<ManagedModel<*, *, C, V>>, val persistence: Persistence, val migrationSteps: SortedSet<MigrationStep>, val plugins: List<KlerkPlugin<C, V>> = listOf(), val contextProvider: (ActorIdentity) -> C?)
Link copied to clipboard
class ConfigBuilder<C : KlerkContext, D>(dataValue: D)
Link copied to clipboard
class CustomIdentity(val type: Int = ActorIdentity.customType, val id: ModelID<Any>?, val externalId: Long?) : ActorIdentity
Link copied to clipboard

The DefaultTranslator can be used

Link copied to clipboard
interface EmailSender<C : KlerkContext, V>
Link copied to clipboard
sealed class Event<T : Any, P>
Link copied to clipboard
typealias EventId = String
Link copied to clipboard
data class EventReference(val modelName: String, val eventName: String)

A reference to a specific event in a state machine

Link copied to clipboard
Link copied to clipboard
data class EventWithParameters<T : Any>(val eventReference: EventReference, val parameters: EventParameters<T>)
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class HumanReadable(val name: String)
Link copied to clipboard
Link copied to clipboard
sealed class InstanceEvent<T : Any, P> : Event<T, P>
Link copied to clipboard
abstract class InstanceEventNoParameters<T : Any>(forModel: KClass<T>, isExternal: Boolean) : InstanceEvent<T, Nothing?>
Link copied to clipboard
open class InstanceEventWithParameters<T : Any, P : Any>(forModel: KClass<T>, isExternal: Boolean, val parametersClass: KClass<P>) : InstanceEvent<T, P>
Link copied to clipboard

Indicates a bug in Klerk.

Link copied to clipboard
class InternalProblem(message: String? = null) : Problem
Link copied to clipboard
class InvalidParametersProblem(message: String? = null, val parameterName: String? = null, val fieldsMustBeNull: Set<KProperty0<DataContainer<*>?>>? = null, val fieldsMustNotBeNull: Set<KProperty0<DataContainer<*>?>>? = null, val violatedRule: RuleDescription? = null) : Problem
Link copied to clipboard
Link copied to clipboard
interface JobManager<C : KlerkContext, V>
Link copied to clipboard
interface Klerk<C : KlerkContext, D>
Link copied to clipboard
interface KlerkContext

The EventProducer is used to process events where the subsequent events are dependent on the results of the previous events. The processing happens in a transaction, i.e. if any of the events are rejected, all events will be rejected.

Link copied to clipboard
interface KlerkMeta
Link copied to clipboard
interface KlerkModels<C : KlerkContext, V>
Link copied to clipboard
interface KlerkPlugin<C : KlerkContext, V>
Link copied to clipboard
data class KlerkSettings(val requireEventParamsValidation: Boolean = true, val requireAnyValidation: Boolean = true, val eraseAuditLogAfterModelDeletion: Duration? = null, val allowUnsafeOperations: Boolean = false)
Link copied to clipboard
data class ManagedModel<T : Any, ModelStates : Enum<*>, C : KlerkContext, V>(val kClass: KClass<T>, val stateMachine: StateMachine<T, ModelStates, C, V>, val collections: ModelCollections<T, C>)
Link copied to clipboard
data class Model<T : Any>(val id: ModelID<T>, val createdAt: Instant, val lastPropsUpdateAt: Instant, val lastStateTransitionAt: Instant, val state: String, val timeTrigger: Instant?, val props: T)
Link copied to clipboard
value class ModelID<T : Any>(value: Int)

Model IDs are represented internally using Int but only the positive part, so the maximum amount of simultaneous models is about 2 billion (we should find a way to use UInt). It is recommended to use a String (base36) externally.

Link copied to clipboard
class ModelIdentity<T : Any>(val model: Model<T>) : ActorIdentity
Link copied to clipboard
Link copied to clipboard
class NotFoundProblem(message: String? = null) : Problem
Link copied to clipboard
class PluginIdentity(val plugin: KlerkPlugin<*, *>) : ActorIdentity
Link copied to clipboard
abstract class Problem
Link copied to clipboard
data class ProcessingData<Primary : Any, C : KlerkContext, V>(val primaryModel: ModelID<Primary>? = null, val currentModel: ModelID<out Any>? = null, val actions: List<GeneralAction> = emptyList(), val createdModels: List<ModelID<out Any>> = emptyList(), val updatedModels: List<ModelID<out Any>> = emptyList(), val transitions: List<ModelID<out Any>> = emptyList(), val deletedModels: List<ModelID<out Any>> = emptyList(), val unFinalizedTransition: Triple<String, Instant, Model<out Any>>? = null, val aggregatedModelState: Map<ModelID<out Any>, Model<out Any>> = emptyMap(), val newJobs: List<Job<C, V>> = emptyList(), val remainingBlocks: List<Block<*, *, C, V>> = emptyList(), val currentBlock: Block<*, *, C, V>? = null, val processedBlocks: List<Block<*, *, C, V>> = emptyList(), val remainingCommands: List<Command<out Any, out Any?>> = emptyList(), val currentCommand: Command<out Any, out Any?>? = null, val processedCommands: List<Command<out Any, out Any?>> = emptyList(), val log: List<String> = emptyList(), val functionsToUpdateViews: List<() -> Unit> = emptyList(), val problems: List<Problem> = emptyList(), val timeTriggers: Map<ModelID<out Any>, Instant?> = emptyMap(), val remainingTimeTrigger: Model<out Any>? = null)

TODO: make sure this documentation is correct

Link copied to clipboard
data class RuleDescription(val function: Function<Any>, val type: RuleType)
Link copied to clipboard
Link copied to clipboard
class ServerStateProblem(message: String? = null) : Problem
Link copied to clipboard
data class StateId(val modelName: String, val stateName: String)
Link copied to clipboard
class StateProblem(message: String? = null, val violatedRule: RuleDescription? = null) : Problem
Link copied to clipboard
Link copied to clipboard
interface Translator
Link copied to clipboard
Link copied to clipboard
fun interface Validatable
Link copied to clipboard
sealed class Validity
Link copied to clipboard
sealed class VoidEvent<T : Any, P> : Event<T, P>
Link copied to clipboard
abstract class VoidEventNoParameters<T : Any>(forModel: KClass<T>, isExternal: Boolean) : VoidEvent<T, Nothing?>
Link copied to clipboard
abstract class VoidEventWithParameters<T : Any, P : Any>(forModel: KClass<T>, isExternal: Boolean, val parametersClass: KClass<P>) : VoidEvent<T, P>

Functions

Link copied to clipboard