19 package org.turro.alliance.client;
21 import org.turro.alliance.service.AxConstants;
22 import org.turro.alliance.service.AxServer;
23 import org.turro.json.Jsons;
24 import org.turro.string.Strings;
25 import org.turro.ws.WsServer;
26 import org.turro.ws.service.WsConstants;
27 import org.turro.ws.service.member.Servers;
37 AxConstants.PROJECT, Jsons.object().add(
"id", correctId(axId)));
42 AxConstants.PARTICIPATIONS, Jsons.object().add(
"id", correctId(axId)));
47 AxConstants.AXPARTICIPATIONS, Jsons.object().add(
"id", correctId(axId)));
52 AxConstants.AXPARTICIPATIONS, Jsons.object().add(
"id", correctId(axId)).add(
"as", as));
57 AxConstants.AXPARTICIPATIONS, Jsons.object().add(
"full",
true));
62 AxConstants.AXPENDING_REQUESTS, Jsons.object().add(
"id", correctId(axId)));
65 public Jsons
status(String axId, String contactId, String as) {
68 .add(
"contactId", contactId)
69 .add(
"axId", correctId(axId))
73 public Jsons
hasRequested(String axId, String contactId, String as) {
75 AxConstants.AXPARTICIPATION_REQUESTED, Jsons.object()
76 .add(
"contactId", contactId)
77 .add(
"axId", correctId(axId))
83 private String correctId(String axId) {
84 if(!Strings.isBlank(axId) && !axId.contains(
"##")) {
85 Jsons memberInfo = Servers.getData(server, WsConstants.CLIENT_INFO);
86 if(!Jsons.isEmpty(memberInfo)) axId +=
"##" + memberInfo.getLong(
"id");
100 this.server = server;
Jsons status(String axId, String contactId, String as)
Jsons axParticipations(String axId)
static Projects from(WsServer server)
Jsons project(String axId)
Jsons axParticipations(String axId, String as)
Jsons axPendingRequests(String axId)
Jsons hasRequested(String axId, String contactId, String as)
Jsons participations(String axId)
static final String SERVER_SERVICE
static WsServer from(String serverDomain, String service)