Handlers#
Palmyra handlers are a family of public interfaces under com.palmyralabs.palmyra.handlers. Implement one (or a composite) on a @Component and bind it to a URL with @CrudMapping.
Wire format. All handlers speak JSON on both request and response. Request bodies deserialise into the model class declared on @CrudMapping.type; responses carry the same model’s attributes back (with any fields tagged DropMode.OUTGOING stripped).
The canonical lifecycle for mutating handlers is preXxx → onXxx → postXxx, each returning a Tuple and receiving a HandlerContext. Update and save additionally receive the pre-image dbTuple; save also receives a MutableAction.
| Handler | Purpose |
|---|---|
| QueryHandler | Paged / filtered reads |
| ReadHandler | Criteria-based reads |
| NativeQueryHandler | Hand-written SQL |
| TypedQueryHandler | Type-safe row callback |
| CreateHandler | Insert lifecycle |
| UpdateHandler | Update lifecycle |
| SaveHandler | Upsert lifecycle |
| DeleteHandler | Delete lifecycle |
| CsvHandler | CSV export |
| ExcelHandler | Excel export |
| CustomFormatHandler | Pluggable export formats |
| DataHandler | Composite: full read + write |
| CrudHandler | Composite: full CRUD |
| PreProcessor | Mixin: validate + ACL for writes |
| TusUploadHandler | TUS resumable upload |
| TusDownloadHandler | TUS download |