A proof of concept Common Lisp Prevalence system
*blob-root* variable
The directory in which to store the blob files
Initial value: NIL
(all-preferences-keys system) generic-function
Return a list of all persistent preference keys of system
(backup system &key directory) generic-function
Make backup copies of the current snapshot and transaction-log files
blob class
A blob is a file-like collection of bytes with related metadata
Class precedence list: blob object-with-id standard-object t
Class init args: :id :keywords :mime-type :size :name
(copy-to-stream blob binary-output-stream) generic-function
Copy the bytes from blob to binary-output-stream
(destroy blob) generic-function
Completely destroy blob (removing its byte data file as well)
(execute system object) generic-function
Ask for a transaction object to be executed on system with ACID properties
(execute-transaction transaction-call) function
Create a transaction object from transaction-call and execute it
(fill-from-file blob pathname) generic-function
Fill the blob's contents with the bytes read from the binary file at pathname
(fill-from-stream blob binary-input-stream) generic-function
Fill the blob's contents with the bytes from binary-input-stream
(find-all-objects system class) generic-function
Return an unordered collection of all objects in system that are instances of class
(find-object-with-id system class id) generic-function
Find and return the object in system of class with id, null if not found
(get-file blob) generic-function
Return the pathname to the bytes of blob
(get-guard guarded-prevalence-system) generic-function
Access the guard function of a sytem
(setf (get-guard guarded-prevalence-system) value) generic-function
Set the guard function of a system
(get-id object) generic-function
Return an external, unique, immutable identifier for object (typically an integer)
(get-keywords blob) generic-function
Return the list of keywords associated with blob
(setf (get-keywords blob) keywords) generic-function
Set the keywords list of blob
(get-mime-type blob) generic-function
Return the mime-type of blob as a string
(setf (get-mime-type blob) mime-type) generic-function
Set the mime-type string of blob
(get-name blob) generic-function
Return the descriptive name of blob
(setf (get-name blob) name) generic-function
Set the descriptive name of blob
(get-option system name) generic-function
Retrieve a named option from system
(setf (get-option system name) value) generic-function
Set a named option of system to value
(get-preference system key) generic-function
Retrieve the value of the persistent preference stored under key in system
(get-root-object system name) generic-function
Retrieve a root object by symbol name from system
(setf (get-root-object system name) value) generic-function
Set a symbol named root object of system to value
(get-size blob) generic-function
Return the size of blob in bytes
guarded-prevalence-system class
A Prevalence system with a guard thunk
Class precedence list: guarded-prevalence-system prevalence-system standard-object t
Class init args: :directory
(initiates-rollback condition) generic-function
Return true when a condition initiates a rollback when thrown from a transaction
(make-prevalence-system directory &key (prevalence-system-class (quote prevalence-system))) function
Create and return a new prevalence system on directory. When the directory contains a valid snapshot and/or transaction log file, the system will be restored. Optionally specify the prevalence system's class.
(make-transaction function &rest args) function
Create and return a new transaction specifying a function name and an argument list. The function should accept the system instance prepended to the argument list as arguments and implement the actual transaction in a re-entrant way.
no-rollback-error condition
Thrown by code inside a transaction to indicate that no rollback is needed
Class precedence list: no-rollback-error error serious-condition condition standard-object t
object-with-id class
Superclass for objects with an id
Class precedence list: object-with-id standard-object t
Class init args: :id
prevalence-system class
Base Prevalence system implementation object
Class precedence list: prevalence-system standard-object t
Class init args: :directory
(print-snapshot system) function
Echo the XML making up the snapshot of system to t
(print-transaction-log system) function
Echo the XML making up the transaction log of system to t
(query system function &rest args) generic-function
Ask for a query function to be executed on system with args
(remove-root-object system name) generic-function
Remove the root object by symbol name from system
(restore system) generic-function
Restore a system from permanent storage
(set-slot-values instance slots-and-values) function
Set slots and values of instance
(show-transaction-log system) function
Print the transaction objects making up the transaction log of system to t
(snapshot system) generic-function
Take a snapshot of a system
transaction class
A simple Transaction object joining a function and its arguments
Class precedence list: transaction standard-object t
Class init args: :function :args
(transaction-log-tail system &optional (count 8)) function
Return a list of the count last transaction objects of system
(tx-change-object-slots system class id slots-and-values) function
Change some slots of the object of class with id in system using slots and values
(tx-create-id-counter system) function
Initialize the id counter to 0
(tx-create-object system &optional class slots-and-values) function
Create a new object of class in system, assigning it a unique id, optionally setting some slots and values
(tx-delete-object system class id) function
Delete the object of class with if from the system
(tx-set-preference system key value) function
Set the value of the persistent preference key in system
Documentation generated by lispdoc running on LispWorks Personal Edition