MCPcopy Create free account
hub / github.com/annmuor/jnode / rescan

Method rescan

jnode-core/src/jnode/robot/AreaFix.java:354–386  ·  view source on GitHub ↗
(Link link, String area, int num)

Source from the content-addressed store, hash-verified

352 }
353
354 private String rescan(Link link, String area, int num) throws SQLException {
355 StringBuilder sb = new StringBuilder();
356 String like = area.replace("*", "%");
357 List<Echoarea> areas = ORMManager.get(Echoarea.class).getAnd("name",
358 "~", like);
359 if (areas.isEmpty()) {
360 sb.append(area);
361 sb.append(" not found");
362 } else {
363 for (Echoarea earea : areas) {
364 sb.append(earea.getName());
365 Subscription sub = ORMManager.get(Subscription.class)
366 .getFirstAnd("echoarea_id", "=", earea.getId(),
367 "link_id", "=", link.getId());
368 if (sub == null) {
369 sb.append(" is not subscribed");
370 } else {
371 List<Echomail> mails = ORMManager.get(Echomail.class)
372 .getOrderLimitAnd(num, "id", false, "echoarea_id",
373 "=", earea);
374 for (int i = mails.size() - 1; i >= 0; --i) {
375 Echomail mail = mails.get(i);
376 ORMManager.get(EchomailAwaiting.class).save(
377 new EchomailAwaiting(link, mail));
378 }
379 sb.append(" rescanned " + mails.size() + " messages");
380 }
381 sb.append('\n');
382 }
383 }
384 sb.append('\n');
385 return sb.toString();
386 }
387
388 @Override
389 protected String getRobotName() {

Callers 1

executeMethod · 0.95

Calls 10

getMethod · 0.95
getAndMethod · 0.80
isEmptyMethod · 0.80
appendMethod · 0.80
getFirstAndMethod · 0.80
getOrderLimitAndMethod · 0.80
saveMethod · 0.80
getIdMethod · 0.65
getNameMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected