use of org.xel.peer.Peer in project elastic-core-maven by OrdinaryDude.
the class RemoveActivePeer method processRequest.
@Override
JSONStreamAware processRequest(HttpServletRequest req, User user) throws IOException {
if (Users.allowedUserHosts == null && !InetAddress.getByName(req.getRemoteAddr()).isLoopbackAddress()) {
return LOCAL_USERS_ONLY;
} else {
int index = Integer.parseInt(req.getParameter("peer"));
Peer peer = Users.getPeer(index);
if (peer != null && !peer.isBlacklisted()) {
peer.deactivate();
}
}
return null;
}
Aggregations