Search in sources :

Example 6 with BaseRevisionBranching

use of com.b2international.index.revision.BaseRevisionBranching in project snow-owl by b2ihealthcare.

the class BranchSearchRequest method expand.

private void expand(RepositoryContext context, List<Branch> branchHits) {
    if (branchHits.isEmpty())
        return;
    if (expand().containsKey(Branch.Expand.CHILDREN)) {
        final BaseRevisionBranching branching = context.service(BaseRevisionBranching.class);
        for (Branch branchHit : branchHits) {
            final List<Branch> children = toBranchData(branching, branching.getChildren(branchHit.path()));
            branchHit.setChildren(new Branches(children, null, children.size(), children.size()));
        }
    }
}
Also used : RevisionBranch(com.b2international.index.revision.RevisionBranch) BaseRevisionBranching(com.b2international.index.revision.BaseRevisionBranching)

Example 7 with BaseRevisionBranching

use of com.b2international.index.revision.BaseRevisionBranching in project snow-owl by b2ihealthcare.

the class SnomedExtensionUpgradeTest method assertState.

private void assertState(String branchPath, String compareWith, BranchState expectedState) {
    BaseRevisionBranching branching = ApplicationContext.getServiceForClass(RepositoryManager.class).get(SnomedTerminologyComponentConstants.TOOLING_ID).service(BaseRevisionBranching.class);
    assertEquals(expectedState, branching.getBranchState(branchPath, compareWith));
}
Also used : BaseRevisionBranching(com.b2international.index.revision.BaseRevisionBranching)

Aggregations

BaseRevisionBranching (com.b2international.index.revision.BaseRevisionBranching)7 RevisionBranch (com.b2international.index.revision.RevisionBranch)6 BranchState (com.b2international.index.revision.RevisionBranch.BranchState)2 BranchInfo (com.b2international.snowowl.core.branch.BranchInfo)2 NotFoundException (com.b2international.commons.exceptions.NotFoundException)1 ExtendedLocale (com.b2international.commons.http.ExtendedLocale)1 Options (com.b2international.commons.options.Options)1 RevisionSegment (com.b2international.index.revision.RevisionSegment)1 RepositoryManager (com.b2international.snowowl.core.RepositoryManager)1 ResourceURI (com.b2international.snowowl.core.ResourceURI)1 RepositoryContext (com.b2international.snowowl.core.domain.RepositoryContext)1 ResourceDocument (com.b2international.snowowl.core.internal.ResourceDocument)1 BaseResourceConverter (com.b2international.snowowl.core.request.BaseResourceConverter)1 ResourceRequests (com.b2international.snowowl.core.request.ResourceRequests)1 ResourceURIPathResolver (com.b2international.snowowl.core.uri.ResourceURIPathResolver)1 Version (com.b2international.snowowl.core.version.Version)1 Versions (com.b2international.snowowl.core.version.Versions)1 Strings (com.google.common.base.Strings)1 Lists (com.google.common.collect.Lists)1 Maps (com.google.common.collect.Maps)1