...
- The client could be either a CLI or a Web Service
- A gateway component that exposes a 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
...