This directory contains comprehensive API documentation for the Firefly ECM Library, including all port interfaces, domain models, and configuration options.
The Firefly ECM Library defines business interfaces (ports) that adapters implement:
- DocumentPort - Core document CRUD operations
- DocumentContentPort - Binary content operations
- DocumentVersionPort - Document versioning
- DocumentSearchPort - Document search capabilities
- FolderPort - Folder CRUD operations
- FolderHierarchyPort - Hierarchical folder operations
- FolderPermissionPort - Folder-level permissions
- PermissionPort - Access control and permissions
- SecurityPort - Security operations
- AuditPort - Audit logging and compliance
- CompliancePort - Compliance operations
- SignatureEnvelopePort - Envelope management
- SignatureRequestPort - Signature requests
- SignatureValidationPort - Signature validation
Core business entities and value objects:
- Document - Core document entity
- DocumentVersion - Document version information
- DocumentStatus - Document status enumeration
- Folder - Folder entity
- FolderPermission - Folder permissions
- Permission - Access control permissions
- AuditEvent - Audit trail entries
- SignatureEnvelope - Signature envelope container
- SignatureRequest - Individual signature requests
- SignatureField - Signature field definitions
Configuration classes and properties:
- EcmProperties - Main configuration class
- AdapterConfiguration - Adapter-specific configuration
- FeatureConfiguration - Feature flags and settings
Adapter implementations and interfaces:
- Adapter Interface - Base adapter interface
- Adapter Features - Supported feature enumeration
- Adapter Registry - Adapter discovery and registration
Core service classes:
- EcmPortProvider - Central port provider service
- AdapterSelector - Adapter selection logic
- ConfigurationValidator - Configuration validation
// Get document port
DocumentPort documentPort = ecmPortProvider.getPort(DocumentPort.class);
// Create document
Document document = Document.builder()
.name("example.pdf")
.mimeType("application/pdf")
.size(1024L)
.status(DocumentStatus.ACTIVE)
.build();
Mono<Document> created = documentPort.createDocument(document, content);
// Retrieve document
Mono<Document> retrieved = documentPort.getDocument(documentId);
// Update document
Mono<Document> updated = documentPort.updateDocument(document);
// Delete document
Mono<Void> deleted = documentPort.deleteDocument(documentId);// Get content port
DocumentContentPort contentPort = ecmPortProvider.getPort(DocumentContentPort.class);
// Stream content
Flux<DataBuffer> contentStream = contentPort.getContentStream(documentId);
// Get content as bytes
Mono<byte[]> content = contentPort.getContent(documentId);
// Get content range
Flux<DataBuffer> range = contentPort.getContentRange(documentId, 0, 1023);// Get folder port
FolderPort folderPort = ecmPortProvider.getPort(FolderPort.class);
// Create folder
Folder folder = Folder.builder()
.name("Documents")
.path("/Documents")
.build();
Mono<Folder> created = folderPort.createFolder(folder);
// List folder contents
Flux<Document> contents = folderPort.getFolderContents(folderId);// Get signature envelope port
SignatureEnvelopePort envelopePort = ecmPortProvider.getPort(SignatureEnvelopePort.class);
// Create signature envelope
SignatureEnvelope envelope = SignatureEnvelope.builder()
.title("Contract Signature")
.description("Please sign this contract")
.documentIds(Arrays.asList(documentId))
.signatureRequests(signatureRequests)
.build();
Mono<SignatureEnvelope> created = envelopePort.createEnvelope(envelope);
// Send envelope for signature
Mono<SignatureEnvelope> sent = envelopePort.sendEnvelope(envelopeId, sentBy);
// Get signing URL
Mono<String> signingUrl = envelopePort.getSigningUrl(envelopeId, signerEmail);All port methods return reactive types (Mono or Flux) and follow these error handling patterns:
DocumentNotFoundException- Document not foundFolderNotFoundException- Folder not foundPermissionDeniedException- Access deniedAdapterException- Adapter-specific errorsConfigurationException- Configuration errors
documentPort.getDocument(documentId)
.doOnError(DocumentNotFoundException.class, error ->
log.warn("Document not found: {}", documentId))
.onErrorReturn(DocumentNotFoundException.class, null)
.doOnError(PermissionDeniedException.class, error ->
log.error("Access denied for document: {}", documentId))
.onErrorResume(PermissionDeniedException.class, error ->
Mono.error(new SecurityException("Access denied")))
.subscribe();The Firefly ECM Library uses Project Reactor for reactive programming:
Mono<T>- Represents 0 or 1 elementFlux<T>- Represents 0 to N elements- Backpressure - Automatic flow control
- Non-blocking - Efficient resource utilization
- Chain Operations: Use reactive operators to chain operations
- Error Handling: Handle errors at appropriate levels
- Backpressure: Let Reactor handle backpressure automatically
- Testing: Use
StepVerifierfor testing reactive streams - Blocking: Avoid blocking operations in reactive chains
The Firefly ECM Library follows semantic versioning:
- Major Version: Breaking changes to public APIs
- Minor Version: New features, backward compatible
- Patch Version: Bug fixes, backward compatible
For API questions and support:
- Documentation: Firefly ECM Wiki
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Note: This API reference is based on the actual Firefly ECM Library codebase. All interfaces, methods, and examples reflect the real implementation.