Package org.cyclos.impl.system
Interface IpAddressServiceLocal
-
- All Superinterfaces:
CRUDService<IpAddressDTO,IpAddressData,Void>,CRUDServiceLocal<IpAddress,IpAddressDTO,IpAddressData,Void>,IpAddressService,Service
public interface IpAddressServiceLocal extends IpAddressService, CRUDServiceLocal<IpAddress,IpAddressDTO,IpAddressData,Void>
Local interface forIpAddressService
-
-
Field Summary
Fields Modifier and Type Field Description static StringATTR_ADDRESSScript attribute: the IP address to geolocate
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanblock(String address, TimeInterval time)Blocks an IP address for the given time, if possible.IpAddressfindByAddress(String address)Finds the address by id, throwingEntityNotFoundExceptionif not foundIpGeolocationgeolocate(String address)Geolocate the given IP address, if possible.booleanisAllowed(String address)Indicates whether the given address is allowed to accesslongpurgeExpiredBlocked()Removes the IP addresses with statusIpAddressStatus.BLOCKEDwhose block have expired-
Methods inherited from interface org.cyclos.services.CRUDService
getData, getDataForNew, load, remove, removeAll, save
-
Methods inherited from interface org.cyclos.impl.CRUDServiceLocal
find, findAll, getEntityClass, newEntity, remove, removeAll, saveEntity, saveSkippingEntityLog, toDTO, toEntity, validate
-
Methods inherited from interface org.cyclos.services.system.IpAddressService
search, searchLogs
-
-
-
-
Field Detail
-
ATTR_ADDRESS
static final String ATTR_ADDRESS
Script attribute: the IP address to geolocate- See Also:
- Constant Field Values
-
-
Method Detail
-
block
boolean block(String address, TimeInterval time)
Blocks an IP address for the given time, if possible. When the time is null or zero, or when the address' status is fixed, the address isn't blocked.
-
findByAddress
IpAddress findByAddress(String address) throws EntityNotFoundException
Finds the address by id, throwingEntityNotFoundExceptionif not found- Throws:
EntityNotFoundException
-
geolocate
IpGeolocation geolocate(String address)
Geolocate the given IP address, if possible. If not possible, returns null.
-
isAllowed
boolean isAllowed(String address)
Indicates whether the given address is allowed to access
-
purgeExpiredBlocked
long purgeExpiredBlocked()
Removes the IP addresses with statusIpAddressStatus.BLOCKEDwhose block have expired
-
-