/**
* Created by Martin Bobak <mbobak@cisco.com> on 20.4.2015.
*/
-public interface MessageIntelligenceAgency<M> extends MessageSpy<M> {
+public interface MessageIntelligenceAgency extends MessageSpy {
List<String> provideIntelligence();
}
/**
* Created by Martin Bobak <mbobak@cisco.com> on 20.4.2015.
*/
-public interface MessageSpy<M> extends Runnable {
+public interface MessageSpy extends Runnable {
/**
* statistic groups overall in OFPlugin
* @param message from switch or to switch - depends on statGroup
* @param statGroup
*/
- void spyMessage(M message, STATISTIC_GROUP statGroup);
+ void spyMessage(Class<?> message, STATISTIC_GROUP statGroup);
}
private final Map<Queue<T>, SettableFuture<Void>> throttledQueues = new ConcurrentHashMap<>();
private final ThreadPoolLoggingExecutor throttleWorkerPool;
private final NotificationPublishService notificationPublishService;
- private final MessageSpy<Class<?>> messageIntelligenceAgency;
+ private final MessageSpy messageIntelligenceAgency;
private boolean finishing = false;
private CountDownLatch sleeperLatch = new CountDownLatch(0);
* @param notificationPublishService
* @param messageIntelligenceAgency
*/
- public ThrottledNotificationsOffererImpl(final NotificationPublishService notificationPublishService, final MessageSpy<Class<?>> messageIntelligenceAgency) {
+ public ThrottledNotificationsOffererImpl(final NotificationPublishService notificationPublishService, final MessageSpy messageIntelligenceAgency) {
this.notificationPublishService = notificationPublishService;
this.messageIntelligenceAgency = messageIntelligenceAgency;
throttleWorkerPool = new ThreadPoolLoggingExecutor(
private final DeviceMeterRegistry deviceMeterRegistry;
private Timeout barrierTaskTimeout;
private NotificationService notificationService;
- private final MessageSpy<Class<?>> messageSpy;
+ private final MessageSpy messageSpy;
private DeviceDisconnectedHandler deviceDisconnectedHandler;
private final Collection<DeviceContextClosedHandler> closeHandlers = new HashSet<>();
private NotificationPublishService notificationPublishService;
* Class counts message of {@link org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageSpy.STATISTIC_GROUP} type
* and provides info as debug log.
*/
-public class MessageIntelligenceAgencyImpl implements MessageIntelligenceAgency<Class<?>>, MessageIntelligenceAgencyMXBean {
+public class MessageIntelligenceAgencyImpl implements MessageIntelligenceAgency, MessageIntelligenceAgencyMXBean {
private static final Logger LOG = LoggerFactory.getLogger(MessageIntelligenceAgencyImpl.class);
private static final class MessageCounters {
private static final AtomicLongFieldUpdater<MessageCounters> UPDATER = AtomicLongFieldUpdater.newUpdater(MessageCounters.class, "current");
+ @SuppressWarnings("unused")
private volatile long current;
private long cumulative;
@Override
public void spyMessage(@Nonnull final Class<?> message, final STATISTIC_GROUP statGroup) {
- Preconditions.checkNotNull(message,"Message can't be null.");
+ Preconditions.checkNotNull(message, "Message can't be null.");
getCounters(message, statGroup).increment();
}