@Override protected void writeSimpleResult(final PrintStream output) { if (versions == null || versions.isEmpty()) { return; } // date length, with locale specifics final String datePattern = "%1$ta, %<tb %<td %<tY %<tR %<tZ"; final int dateLength = String.format(datePattern, new Date()).length(); final Table table = new Table.Builder() .column("Ver", 3, 3, false) .column("Date", dateLength, dateLength, false) .column("Author", 20, 200, true) .column("Message", 8, 40, true) .build(); versions.forEach(vfs -> { table.addRow( String.valueOf(vfs.getVersion()), String.format(datePattern, new Date(vfs.getTimestamp())), vfs.getAuthor(), vfs.getComments() ); }); final TableWriter tableWriter = new DynamicTableWriter(); tableWriter.write(table, output); } }
metadata.setFlowIdentifier(flowId); metadata.setVersion(version); metadata.setComments(deserializedSnapshot.getSnapshotMetadata().getComments());
destMetadata.setFlowIdentifier(destFlowId); destMetadata.setVersion(srcVersion); destMetadata.setComments(srcFlowSnapshot.getSnapshotMetadata().getComments());
destMetadata.setFlowIdentifier(destFlowId); destMetadata.setVersion(destFlowVersion); destMetadata.setComments(srcSnapshot.getSnapshotMetadata().getComments());
@Override public String toString() { final String flowName = (flow == null ? "null" : flow.getName()); return "VersionedFlowSnapshot[flowId=" + snapshotMetadata.getFlowIdentifier() + ", flowName=" + flowName + ", version=" + snapshotMetadata.getVersion() + ", comments=" + snapshotMetadata.getComments() + "]"; } }
public static FlowSnapshotEntity map(final VersionedFlowSnapshotMetadata versionedFlowSnapshot) { final FlowSnapshotEntity flowSnapshotEntity = new FlowSnapshotEntity(); flowSnapshotEntity.setFlowId(versionedFlowSnapshot.getFlowIdentifier()); flowSnapshotEntity.setVersion(versionedFlowSnapshot.getVersion()); flowSnapshotEntity.setComments(versionedFlowSnapshot.getComments()); flowSnapshotEntity.setCreated(new Date(versionedFlowSnapshot.getTimestamp())); flowSnapshotEntity.setCreatedBy(versionedFlowSnapshot.getAuthor()); return flowSnapshotEntity; }
public static Event flowVersionCreated(final VersionedFlowSnapshot versionedFlowSnapshot) { final String versionComments = versionedFlowSnapshot.getSnapshotMetadata().getComments() == null ? "" : versionedFlowSnapshot.getSnapshotMetadata().getComments(); return new StandardEvent.Builder() .eventType(EventType.CREATE_FLOW_VERSION) .addField(EventFieldName.BUCKET_ID, versionedFlowSnapshot.getSnapshotMetadata().getBucketIdentifier()) .addField(EventFieldName.FLOW_ID, versionedFlowSnapshot.getSnapshotMetadata().getFlowIdentifier()) .addField(EventFieldName.VERSION, String.valueOf(versionedFlowSnapshot.getSnapshotMetadata().getVersion())) .addField(EventFieldName.USER, versionedFlowSnapshot.getSnapshotMetadata().getAuthor()) .addField(EventFieldName.COMMENT, versionComments) .build(); }
public Builder(final Bucket bucket, final VersionedFlow versionedFlow, final VersionedFlowSnapshotMetadata snapshotMetadata) { bucketId(bucket.getIdentifier()); bucketName(bucket.getName()); flowId(snapshotMetadata.getFlowIdentifier()); flowName(versionedFlow.getName()); version(snapshotMetadata.getVersion()); comments(snapshotMetadata.getComments()); author(snapshotMetadata.getAuthor()); snapshotTimestamp(snapshotMetadata.getTimestamp()); }