- public LLDPSpeaker(final PacketProcessingService packetProcessingService, final MacAddress addressDestionation) {
- this(packetProcessingService, Executors.newSingleThreadScheduledExecutor(), addressDestionation);
+ public LLDPSpeaker(final PacketProcessingService packetProcessingService, final MacAddress addressDestionation,
+ final DeviceOwnershipService deviceOwnershipService) {
+ this(packetProcessingService, Executors.newSingleThreadScheduledExecutor(THREAD_FACTORY), addressDestionation,
+ deviceOwnershipService);
+ }
+
+ public LLDPSpeaker(final PacketProcessingService packetProcessingService,
+ final ScheduledExecutorService scheduledExecutorService,
+ final MacAddress addressDestionation,
+ final DeviceOwnershipService deviceOwnershipStatusService) {
+ this.addressDestionation = addressDestionation;
+ this.scheduledExecutorService = scheduledExecutorService;
+ this.deviceOwnershipService = deviceOwnershipStatusService;
+ scheduledSpeakerTask = this.scheduledExecutorService
+ .scheduleAtFixedRate(this, LLDP_FLOOD_PERIOD,LLDP_FLOOD_PERIOD, TimeUnit.SECONDS);
+ this.packetProcessingService = packetProcessingService;
+ LOG.info("LLDPSpeaker started, it will send LLDP frames each {} seconds", LLDP_FLOOD_PERIOD);