use of com.enonic.xp.repo.impl.storage.GetResult in project xp by enonic.
the class BranchServiceImpl method doGetById.
private NodeBranchEntry doGetById(final NodeId nodeId, final InternalContext context) {
final GetByIdRequest getByIdRequest = createGetByIdRequest(nodeId, context);
final GetResult getResult = this.storageDao.getById(getByIdRequest);
if (getResult.isEmpty()) {
return null;
}
return NodeBranchVersionFactory.create(getResult.getReturnValues());
}
use of com.enonic.xp.repo.impl.storage.GetResult in project xp by enonic.
the class VersionServiceImpl method doGetById.
private NodeVersionMetadata doGetById(final NodeId nodeId, final NodeVersionId nodeVersionId, final InternalContext context) {
final GetByIdRequest getByIdRequest = GetByIdRequest.create().id(nodeVersionId.toString()).returnFields(VERSION_RETURN_FIELDS).storageSettings(createStorageSettings(context)).build();
final GetResult getResult = this.storageDao.getById(getByIdRequest);
if (getResult.isEmpty()) {
return null;
}
return NodeVersionFactory.create(getResult);
}
use of com.enonic.xp.repo.impl.storage.GetResult 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);
}
}
}
use of com.enonic.xp.repo.impl.storage.GetResult in project xp by enonic.
the class CommitServiceImpl method get.
@Override
public NodeCommitEntry get(final NodeCommitId nodeCommitId, final InternalContext context) {
final GetByIdRequest getByIdRequest = createGetByIdRequest(nodeCommitId, context);
final GetResult getResult = this.storageDao.getById(getByIdRequest);
if (getResult.isEmpty()) {
return null;
}
return NodeCommitEntryFactory.create(getResult.getReturnValues());
}
Aggregations