AccessBorderRouterService
, MockAccessBorderRouterService
public abstract class AbstractAccessBorderRouterService
extends java.lang.Object
getSensorIpByBorderRouterIp()
and existBorderRouter()
.AccessBorderRouterService
,
MockAccessBorderRouterService
Modifier and Type | Field | Description |
---|---|---|
protected BorderRouterRepository |
borderRouterRepository |
|
private static org.apache.log4j.Logger |
logger |
|
protected SensorRepository |
sensorRepository |
Constructor | Description |
---|---|
AbstractAccessBorderRouterService() |
Modifier and Type | Method | Description |
---|---|---|
abstract boolean |
existBorderRouter(java.lang.String borderRouterIp) |
Check if a border router IP is exist, notice that this method doesn't check
if the IP is in database, it checks if the router IP exists in the real network.
|
abstract java.util.List<java.lang.String> |
getSensorIpByBorderRouterIp(java.lang.String borderRouterIp) |
Take as input a
String of borderRouterIp, return a list of
IPv6 address of sensors that are connected to the given border router. |
BorderRouterEntity |
saveBorderRouter(java.lang.String borderRouterIp,
java.lang.String borderRouterName) |
Save the input border router in database.
|
void |
saveSensorsForBorderRouterIp(java.lang.String borderRouterIp) |
Save the sensors connected to the input border router in database.
|
@Autowired protected BorderRouterRepository borderRouterRepository
@Autowired protected SensorRepository sensorRepository
private static final org.apache.log4j.Logger logger
public abstract boolean existBorderRouter(java.lang.String borderRouterIp)
borderRouterIp
- The IPv6 address of the border router you want to check.true
for border router exists, false
otherwise.public abstract java.util.List<java.lang.String> getSensorIpByBorderRouterIp(java.lang.String borderRouterIp)
String
of borderRouterIp, return a list of
IPv6 address of sensors that are connected to the given border router.
If the input borderRouterIp is inValid, return null instead.
If there is no sensor connected to the border router, return an empty list.borderRouterIp
- The IPv6 address of border router you want to query.@Transactional public BorderRouterEntity saveBorderRouter(java.lang.String borderRouterIp, java.lang.String borderRouterName)
borderRouterName
is null
, set its IP as name.
If the input border router IP is already in database, just ignore it.borderRouterIp
- The IPv6 address of the border router you want to save.borderRouterName
- The name you want to set for the border router.BorderRouterEntity
for the input border router.@Transactional public void saveSensorsForBorderRouterIp(java.lang.String borderRouterIp)
borderRouterIp
- The IPv6 address of the border router that the list of sensors are
connnected.java.lang.NullPointerException
- if the input border router IP doesn't not exist.