CRecordFileRegistryFileInfo

This record contains information about a file.

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

{
  "id": "e8994dd7-39e6-4acb-ab91-e680f2daf591",
  "name": "FILE_REGISTRY_FILE_INFO",
  "description": "information about a file.",
  "slots": [
    {
      "key": "1",
      "name": "PATH",
      "direction": "REQUEST",
      "mandatory": "true",
      "type": "STRING",
      "description": "The relative path of the file."
    },
    {
      "key": "2",
      "name": "HASH",
      "direction": "REQUEST",
      "mandatory": "true",
      "type": "STRING",
      "description": "The base-32-encoded hash of the file."
    },
    {
      "key": "3",
      "name": "TIME_OF_LAST_MODIFICATION",
      "direction": "REQUEST",
      "mandatory": "true",
      "type": "INSTANT",
      "description": "The time of the last modification of the file."
    },
    {
      "key": "4",
      "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)."
    }
  ]
}

Message Arguments

Key Name Direction Mandatory Type Description
1 PATH REQUEST true STRING The relative path of the file.
2 HASH REQUEST true STRING The base-32-encoded hash of the file.
3 TIME_OF_LAST_MODIFICATION REQUEST true INSTANT The time of the last modification of the file.
4 SOURCE_ADDRESS REQUEST false TARGET_ADDRESS 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);

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