CRecordFileRegistryAddFileInfos

This message is used for registering files in the FileRegistry. It contains an array with file information: relative path, hash value, file timestamps, and the address of the FileStore where the file is stored.

This message is part of the The File Registry API API.

{
  "id": "1b7e5d1b-9da8-40d4-9aa4-accb093e7f96",
  "name": "FILE_REGISTRY_ADD_FILE_INFOS",
  "description": "Add information about files to the file registry.",
  "slots": [
    {
      "key": "rec",
      "name": "FILE_INFO",
      "direction": "REQUEST",
      "mandatory": "true",
      "type": "RECORD_ARRAY",
      "description": "The information about files to store in the file registry.
                      Records are from type FILE_REGISTRY_FILE_INFO"
    }
  ]
}

Message Arguments

Key Name Direction Mandatory Type Description
rec FILE_INFO REQUEST true RECORD_ARRAY The information about files to store in the file registry.
Records are from type FILE_REGISTRY_FILE_INFO

Usage

// create a list of records with file information
final List<CRecord> list = new ArrayList<>();
for (...)
{
    final CRecord rec = CRecordFileRegistryFileInfo.create();
    CRecordFileRegistryFileInfo.setPath(rec,
                                        ...);
    CRecordFileRegistryFileInfo.setHash(rec,
                                        ...);
    CRecordFileRegistryFileInfo.setTimeOfLastModification(rec,
                                                          ...);
    CRecordFileRegistryFileInfo.setSourceAddress(rec,
                                                 ...);
    list.add(rec);
}

final CRecord[] arr = list.toArray(new CRecord[0]);

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

final CRecord record = CRecordFileRegistryAddFileInfos.create();
CRecordFileRegistryAddFileInfos.setFileInfo(record,
                                            arr);

sendNotification(env,
                 record);

Record Usage

In nyssr.net, we typically don't exchange interfaces between projects. Instead, we use platform-independent Records to describe message formats.

One or more descriptions of these Records are stored in the JSON or XML format as record.json or record.xml within a directory. The Record Generator, an included Swing tool, generates helper classes from these files. These classes can then be used to type-safely write or read messages.

See also