Class RecordService

java.lang.Object
org.forgerock.openig.ui.record.RecordService

public class RecordService extends Object
File-based Record storage service.

It is configured to record 1 file per record in a given directory.

Record's identifiers are generated from UUID when created. This UUID is then used as the name (with the .json suffix) of the file where content will be persisted.

Content is stored without any change (it won't include _id or _rev) inside of the file. Content can be any generic JSON structure: primitives, null, array or object.

Note that the following structure is used:

     {
         "id": "43c7d754-efc7-4838-a5da-782dd9c360c4",
         "rev": "1ce6ce0e-387f-4ebe-8450-9d21ab5d71e5",
         "content": {
             "key": [ 42 ]
         }
     }
     
 

Record's revision is based on a UUID that change with each update. That provides a basic MVCC support.

Note that we don't provide full MVCC support: we don't keep older revisions of the records to allow concurrent reads on different versions.

As we don't expect high concurrency and high performance is not a requirement, data consistency is guaranteed with the usage of synchronized methods.