Search in sources :

Example 1 with ApplicationType

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);
    }
}
Also used : ApplicationType(org.gluu.model.ApplicationType) TimerMetricEntry(org.gluu.model.metric.timer.TimerMetricEntry) MetricEntry(org.gluu.model.metric.ldap.MetricEntry) CounterMetricEntry(org.gluu.model.metric.counter.CounterMetricEntry)

Aggregations

ApplicationType (org.gluu.model.ApplicationType)1 CounterMetricEntry (org.gluu.model.metric.counter.CounterMetricEntry)1 MetricEntry (org.gluu.model.metric.ldap.MetricEntry)1 TimerMetricEntry (org.gluu.model.metric.timer.TimerMetricEntry)1