@Override public Fetcher aggregate(UUID uuid, Selection selection) throws NoSuchAggregationException, NoSuchFieldInRelationException, SuspendedAggregatingException { return aggregate(uuid, selection, true); }
@Override public Integer call() throws BrowseException { return aggregatedCount(uuid, (selection == null) ? null : selection.getCondition()); } };
@Override public Integer call() throws NoSuchFieldInRelationException, NoSuchRelationException { return count(finalQuery.getCondition()); } };
@Override public void addAll(Serializable[]... tuples) throws NoSuchRelationException { List<BasicEdit> ops = new ArrayList<BasicEdit>(tuples.length); for (Serializable[] tuple : tuples) ops.add(new AddTuple(tuple)); EditDataResponse resp = browser.editData(editRequest(new BatchEdit(ops))); checkOther(check(resp, NoSuchRelationException.class)); }
@Override public Relation relation(final String name) throws NoSuchRelationException { // log.info("OLD-BROWSE: relation({})", name); final RelationsInfoResponse resp = service.getRelationsInfo(new RelationsInfoRequest(name)); checkOther(resp); final RelationInfo info = resp.getInfo(name); if (info == null) { throw new NoSuchRelationException(name); } return new RelationImpl(service, info, showWorkingCopyData); }
final Selection finalQuery; if (info.hasWorkingCopyData()) { Condition publishingStatusCondition=getPublishingStatusCondition(); Condition queryCondition = query.getCondition(); queryCondition = queryCondition.and(publishingStatusCondition);
@Override public void add(Serializable... fields) throws NoSuchRelationException { EditDataResponse resp = browser.editData(editRequest(new AddTuple(fields))); checkOther(check(resp, NoSuchRelationException.class)); }
@Override public Relation relation(final String name, final String[] tags) throws NoSuchRelationException { // log.info("OLD-BROWSE: relation({}, {})", name, tags); final RelationsInfoResponse resp = service.getRelationsInfo(new RelationsInfoRequest(new String[] { name }, tags)); checkOther(resp); final RelationInfo info = resp.getInfo(name); if (info == null) { throw new NoSuchRelationException(name); } return new RelationImpl(service, info, showWorkingCopyData); }
@Override public int count(Condition condition) throws NoSuchFieldInRelationException, NoSuchRelationException { if (info.hasWorkingCopyData()) { Condition publishingStatusCondition=getPublishingStatusCondition(); condition = condition.and(publishingStatusCondition); } CountResponse resp = browser.count(new CountRequest(Query.count(info.getName()).where(condition))); checkOther(check(check(resp, NoSuchRelationException.class), NoSuchFieldInRelationException.class)); return resp.getCount(); }
@Override public int update(Condition condition, Serializable[] tuple) throws NoSuchFieldInRelationException, NoSuchRelationException { EditDataResponse resp = browser.editData(editRequest(new UpdateTuples(condition, tuple))); checkOther(check(check(resp, NoSuchRelationException.class), NoSuchFieldInRelationException.class)); return resp.getCount(); }
@Override public Relation create(final RelationInfo relation) throws InvalidNameException { // log.info("OLD-BROWSE: create"); final EditStructureResponse resp = service .editStructure(new EditStructureRequest(new CreateRelation(relation))); checkOther(check(resp, InvalidNameException.class)); return new RelationImpl(service, resp.getInfo(), showWorkingCopyData); }
@Override public int delete(Condition condition) throws NoSuchFieldInRelationException, NoSuchRelationException { EditDataResponse resp = browser.editData(editRequest(new DeleteTuples(condition))); checkOther(check(check(resp, NoSuchRelationException.class), NoSuchFieldInRelationException.class)); return resp.getCount(); }
@Override public int addOrUpdate(Condition condition, Serializable[] tuple) throws NoSuchFieldInRelationException, NoSuchRelationException { EditDataResponse resp = browser.editData(editRequest(new UpdateTuples(condition, tuple, true))); checkOther(check(check(resp, NoSuchRelationException.class), NoSuchFieldInRelationException.class)); return resp.getCount(); }