@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.rabbit.AsyncRabbitTemplate asyncTemplate) |
| Modifier and Type | Method and Description |
|---|---|
void |
fetchBlacklist()
Fetches blacklist.
|
Map<String,io.bitsensor.lib.entity.proto.Block> |
getBlacklist()
Returns a map of blocked attackers stored in memory.
|
io.bitsensor.lib.entity.proto.Block |
getBlock(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.proto.Block block) |
void |
receiveDelete(String id) |
void |
receiveUpdate(io.bitsensor.lib.entity.proto.Block block) |
@Autowired
public BlockingManagerImpl(org.springframework.context.ApplicationEventPublisher publisher,
org.springframework.amqp.rabbit.AsyncRabbitTemplate asyncTemplate)
public Map<String,io.bitsensor.lib.entity.proto.Block> getBlacklist()
BlockingManagergetBlacklist in interface BlockingManagerpublic io.bitsensor.lib.entity.proto.Block getBlock(String id)
BlockingManagergetBlock 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.proto.Block block)
@RabbitListener(queues="#{blacklistUpdateQueue.name}")
public void receiveUpdate(io.bitsensor.lib.entity.proto.Block block)
@RabbitListener(queues="#{blacklistDeleteQueue.name}")
public void receiveDelete(String id)
public 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.