You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Current »

Story

A small project which allows to interact with an user, store data, schedule and observe science projects. It consists of 4 components and 1 client:

  • The client could be either a CLI or a Web Service
  • A gateway component that exposes an API REST or JSON RPC API and interacts with the rest of the system through the internal's system protocol
  • A database component which stores the data being used
  • A scheduler component that organizes the projects and assigns jobs to the observing mode
  • An observing mode which abstracts an observation entirely

There are a couple of use cases the system should allow:

  • Add new science projects
    • User interacts with CLI / WS
    • CLI / WS connects through JSON RPC API method XXXX with Gateway Component
    • Gateway Component interacts with Database Component to add the new science project
  • Remove science projects only if they haven't been observed yet (and are not being observed).
    • User interacts with CLI / WS
    • CLI / WS connects through JSON RPC API method XXXX with Gateway Component
    • Gateway Component interacts with Database Component to remove science project
      • Database Component removes the science project if possible
      • Database Component should raise an exception if the project is being observed or has already been observed
  • Retrieve next N projects
    • User interacts with CLI / WS
    • CLI / WS connects through JSON RPC API method XXXX with Gateway Component
    • Gateway Component interacts with Scheduling Component and requests the next 10 projects to be observed
  • Schedule projects
    • Scheduling Component regularly checks the available projects with the Database Component
    • If there are projects available, then it prioritizes them and queues them in an internal list
    • A different thread is regularly checking with the Observing Mode component whether it is able to observe
      • If the Observing Mode component is IDLE, then the Scheduling Component sends an observation request
  • Observe project
    • The Observing Mode component is a very simple participant that receives a request to observe
      • If it is already observing it should raise an exception
      • Otherwise it should mark the project as "Running" with the Database Component and start the observation
        • It should simulate the observation by waiting a configured time in the project
        • Once it finishes it should mark the project as either "Success" or "Failure" with the Database Component

Interface

ObservingMode Component

The observing mode component has a very simple interface which should let the interested people to know the telescope state and to issue an observation. It is composed of 2 methods:

  • state : TelescopeState (void)
  • observe : void (int uid) raises TelescopeNotAvailable, ProjectInUnexpectedState

Scheduler Component

The scheduler component has to prioritize the available projects, queue them and interact with the observing mode component to issue observations. It is composed of only 1 method:

  • getNextProjects : list<Project> (int num)

But it is important to consider that it is also doing two asynchronous tasks almost at all times:

  • Checking available projects and prioritizing them
  • Checking telescope state and issuing observations

Database Component

The database component has to make CRUD actions over the projects, according to other components demands. It is composed by several methods:

  • addProject : void (Project) raises UIDMustBeZero
  • getProject : Project (int uid) raises ProjectDoesNotExist
  • getProjects : list<Project> (void)
  • updateProject : void (Project) raises ProjectDoesNotExist, ProjectBeingObserved, ProjectAlreadyObserved
  • removeProject : void (int uid) raises ProjectDoesNotExist, ProjectBeingObserved, ProjectAlreadyObserved
  • forceChangeState : void (int uid, ProjectState state) raises ProjectDoesNotExist
  • clearProjects : void (void)

Gateway Component

The Gateway Component is a proxy between the system and the user interface. It offers a JSON RPC interface to a CLI or Web Service

  • getNextProjects : list<Project> (int num)
  • addProject : void (Project)
  • getProject : Project (int uid)
  • getProjects : list<Project> (void)
  • updateProject : void (Project)
  • removeProject : void (int uid)
  • getTelescopeState : State (void)

CLI / Web Service

The interface with the user could either be a command line client or a web service offering a GUI to the user.

It should allow the user to create, display and edit a project in a "convenient" way as well as displaying other useful data from the Gateway Component:

  • Telescope State
  • Generic data on Lists of Projects
  • Specific Data on single project
  • No labels