@Component public class BlockingManagerImpl extends Object implements BlockingManager, org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
| Constructor and Description |
|---|
BlockingManagerImpl(org.springframework.context.ApplicationEventPublisher publisher,
org.springframework.amqp.core.DirectExchange rpcExchange,
org.springframework.amqp.rabbit.core.RabbitTemplate template,
org.springframework.amqp.rabbit.AsyncRabbitTemplate asyncTemplate) |
| Modifier and Type | Method and Description |
|---|---|
void |
fetchBlacklist()
Fetches blacklist.
|
Map<String,io.bitsensor.lib.entity.BlockedAttacker> |
getBlacklist()
Returns a map of blocked attackers stored in memory.
|
io.bitsensor.lib.entity.BlockedAttacker |
getBlocking(String id)
Returns a blocked attacker stored in the blacklist map.
|
void |
onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event) |
void |
receiveAdd(io.bitsensor.lib.entity.Identifiable<io.bitsensor.lib.entity.BlockedAttacker> attacker) |
void |
receiveDelete(String id) |
void |
receiveUpdate(io.bitsensor.lib.entity.Identifiable<io.bitsensor.lib.entity.BlockedAttacker> attacker) |
@Autowired
public BlockingManagerImpl(org.springframework.context.ApplicationEventPublisher publisher,
org.springframework.amqp.core.DirectExchange rpcExchange,
org.springframework.amqp.rabbit.core.RabbitTemplate template,
org.springframework.amqp.rabbit.AsyncRabbitTemplate asyncTemplate)
public Map<String,io.bitsensor.lib.entity.BlockedAttacker> getBlacklist()
BlockingManagergetBlacklist in interface BlockingManagerpublic io.bitsensor.lib.entity.BlockedAttacker getBlocking(String id)
BlockingManagergetBlocking in interface BlockingManagerid - identifier of the blocked attacker which was generated when added the blocked attacker to
Elasticsearch.public void fetchBlacklist()
BlockingManagerfetchBlacklist in interface BlockingManager@RabbitListener(queues="#{blacklistAddQueue.name}")
public void receiveAdd(io.bitsensor.lib.entity.Identifiable<io.bitsensor.lib.entity.BlockedAttacker> attacker)
throws InterruptedException
InterruptedException@RabbitListener(queues="#{blacklistUpdateQueue.name}")
public void receiveUpdate(io.bitsensor.lib.entity.Identifiable<io.bitsensor.lib.entity.BlockedAttacker> attacker)
throws InterruptedException
InterruptedException@RabbitListener(queues="#{blacklistDeleteQueue.name}")
public void receiveDelete(String id)
throws InterruptedException
InterruptedExceptionpublic void onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event)
onApplicationEvent in interface org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>Copyright © 2018 BitSensor. All rights reserved.