java.lang.Object
com.renomad.minum.security.TheBrig
- All Implemented Interfaces:
ITheBrig
See
ITheBrig
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the current list of ip addresses that have been judged as having carried out attacks on the system.boolean
Return true if a particular client ip address is found in the list.boolean
sendToJail
(String clientIdentifier, long sentenceDuration) Put a client in jail for some infraction, for a specified time.void
stop()
Kills the infinite loop running inside this class.
-
Constructor Details
-
TheBrig
-
TheBrig
In this class we create a thread that runs throughout the lifetime of the application, in an infinite loop removing keys from the list under consideration.
-
-
Method Details
-
initialize
- Specified by:
initialize
in interfaceITheBrig
-
stop
public void stop()Description copied from interface:ITheBrig
Kills the infinite loop running inside this class. -
sendToJail
Description copied from interface:ITheBrig
Put a client in jail for some infraction, for a specified time.- Specified by:
sendToJail
in interfaceITheBrig
- Parameters:
clientIdentifier
- the client's address plus some feature identifier, like 1.2.3.4_too_freq_downloadssentenceDuration
- length of stay, in milliseconds- Returns:
- whether we put this client in jail
-
isInJail
Description copied from interface:ITheBrig
Return true if a particular client ip address is found in the list. -
getInmates
Description copied from interface:ITheBrig
Get the current list of ip addresses that have been judged as having carried out attacks on the system.- Specified by:
getInmates
in interfaceITheBrig
-