mirror of
https://github.com/Telecominfraproject/wlan-cloud-services.git
synced 2026-03-20 16:39:19 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b03dccc63f | ||
|
|
03eccfa448 |
@@ -20,6 +20,7 @@ public interface SystemEventServiceInterface {
|
||||
GenericResponse create(SystemEventRecord systemEventRecord);
|
||||
GenericResponse create(List<SystemEventRecord> systemEventRecords);
|
||||
GenericResponse delete(int customerId, long equipmentId, long createdBeforeTimestamp);
|
||||
GenericResponse delete(long createdBeforeTimestamp);
|
||||
|
||||
/**
|
||||
* <br>Retrieves all of the SystemEvent records that are mapped to the provided customerId.
|
||||
|
||||
@@ -44,6 +44,12 @@ public class SystemEventServiceLocal implements SystemEventServiceInterface {
|
||||
LOG.debug("calling systemEventController.delete {} {} {}", customerId, equipmentId, createdBeforeTimestamp);
|
||||
return systemEventController.delete(customerId, equipmentId, createdBeforeTimestamp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GenericResponse delete(long createdBeforeTimestamp) {
|
||||
LOG.debug("calling systemEventController.delete {}", createdBeforeTimestamp);
|
||||
return systemEventController.delete(createdBeforeTimestamp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PaginationResponse<SystemEventRecord> getForCustomer(long fromTime, long toTime, int customerId,
|
||||
|
||||
@@ -150,7 +150,22 @@ public class SystemEventServiceRemote extends BaseRemoteClient implements System
|
||||
LOG.debug("completed systemEventRecord.delete {} {} {}", customerId, equipmentId, createdBeforeTimestamp);
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public GenericResponse delete(long createdBeforeTimestamp) {
|
||||
LOG.debug("calling systemEventRecord.delete {}", createdBeforeTimestamp);
|
||||
|
||||
ResponseEntity<GenericResponse> responseEntity = restTemplate.exchange(
|
||||
getBaseUrl()
|
||||
+"/delete?createdBeforeTimestamp={createdBeforeTimestamp}",
|
||||
HttpMethod.DELETE, null, GenericResponse.class, createdBeforeTimestamp);
|
||||
|
||||
GenericResponse ret = responseEntity.getBody();
|
||||
LOG.debug("completed systemEventRecords.delete {}", createdBeforeTimestamp);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public String getBaseUrl() {
|
||||
if(baseUrl==null) {
|
||||
|
||||
@@ -157,4 +157,21 @@ public class SystemEventController {
|
||||
|
||||
return new GenericResponse(true, "");
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes SystemEventRecord records before a given time stamp
|
||||
*
|
||||
*/
|
||||
@RequestMapping(value="/delete", method=RequestMethod.DELETE)
|
||||
public GenericResponse delete(@RequestParam long createdBeforeTimestamp) {
|
||||
|
||||
LOG.debug("Deleting SystemEventRecords created before {}", createdBeforeTimestamp);
|
||||
|
||||
systemEventDatastore.delete(createdBeforeTimestamp);
|
||||
|
||||
LOG.debug("Deleted SystemEventRecords created before {}", createdBeforeTimestamp);
|
||||
|
||||
return new GenericResponse(true, "");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user