The File Registry API

The FileRegistry is a central and essential component of the nyssr.net segment for file management.

Function and Architecture

The FileRegistry serves as a central directory that lists all files provided by the various FileStores on the different nodes of the system. It thus enables a consistent overview of all available files across the entire segment.

  • Singleton Principle: Only a single instance of the FileRegistry exists per nyssr.net segment.
  • Implementation: The FileRegistry is implemented as a dedicated Microservice.

Addressing the Microservice

To communicate with the FileRegistry, all messages must be sent via an Envelope (CEnvelope) that contains the unique microservice ID of the registry.

The following code example shows how to retrieve the correct service ID and create a correspondingly addressed message envelope:

final IId microServiceId = CIdFactory.fromObject("file.registry");
final CEnvelope env = CEnvelope.forMicroService(microServiceId);

API Messages and Records

Communication with the FileRegistry occurs via specific CRecord messages, which are divided into two main categories: Requests for performing an action and Data Records for describing file information.

1. Requests to the File Registry

These records request an action from the microservice (e.g., registration or retrieval of information).

Record Description
CRecordFileRegistryAddFileInfos Used for registering local files with the File Registry Microservice that are provided by a FileStore.
CRecordFileRegistryGetFileInfo Allows the retrieval of specific information (metadata) about a single file from the directory.
CRecordFileRegistryGetFilePaths Retrieves information about all (up to a maximum of 1000) registered file paths for a specific directory.

2. Data Records of the File Registry

Record Description
CRecordFileRegistryFileInfo This data record describes the structure and the attributes of a file entry in the central File Registry.