use of com.enonic.xp.repo.impl.storage.GetByIdsRequest in project xp by enonic.
the class GetBranchEntriesMethod method execute.
@Override
public void execute(final Collection<NodeId> nodeIds, final NodeBranchEntries.Builder builder) {
final GetByIdsRequest getByIdsRequest = new GetByIdsRequest();
for (final NodeId nodeId : nodeIds) {
getByIdsRequest.add(GetByIdRequest.create().id(new BranchDocumentId(nodeId, context.getBranch()).toString()).storageSettings(StorageSource.create().storageName(StoreStorageName.from(context.getRepositoryId())).storageType(StaticStorageType.BRANCH).build()).returnFields(returnFields).routing(nodeId.toString()).build());
}
final GetResults getResults = this.storageDao.getByIds(getByIdsRequest);
for (final GetResult getResult : getResults) {
if (!getResult.isEmpty()) {
final NodeBranchEntry nodeBranchEntry = NodeBranchVersionFactory.create(getResult.getReturnValues());
builder.add(nodeBranchEntry);
}
}
}
Aggregations