@Override
protected void filteredDispatch(String aType, String aTextMessage) {
System.out.println("AllPhoneNumbersListed (to match)...");
NotificationReader reader = new NotificationReader(aTextMessage);
String allPhoneNumbers = reader.eventStringValue("allPhoneNumbers");
String[] allPhoneNumbersToSearch = allPhoneNumbers.split("\n");
String foundPhoneNumbers = "";
for (String phoneNumber : allPhoneNumbersToSearch) {
if (phoneNumber.contains("303-")) {
if (!foundPhoneNumbers.isEmpty()) {
foundPhoneNumbers = foundPhoneNumbers + "\n";
}
foundPhoneNumbers = foundPhoneNumbers + phoneNumber;
}
}
Notification notification =
new Notification(
1L,
new PhoneNumbersMatched(
reader.eventStringValue("processId"),
foundPhoneNumbers));
send(notification);
}