Notes from a discussion between Jared Whiklo, Ben Pennell, Bethany Seeger and Danny Bernstein
In this design we have
Http Layer is going to:
- Translate the incoming URI to an internal Fedora ID.
- Get or create a transaction.
- Call a wrapper service for the action (ie. GET|POST|PUT) with the following arguments:
- Fedora ID
- Transaction
- All Http headers
- The request body
Service Layer:
Wrapper service will:
- Load the FedoraResource from the persistence layer.
- Throws Exception if expecting to load something and can’t find it.
- Determine appropriate internal service to call based on RDFSource, NonRdfSource, and NonRdfSourceDescription types
- Call the internal service with:
- FedoraResource
- Transaction
- All HTTP headers
- Request body
Internal service will:
- Validate needs headers and body for request type
- Validate permissions
- Create a OperationBuilder using the OperationFactories
- Populate the Operation with the needed information using the OperationBuilder
- Call the persistence layer with the Operation.
Persistence Layer will:
- Take the operation and execute it (if possible) in the scratch/transaction space.
Additional thoughts:
For DELETEs:
- The delete service holds the knowledge to delete associated resources (ie. ACLs, Mementos, Timemaps, NonRdfSource descriptions) and resources
ldp:contain
-ed - The delete service follows the chain of
ldp:contain
-ment to traverse down the tree until there are no more children, then begin deleting back up. - Each delete is a single operation to the persistence layer. (ie. Deleting an RDFSource is 3+ deletes (resource, ACL, Mementos, Timemap))