NIFI-4814 - Add distinctive attribute to S2S reporting tasks

NIFI-4814 - added UUID attribute

NIFI-4814 - added type attribute

Signed-off-by: Matthew Burgess <mattyb149@apache.org>

This closes #2431
This commit is contained in:
Pierre Villard 2018-01-24 16:15:22 +01:00 committed by Matthew Burgess
parent b4b970b876
commit bc37015693
3 changed files with 9 additions and 0 deletions

View File

@ -159,6 +159,9 @@ public class SiteToSiteBulletinReportingTask extends AbstractSiteToSiteReporting
final Map<String, String> attributes = new HashMap<>(); final Map<String, String> attributes = new HashMap<>();
final String transactionId = UUID.randomUUID().toString(); final String transactionId = UUID.randomUUID().toString();
attributes.put("reporting.task.transaction.id", transactionId); attributes.put("reporting.task.transaction.id", transactionId);
attributes.put("reporting.task.name", getName());
attributes.put("reporting.task.uuid", getIdentifier());
attributes.put("reporting.task.type", this.getClass().getSimpleName());
attributes.put("mime.type", "application/json"); attributes.put("mime.type", "application/json");
final byte[] data = jsonArray.toString().getBytes(StandardCharsets.UTF_8); final byte[] data = jsonArray.toString().getBytes(StandardCharsets.UTF_8);

View File

@ -277,6 +277,9 @@ public class SiteToSiteProvenanceReportingTask extends AbstractSiteToSiteReporti
final Map<String, String> attributes = new HashMap<>(); final Map<String, String> attributes = new HashMap<>();
final String transactionId = UUID.randomUUID().toString(); final String transactionId = UUID.randomUUID().toString();
attributes.put("reporting.task.transaction.id", transactionId); attributes.put("reporting.task.transaction.id", transactionId);
attributes.put("reporting.task.name", getName());
attributes.put("reporting.task.uuid", getIdentifier());
attributes.put("reporting.task.type", this.getClass().getSimpleName());
attributes.put("mime.type", "application/json"); attributes.put("mime.type", "application/json");
final byte[] data = jsonArray.toString().getBytes(StandardCharsets.UTF_8); final byte[] data = jsonArray.toString().getBytes(StandardCharsets.UTF_8);

View File

@ -158,6 +158,9 @@ public class SiteToSiteStatusReportingTask extends AbstractSiteToSiteReportingTa
final Map<String, String> attributes = new HashMap<>(); final Map<String, String> attributes = new HashMap<>();
final String transactionId = UUID.randomUUID().toString(); final String transactionId = UUID.randomUUID().toString();
attributes.put("reporting.task.transaction.id", transactionId); attributes.put("reporting.task.transaction.id", transactionId);
attributes.put("reporting.task.name", getName());
attributes.put("reporting.task.uuid", getIdentifier());
attributes.put("reporting.task.type", this.getClass().getSimpleName());
attributes.put("mime.type", "application/json"); attributes.put("mime.type", "application/json");
JsonArrayBuilder jsonBatchArrayBuilder = factory.createArrayBuilder(); JsonArrayBuilder jsonBatchArrayBuilder = factory.createArrayBuilder();