(Client client, Object subHash, Object unsubHash, Object... optionalArgs)
| 14147 | } |
| 14148 | |
| 14149 | public void cleanUnsubscription(Client client, Object subHash, Object unsubHash, Object... optionalArgs) |
| 14150 | { |
| 14151 | Object subHashIsPrefix = Helpers.getArg(optionalArgs, 0, false); |
| 14152 | if (Helpers.isTrue(Helpers.inOp(client.subscriptions, unsubHash))) |
| 14153 | { |
| 14154 | ((java.util.Map<String,Object>)client.subscriptions).remove((String)unsubHash); |
| 14155 | } |
| 14156 | if (!Helpers.isTrue(subHashIsPrefix)) |
| 14157 | { |
| 14158 | if (Helpers.isTrue(Helpers.inOp(client.subscriptions, subHash))) |
| 14159 | { |
| 14160 | ((java.util.Map<String,Object>)client.subscriptions).remove((String)subHash); |
| 14161 | } |
| 14162 | if (Helpers.isTrue(Helpers.inOp(client.futures, subHash))) |
| 14163 | { |
| 14164 | var error = new UnsubscribeError(Helpers.add(Helpers.add(this.id, " "), subHash)); |
| 14165 | client.reject(error, subHash); |
| 14166 | } |
| 14167 | } else |
| 14168 | { |
| 14169 | Object clientSubscriptions = Helpers.objectKeys(client.subscriptions); |
| 14170 | for (var i = 0; Helpers.isLessThan(i, Helpers.getArrayLength(clientSubscriptions)); i++) |
| 14171 | { |
| 14172 | Object sub = Helpers.GetValue(clientSubscriptions, i); |
| 14173 | if (Helpers.isTrue(((String)sub).startsWith(((String)subHash)))) |
| 14174 | { |
| 14175 | ((java.util.Map<String,Object>)client.subscriptions).remove((String)sub); |
| 14176 | } |
| 14177 | } |
| 14178 | Object clientFutures = Helpers.objectKeys(client.futures); |
| 14179 | for (var i = 0; Helpers.isLessThan(i, Helpers.getArrayLength(clientFutures)); i++) |
| 14180 | { |
| 14181 | Object future = Helpers.GetValue(clientFutures, i); |
| 14182 | if (Helpers.isTrue(((String)future).startsWith(((String)subHash)))) |
| 14183 | { |
| 14184 | var error = new UnsubscribeError(Helpers.add(Helpers.add(this.id, " "), future)); |
| 14185 | client.reject(error, future); |
| 14186 | } |
| 14187 | } |
| 14188 | } |
| 14189 | client.resolve(true, unsubHash); |
| 14190 | } |
| 14191 | |
| 14192 | public void cleanCache(Object subscription) |
| 14193 | { |
no test coverage detected