Search in sources :

Example 1 with NodeCommitEntries

use of com.enonic.xp.node.NodeCommitEntries in project xp by enonic.

the class RepoDumper method dumpCommits.

private void dumpCommits() {
    writer.openCommitsMeta(repository.getId());
    try {
        final NodeCommitQuery nodeCommitQuery = NodeCommitQuery.create().size(-1).build();
        final NodeCommitEntries nodeCommitEntries = this.nodeService.findCommits(nodeCommitQuery).getNodeCommitEntries();
        nodeCommitEntries.stream().map(nodeCommitEntry -> CommitDumpEntry.create().nodeCommitId(nodeCommitEntry.getNodeCommitId()).message(nodeCommitEntry.getMessage()).committer(nodeCommitEntry.getCommitter()).timestamp(nodeCommitEntry.getTimestamp()).build()).forEach(writer::writeCommitEntry);
    } finally {
        writer.closeMeta();
    }
}
Also used : ChildOrder(com.enonic.xp.index.ChildOrder) RefreshMode(com.enonic.xp.node.RefreshMode) NodeVersionQuery(com.enonic.xp.node.NodeVersionQuery) SystemDumpListener(com.enonic.xp.dump.SystemDumpListener) GetActiveNodeVersionsParams(com.enonic.xp.node.GetActiveNodeVersionsParams) DumpError(com.enonic.xp.dump.DumpError) Node(com.enonic.xp.node.Node) LoggerFactory(org.slf4j.LoggerFactory) BranchDumpResult(com.enonic.xp.dump.BranchDumpResult) NodeCommitEntries(com.enonic.xp.node.NodeCommitEntries) BlobKey(com.enonic.xp.blob.BlobKey) Branch(com.enonic.xp.branch.Branch) HashSet(java.util.HashSet) ContextAccessor(com.enonic.xp.context.ContextAccessor) NodeVersionMetadata(com.enonic.xp.node.NodeVersionMetadata) NodeService(com.enonic.xp.node.NodeService) NodeVersionId(com.enonic.xp.node.NodeVersionId) Duration(java.time.Duration) NodeVersionQueryResult(com.enonic.xp.node.NodeVersionQueryResult) RepoDumpResult(com.enonic.xp.dump.RepoDumpResult) ContextBuilder(com.enonic.xp.context.ContextBuilder) RangeFilter(com.enonic.xp.query.filter.RangeFilter) Value(com.enonic.xp.data.Value) Logger(org.slf4j.Logger) BranchDumpEntry(com.enonic.xp.repo.impl.dump.model.BranchDumpEntry) Collection(java.util.Collection) NodeVersionKey(com.enonic.xp.blob.NodeVersionKey) Set(java.util.Set) ValueFactory(com.enonic.xp.data.ValueFactory) VersionsDumpEntry(com.enonic.xp.repo.impl.dump.model.VersionsDumpEntry) Instant(java.time.Instant) Branches(com.enonic.xp.branch.Branches) Collectors(java.util.stream.Collectors) AttachedBinary(com.enonic.xp.node.AttachedBinary) NodeId(com.enonic.xp.node.NodeId) Objects(java.util.Objects) Consumer(java.util.function.Consumer) DumpWriter(com.enonic.xp.repo.impl.dump.writer.DumpWriter) CommitDumpEntry(com.enonic.xp.repo.impl.dump.model.CommitDumpEntry) FindNodesByParentResult(com.enonic.xp.node.FindNodesByParentResult) NodeVersion(com.enonic.xp.node.NodeVersion) Context(com.enonic.xp.context.Context) NodeCommitQuery(com.enonic.xp.node.NodeCommitQuery) FindNodesByParentParams(com.enonic.xp.node.FindNodesByParentParams) RepositoryConstants(com.enonic.xp.repository.RepositoryConstants) Repository(com.enonic.xp.repository.Repository) NodeCommitQuery(com.enonic.xp.node.NodeCommitQuery) NodeCommitEntries(com.enonic.xp.node.NodeCommitEntries)

Example 2 with NodeCommitEntries

use of com.enonic.xp.node.NodeCommitEntries in project xp by enonic.

the class NodeCommitQueryResultFactory method create.

public static NodeCommitQueryResult create(final NodeCommitQuery query, final SearchResult searchResult) {
    final NodeCommitQueryResult.Builder nodeCommitQueryResult = NodeCommitQueryResult.create();
    nodeCommitQueryResult.hits(searchResult.getHits().getSize());
    nodeCommitQueryResult.totalHits(searchResult.getTotalHits());
    nodeCommitQueryResult.from(query.getFrom());
    nodeCommitQueryResult.to(query.getSize());
    final NodeCommitEntries nodeCommitEntries = buildNodeCommitEntries(query, searchResult);
    nodeCommitQueryResult.nodeCommitEntries(nodeCommitEntries);
    return nodeCommitQueryResult.build();
}
Also used : NodeCommitEntries(com.enonic.xp.node.NodeCommitEntries) NodeCommitQueryResult(com.enonic.xp.node.NodeCommitQueryResult)

Aggregations

NodeCommitEntries (com.enonic.xp.node.NodeCommitEntries)2 BlobKey (com.enonic.xp.blob.BlobKey)1 NodeVersionKey (com.enonic.xp.blob.NodeVersionKey)1 Branch (com.enonic.xp.branch.Branch)1 Branches (com.enonic.xp.branch.Branches)1 Context (com.enonic.xp.context.Context)1 ContextAccessor (com.enonic.xp.context.ContextAccessor)1 ContextBuilder (com.enonic.xp.context.ContextBuilder)1 Value (com.enonic.xp.data.Value)1 ValueFactory (com.enonic.xp.data.ValueFactory)1 BranchDumpResult (com.enonic.xp.dump.BranchDumpResult)1 DumpError (com.enonic.xp.dump.DumpError)1 RepoDumpResult (com.enonic.xp.dump.RepoDumpResult)1 SystemDumpListener (com.enonic.xp.dump.SystemDumpListener)1 ChildOrder (com.enonic.xp.index.ChildOrder)1 AttachedBinary (com.enonic.xp.node.AttachedBinary)1 FindNodesByParentParams (com.enonic.xp.node.FindNodesByParentParams)1 FindNodesByParentResult (com.enonic.xp.node.FindNodesByParentResult)1 GetActiveNodeVersionsParams (com.enonic.xp.node.GetActiveNodeVersionsParams)1 Node (com.enonic.xp.node.Node)1