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 FileRegistry 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.\nRecords 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);