metadata.setBucketIdentifier(versionedFlow.getBucketIdentifier()); metadata.setFlowIdentifier(flowId); metadata.setVersion(version); metadata.setComments(deserializedSnapshot.getSnapshotMetadata().getComments());
@Override public VersionedFlowSnapshot registerVersionedFlowSnapshot(final VersionedFlow flow, final VersionedProcessGroup snapshot, final String comments, final int expectedVersion, final NiFiUser user) throws IOException, NiFiRegistryException { final FlowSnapshotClient snapshotClient = getFlowSnapshotClient(user); final VersionedFlowSnapshot versionedFlowSnapshot = new VersionedFlowSnapshot(); versionedFlowSnapshot.setFlowContents(snapshot); final VersionedFlowSnapshotMetadata metadata = new VersionedFlowSnapshotMetadata(); metadata.setBucketIdentifier(flow.getBucketIdentifier()); metadata.setFlowIdentifier(flow.getIdentifier()); metadata.setAuthor(getIdentity(user)); metadata.setTimestamp(System.currentTimeMillis()); metadata.setVersion(expectedVersion); metadata.setComments(comments); versionedFlowSnapshot.setSnapshotMetadata(metadata); return snapshotClient.create(versionedFlowSnapshot); }
destMetadata.setBucketIdentifier(destFlow.getBucketIdentifier()); destMetadata.setFlowIdentifier(destFlowId); destMetadata.setVersion(srcVersion); destMetadata.setComments(srcFlowSnapshot.getSnapshotMetadata().getComments());
destMetadata.setBucketIdentifier(destFlow.getBucketIdentifier()); destMetadata.setFlowIdentifier(destFlowId); destMetadata.setVersion(destFlowVersion); destMetadata.setComments(srcSnapshot.getSnapshotMetadata().getComments());
public static VersionedFlowSnapshotMetadata map(final BucketEntity bucketEntity, final FlowSnapshotEntity flowSnapshotEntity) { final VersionedFlowSnapshotMetadata metadata = new VersionedFlowSnapshotMetadata(); metadata.setFlowIdentifier(flowSnapshotEntity.getFlowId()); metadata.setVersion(flowSnapshotEntity.getVersion()); metadata.setComments(flowSnapshotEntity.getComments()); metadata.setTimestamp(flowSnapshotEntity.getCreated().getTime()); metadata.setAuthor(flowSnapshotEntity.getCreatedBy()); if (bucketEntity != null) { metadata.setBucketIdentifier(bucketEntity.getId()); } return metadata; }