Tags: developer, explanation

HTTP Resources#

Note

This page has been migrated from the old documentation, and has not yet been fully revised. There might be inconsistencies or errors when using with current LinkAhead versions.

HTTP resources are implemented in the resource package, in classes inheriting from AbstractCaosDBServerResource ( which inherits Restlet’s Resource class). The main CaosDBServer class defines which HTTP resource (for example /Entity/{specifier}) will be handled by which class (EntityResource in this case).

Implementing classes need to overwrite for example the httpGetInChildClass() method (or methods corresponding to other HTTP request methods such as POST, PUT, …). Typically, they might call the execute() method of a Transaction object. Transactions are explained in detail in the Transactions and Schedules section.

@startuml
abstract AbstractCaosDBServerResource {
  {abstract} httpGetInChildClass()
  {abstract} httpPostInChildClass()
  {abstract} ...InChildClass()
}
abstract RetrieveEntityResource
class EntityResource
AbstractCaosDBServerResource <|-- RetrieveEntityResource
RetrieveEntityResource <|-- EntityResource
@enduml