public void findAttackerAndUpdate(String addressOfNotification, boolean status) { /** * The address of the endpoint is extracted from the received notification. e.g. * http://127.0.0.1:8089/ms/clients/endpointIDhere/12207/0/14/observe The endpointID is the * extracted by splitting */ String endpoint = addressOfNotification.split("/")[5]; ArrayList<AttackerModel> attackers = ReadAttackers.getAttackers(); for (AttackerModel attacker : attackers) { if (attacker.getClient().getEndpoint().contains(endpoint)) { attacker.setThreatDestroyed(status); break; } } }