19 package org.turro.warnings;
21 import java.util.ArrayList;
22 import java.util.Collections;
23 import java.util.List;
24 import org.turro.alliance.service.AxConstants;
25 import org.turro.alliance.service.AxServer;
26 import org.turro.annotation.ElephantWarning;
27 import org.turro.elephant.context.Application;
28 import org.turro.i18n.I_;
29 import org.turro.json.JsonSearch;
30 import org.turro.json.Jsons;
31 import org.turro.ws.service.member.Servers;
42 return I_.
get(
"Alliance");
50 return Collections.EMPTY_LIST;
53 private List<IWarning> createModel() {
54 List<IWarning> warnings =
new ArrayList<>();
56 Jsons request = Jsons.object();
57 Jsons requests = Servers.getData(server,
AxConstants.AXPENDING_REQUESTS, request);
58 if(!Jsons.isEmpty(requests)) requests.getStructure().asArray().forEach(axr -> {
59 checkParticipantRequest(warnings, Jsons.read(axr.toString()).search());
65 private void checkParticipantRequest(List<IWarning> warnings, JsonSearch request) {
66 Warning warning =
new Warning();
67 warning.setEntity(
null);
68 warning.addMessage(I_.format(
"Pending request from %s (%s)", request.read(
"$.name"), request.read(
"$.memberName")));
69 if(!warning.getMessages().isEmpty()) {
70 warnings.add(warning);
static final String SERVER_SERVICE
boolean isInRole(String role)
static Application getApplication()
static String get(String msg)
List< IWarning > getWarnings()