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

Method rem

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

Source from the content-addressed store, hash-verified

324 }
325
326 private String rem(Link link, String area) throws SQLException {
327 StringBuilder sb = new StringBuilder();
328 String like = area.replace("*", "%");
329 List<Echoarea> areas = ORMManager.get(Echoarea.class).getAnd("name",
330 "~", like);
331 if (areas.isEmpty()) {
332 sb.append(area);
333 sb.append(" not found");
334 } else {
335 for (Echoarea earea : areas) {
336 sb.append(earea.getName());
337 Subscription sub = ORMManager.get(Subscription.class)
338 .getFirstAnd("echoarea_id", "=", earea.getId(),
339 "link_id", "=", link.getId());
340 if (sub == null) {
341 sb.append(" is not subscribed");
342 } else {
343 ORMManager.get(Subscription.class).delete("link_id", "=",
344 link, "echoarea_id", "=", earea);
345 sb.append(" unsubscribed");
346 }
347 sb.append('\n');
348 }
349 }
350 sb.append('\n');
351 return sb.toString();
352 }
353
354 private String rescan(Link link, String area, int num) throws SQLException {
355 StringBuilder sb = new StringBuilder();

Callers 1

executeMethod · 0.95

Calls 9

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

Tested by

no test coverage detected