Search in sources :

Example 1 with Pingable

use of ddf.catalog.operation.Pingable in project ddf by codice.

the class ListCommand method printSubscription.

private void printSubscription(Map.Entry<String, ServiceReference<Subscription>> entry) {
    PrintStream console = System.out;
    Subscription subscription = bundleContext.getService(entry.getValue());
    String rowColor = "";
    if (subscription != null && subscription.getDeliveryMethod() instanceof Pingable && !((Pingable) subscription.getDeliveryMethod()).ping()) {
        rowColor = RED_CONSOLE_COLOR;
    }
    console.println(String.format("%s%s\t %s%s", rowColor, entry.getKey(), entry.getValue().getProperty("event-endpoint"), DEFAULT_CONSOLE_COLOR));
}
Also used : PrintStream(java.io.PrintStream) Pingable(ddf.catalog.operation.Pingable) Subscription(ddf.catalog.event.Subscription)

Aggregations

Subscription (ddf.catalog.event.Subscription)1 Pingable (ddf.catalog.operation.Pingable)1 PrintStream (java.io.PrintStream)1