planOperation(); } else {
planOperation(); } else {
@Override public Object step(int step) throws Cancel { helper.assertStep(step); try { switch (step) { case 0: final SetMultimap<String, Long> targetMultimap = graphHelper.getTargetMultimap(targetClasses, targetObjects); targetObjectCount += targetMultimap.size(); final Entry<SetMultimap<String, Long>, SetMultimap<String, Long>> plan = graphTraversal.planOperation(targetMultimap, true, true); if (!plan.getValue().isEmpty()) { final Exception e = new IllegalStateException("querying the model graph does not delete any objects"); helper.cancel(new ERR(), e, "graph-fail"); } return plan.getKey(); default: final Exception e = new IllegalArgumentException("model object graph operation has no step " + step); throw helper.cancel(new ERR(), e, "bad-step"); } } catch (Cancel c) { throw c; } catch (GraphException ge) { final omero.cmd.GraphException graphERR = new omero.cmd.GraphException(); graphERR.message = ge.message; throw helper.cancel(graphERR, ge, "graph-fail"); } catch (Throwable t) { throw helper.cancel(new ERR(), t, "graph-fail"); } }
@Override public Object step(int step) throws Cancel { helper.assertStep(step); try { switch (step) { case 0: final SetMultimap<String, Long> targetMultimap = graphHelper.getTargetMultimap(targetClasses, targetObjects); targetObjectCount += targetMultimap.size(); final Entry<SetMultimap<String, Long>, SetMultimap<String, Long>> plan = graphTraversal.planOperation(targetMultimap, true, true); if (!plan.getValue().isEmpty()) { final Exception e = new IllegalStateException("querying the model graph does not delete any objects"); helper.cancel(new ERR(), e, "graph-fail"); } return plan.getKey(); default: final Exception e = new IllegalArgumentException("model object graph operation has no step " + step); throw helper.cancel(new ERR(), e, "bad-step"); } } catch (Cancel c) { throw c; } catch (GraphException ge) { final omero.cmd.GraphException graphERR = new omero.cmd.GraphException(); graphERR.message = ge.message; throw helper.cancel(graphERR, ge, "graph-fail"); } catch (Throwable t) { throw helper.cancel(new ERR(), t, "graph-fail"); } }
if (isToGroupReadable) { plan = graphTraversal.planOperation(targetMultimap, true, false); } else { plan = graphTraversal.planOperation(targetsNotPrivate, true, true);
case 1: final Map.Entry<SetMultimap<String, Long>, SetMultimap<String, Long>> plan = graphTraversal.planOperation(targetMultimap, true, true); targetMultimap.clear(); if (plan.getValue().isEmpty()) {
targetObjectCount += targetMultimap.size(); final Entry<SetMultimap<String, Long>, SetMultimap<String, Long>> plan = graphTraversal.planOperation(targetMultimap, true, true); return Maps.immutableEntry(plan.getKey(), GraphUtil.arrangeDeletionTargets(helper.getSession(), plan.getValue())); case 2:
targetObjectCount += targetMultimap.size(); final Entry<SetMultimap<String, Long>, SetMultimap<String, Long>> plan = graphTraversal.planOperation(targetMultimap, true, true); return Maps.immutableEntry(plan.getKey(), GraphUtil.arrangeDeletionTargets(helper.getSession(), plan.getValue())); case 1:
targetObjectCount += targetMultimap.size(); final Entry<SetMultimap<String, Long>, SetMultimap<String, Long>> plan = graphTraversal.planOperation(targetMultimap, false, true); if (!plan.getKey().isEmpty()) { final Exception e = new IllegalStateException("deletion does not do anything other than delete");
targetObjectCount += targetMultimap.size(); final Entry<SetMultimap<String, Long>, SetMultimap<String, Long>> plan = graphTraversal.planOperation(targetMultimap, true, true); if (plan.getValue().isEmpty()) { graphTraversal.assertNoUnlinking();