Skip to content

Commit

Permalink
Implement timestamp and delivery_timestamp constants attributes for D…
Browse files Browse the repository at this point in the history
…ocument model

Add missing 'this' on timeout getter
  • Loading branch information
QU3B1M committed Nov 29, 2024
1 parent 24a4c17 commit 8c7c443
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public Command(
* @return the timeout value in milliseconds.
*/
public Integer getTimeout() {
return timeout;
return this.timeout;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

/** Command's target fields. */
public class Document implements ToXContentObject {
public static final String TIMESTAMP = "@timestamp";
public static final String DELIVERY_TIMESTAMP = "delivery_timestamp";
private final Agent agent;
private final Command command;
private final String id;
Expand Down Expand Up @@ -84,8 +86,8 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
builder.startObject();
this.agent.toXContent(builder, ToXContentObject.EMPTY_PARAMS);
this.command.toXContent(builder, ToXContentObject.EMPTY_PARAMS);
builder.field("@timestamp", this.timestamp);
builder.field("delivery_timestamp", this.deliveryTimestamp);
builder.field(TIMESTAMP, this.timestamp);
builder.field(DELIVERY_TIMESTAMP, this.deliveryTimestamp);
return builder.endObject();
}

Expand Down

0 comments on commit 8c7c443

Please sign in to comment.