use of com.b2international.index.revision.Commit in project snow-owl by b2ihealthcare.
the class Rf2TransactionContext method commit.
@Override
public Optional<Commit> commit(String commitComment) {
final Set<String> idsToRegister = ImmutableSet.copyOf(newComponents.keySet().stream().filter(SnomedIdentifiers::isValid).iterator());
// clear local cache before executing commit
newComponents = newHashMap();
LOG.info("Pushing changes: {}", commitComment);
Optional<Commit> commit = getDelegate().commit(commitComment);
// after successful commit register all commited IDs to CIS
final ISnomedIdentifierService cis = service(ISnomedIdentifierService.class);
if (cis.importSupported()) {
cis.register(idsToRegister);
}
return commit;
}
use of com.b2international.index.revision.Commit in project snow-owl by b2ihealthcare.
the class CommitInfoConverter method toResource.
@Override
protected CommitInfo toResource(final Commit doc) {
final Builder builder = CommitInfo.builder(doc);
// expand details if requested
if (expand().containsKey(CommitInfo.Expand.DETAILS)) {
final Options detailsExpandOptions = expand().get(CommitInfo.Expand.DETAILS, Options.class);
final Collection<CommitDetail> commitDetails = getCommitDetails(doc, detailsExpandOptions);
final List<CommitInfoDetail> commitInfoDetails = commitDetails.stream().flatMap(info -> toCommitInfoDetail(info)).collect(Collectors.toList());
builder.details(new CommitInfoDetails(commitInfoDetails, null, commitInfoDetails.size(), commitInfoDetails.size()));
}
return builder.build();
}
Aggregations