## 4.2.15.10.1  Storage Manager Implementation
The storage manager integrates the data archiving runtime with the actual storage of the archiving files.
The storage manager will be processed in the different steps of the data archiving process. Within the storage manager implementation, you have the full flexibility to choose which storage will be integrated. Possible options to integrate external storages already exist in ABAP Cloud:
- Via Cloud Connector for On-Premise integration
- Outbound Communication
As a precondition for data archiving, you need to create a class which implements the interface IF\_ARCH\_STORAGE\_MANAGER . This interface provides the following methods:
- The method IF\_ARCH\_STORAGE\_MANAGER~STORE\_FILE stores the archived data to a physical storage location outside of the SAP system. It will be called by the ADK write API and has the following parameters:
- The method IF\_ARCH\_STORAGE\_MANAGER~GET\_BYTESTREAM retrieves parts of the binary content of an archive file via range request. It will be called by an ADK API to read the archived data and has the following parameters:
- The method IF\_ARCH\_STORAGE~RETRIEVE\_FILE retrieves the entire binary content of an archive file.
- The method IF\_ARCH\_STORAGE\_MANAGER~DELETE FILE deletes the archive file from the external storage system.
| Parameter                 | Description                                                                                                                                                                            |
|---------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Importing: IV_ARCHIVE_KEY | Key of the archive file to be stored                                                                                                                                                   |
| Importing: IV_DATA        | Content of the archive file (binary data)                                                                                                                                              |
| Importing: IV_LENGTH      | Length of the binary content                                                                                                                                                           |
| Returning: RV_DOCUMENT_ID | Document identifier which can be used to access the ar- chived data. The document ID needs to be returned by the storage manager and will be stored in a link table in the SAP system. |
| Parameter                 | Description                                 |
|---------------------------|---------------------------------------------|
| Importing: IV_DOCUMENT_ID | Document identifier                         |
| Importing: IV_FROM_OFFSET | Data object address                         |
| Importing: IV_LENGTH      | Length of the binary content                |
| Exporting: EV_DATA        | Content of the archive file (binary data)   |
| Exporting: EV_ACT_LENGTH  | Length of the byte stream which is returned |
| Parameter                 | Description                                                                               |
|---------------------------|-------------------------------------------------------------------------------------------|
| Importing: IV_DOCUMENT_ID | Document identifier                                                                       |
| Returning: RV_DATA        | Content of the archive file (binary data) which will be re- turned by the storage manager |
| Parameter                 | Description         |
|---------------------------|---------------------|
| Importing: IV_DOCUMENT_ID | Document identifier |
- After the method IF\_ARCH\_STORAGE\_MANAGER~STORE\_FILE has been called by the ADK write API, the stored file is verified by the SAP system. If the verification fails, the method IF\_ARCH\_STORAGE\_MANAGER~FILE\_VERIFICATION\_FAIL is called by the ADK write API to inform the storage manager that the archive file is considered invalid and will be deleted from the SAP system.
## Parameter
| Importing: IV_ARCHIVE_KEY   | Key of the invalid archive file   |
|-----------------------------|-----------------------------------|
| Importing: IV_DOCUMENT_ID   | Document identifier               |
##  Note
If any errors appear during any of the operations of the storage manager, please use the exception class CX\_ARCH\_STORAGE\_MANAGER .