From 362f037917a4b52e42c97d3fc14bf0ff426cb101 Mon Sep 17 00:00:00 2001 From: Christos KK Loverdos Date: Fri, 13 Jan 2012 16:15:16 +0200 Subject: [PATCH] Add events modeling. AquariumEvent and ResourceEvent. --- doc/arch/aquarium.tex | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/doc/arch/aquarium.tex b/doc/arch/aquarium.tex index 14085e7..466930c 100644 --- a/doc/arch/aquarium.tex +++ b/doc/arch/aquarium.tex @@ -212,6 +212,34 @@ Aquarium is the recipient of several types of events from external systems. More Another type of events are the user-related events, from the perspective if the Identity Management service. For example, Aquarium needs to know when a user is first created an and when the user is activated or suspended. Also, several types of users (e.g. Lab Administrators or Professors in the academic setting where Aquarium is initially targeted for) may be assigned more privileged credit plans that periodically give them more credits. +For the exchange of events we adopt the ubiquitous JSON format. This is chosen for the ease of manipulation from both Scala, used in Aquarium, and Python, used for the rest of the communicating systems. Our base entity, \texttt{AquariumEvent} and the \texttt{ResourceEvent} corresponding to a resource event are shown in Figure~\ref{fig:aqevent}. + +\begin{figure} +\lstset{language=c, basicstyle=\footnotesize, +stringstyle=\ttfamily, +flexiblecolumns=true, aboveskip=-0.9em, belowskip=0em, lineskip=0em} + +\begin{lstlisting} +abstract class AquariumEvent( + val id: String, + val occurredMillis: Long, + val receivedMillis: Long) + +case class ResourceEvent( + override val id: String, + override val occurredMillis: Long, + override val receivedMillis: Long, + userId: String, + clientId: String, + resource: String, + eventVersion: String, + value: Float, + details: ResourceEvent.Details) + extends AquariumEvent(id, occurredMillis, receivedMillis) +\end{lstlisting} +\caption{Events in Aquarium.} +\label{fig:aqevent} +\end{figure} \subsection{The configuration DSL} \label{sec:dsl} -- 1.7.10.4