use of org.gluu.model.ApplicationType in project oxCore by GluuFederation.
the class LdapEntryReporter method addMandatoryAttributes.
private void addMandatoryAttributes(MetricService metricService, Date startTime, Date endTime, List<MetricEntry> metricEntries, Date creationTime) {
String nodeIndetifier = metricService.getNodeIndetifier();
ApplicationType applicationType = metricService.getApplicationType();
for (MetricEntry metricEntry : metricEntries) {
String id = metricService.getUiqueIdentifier();
String dn = metricService.buildDn(id, creationTime, applicationType);
metricEntry.setId(id);
metricEntry.setDn(dn);
metricEntry.setApplicationType(applicationType);
metricEntry.setNodeIndetifier(nodeIndetifier);
metricEntry.setStartDate(startTime);
metricEntry.setEndDate(endTime);
metricEntry.setCreationDate(creationTime);
metricEntry.setExpirationDate(DateUtils.addDays(creationTime, metricService.getEntryLifetimeInDays()));
int ttl = (int) ((metricEntry.getExpirationDate().getTime() - creationTime.getTime()) / 1000L);
metricEntry.setTtl(ttl);
}
}
Aggregations