Content Manager: Design Overview
From Gcube Wiki
The Content Manager is designed as an OCMA service. In OCMA terms, it classifies as a multi-type, 1-N adapter service:
- it is a multi-type service because it supports two front types for, respectively, reading and writing content modelled as labelled trees.
- Collectively, the front types and the tree content model form the
gDoc
access type of the service.
- it is an adapter service because it adapts the
gDoc
access type to multiple back types, where each back type corresponds to the interface and content model of a class of remote repositories.
- For this, the service employes an open architecture of type-specific plugins to which it delegates the creation and operation of its collection managers.
- Plugins are dynamically deployed within service instances, and different instances may host different plugins. In addition, some plugins may support both service front types, i.e. grant read and write access to the corresponding class of repositories. Others may instead support read-only access or, less commonly, write-only access.
The figure below overviews the design and use of the service in the context of one its instances. The instance exposes three stateful port-types:
- the
ReadManager
port-type serves as the interface of collection managers that offer read-only operations over the content of the bound collection.
- The interface defines the
gDocRead
front type of the service. - The front type and the identifier of the bound collection are published as Resource Properties of the manager, in accordance with OCMA patterns for publication and discovery of service state. A third Resource Property is the name of the bound plugin, i.e. the plugin to which the manager delegates the resolution of its requests.
- the
WriteManager
port-type serves as the interface of collection managers that offer write-only operations over the content of the bound collection.
- The interface defines the
gDocWrite
front type of the service. - Again, the type, the identifier of the bound collection, and the name of the bound plugin are published as Resource Properties of the manager.
- the
Factory
port-type serves as the front-end of a single WS Resource that createsReadManager
andWriteManager
resources .
- The resource is created at the activation of the service instance in the gCube Hosting Node.
- During its lifetime, it publishes creation requests as activation records. Conversely, it subscribes for the activation records that are published by other instances of the service, in line with OCMA patterns for replication of service state.
- The resource also publishes as a Resource Property a list of summary descriptions of the plugins which are hosted by the service instance.
Service plugins logically extend factory and collection manager resources with corresponding resource delegates. In particular:
- the factory delegate extends the
Factory
resource in order to handle requests which are specifically addressed to the plugin; - at each such request, the factory delegate processes plugin-specific parameters to create one ore more read delegates and/or write delegates, which the service instance uses to create and extend corresponding collection managers;
- future requests to the managers are then handled by their delegates, which translate the requests against the back-end repository that exposes the collection bound to the managers.
Finally, note that factory and collection managers are persistent resources and may thus be re-activated across restarts of the gCube Hosting Node:
- the factory persists the history of its activations, i.e. the activation records that it published and/or processed (so as to not process them again).
- the collection managers persist their delegates.