CRecordFileRegistryFileInfo

This record contains information about a file.

This message is part of the FileRegistry API.

{
  "id": "e8994dd7-39e6-4acb-ab91-e680f2daf591",
  "name": "FILE_REGISTRY_FILE_INFO",
  "description": "information about a file.",
  "slots": [
    {
      "key": "path",
      "name": "PATH",
      "direction": "REQUEST",
      "mandatory": "true",
      "type": "STRING",
      "description": "The relative path of the file."
    },
    {
      "key": "hash",
      "name": "HASH",
      "direction": "REQUEST",
      "mandatory": "true",
      "type": "STRING",
      "description": "The base-64-encoded hash of the file."
    },
    {
      "key": "time",
      "name": "TIME_OF_LAST_MODIFICATION",
      "direction": "REQUEST",
      "mandatory": "true",
      "type": "INSTANT",
      "description": "The time of the last modification of the file."
    },
    {
      "key": "adr",
      "name": "SOURCE_ADDRESS",
      "direction": "REQUEST",
      "mandatory": "false",
      "type": "TARGET_ADDRESS",
      "description": "The target address of the source of the file (optional, if missing the sender address will be used)."
    }
  ]
}

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);

nyssr.net - Innovative Distributed System