Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'remotes/upstream/master' into CAS-auth
- Loading branch information
Showing
160 changed files
with
5,943 additions
and
1,010 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
125 changes: 125 additions & 0 deletions
125
...admin-gui/src/main/java/com/evolveum/midpoint/web/component/progress/MappingsLineDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
/* | ||
* Copyright (c) 2010-2015 Evolveum | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.evolveum.midpoint.web.component.progress; | ||
|
||
import com.evolveum.midpoint.schema.statistics.GenericStatisticsData; | ||
import com.evolveum.midpoint.schema.statistics.MappingsStatisticsKey; | ||
import com.evolveum.midpoint.schema.statistics.OperationalInformation; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.MappingsStatisticsEntryType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.MappingsStatisticsType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.OperationalInformationType; | ||
import org.apache.commons.lang.StringUtils; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
/** | ||
* @author Pavol Mederly | ||
*/ | ||
public class MappingsLineDto { | ||
|
||
public static final String F_OBJECT = "object"; | ||
public static final String F_COUNT = "count"; | ||
public static final String F_AVERAGE_TIME = "averageTime"; | ||
public static final String F_MIN_TIME = "minTime"; | ||
public static final String F_MAX_TIME = "maxTime"; | ||
public static final String F_TOTAL_TIME = "totalTime"; | ||
|
||
private String object; | ||
private int count; | ||
private Long minTime; | ||
private Long maxTime; | ||
private long totalTime; | ||
|
||
// public MappingsLineDto(String object) { | ||
// this.object = object; | ||
// } | ||
|
||
public MappingsLineDto(MappingsStatisticsEntryType entry) { | ||
object = entry.getObject(); | ||
count = entry.getCount(); | ||
minTime = entry.getMinTime(); | ||
maxTime = entry.getMaxTime(); | ||
totalTime = entry.getTotalTime(); | ||
} | ||
|
||
public String getObject() { | ||
return object; | ||
} | ||
|
||
public int getCount() { | ||
return count; | ||
} | ||
|
||
public Long getAverageTime() { | ||
if (count > 0) { | ||
return totalTime / count; | ||
} else { | ||
return null; | ||
} | ||
} | ||
|
||
public Long getMinTime() { | ||
return minTime; | ||
} | ||
|
||
public Long getMaxTime() { | ||
return maxTime; | ||
} | ||
|
||
public long getTotalTime() { | ||
return totalTime; | ||
} | ||
|
||
public static List<MappingsLineDto> extractFromOperationalInformation(OperationalInformation operationalInformation) { | ||
OperationalInformationType operationalInformationType = operationalInformation.getAggregatedValue(); | ||
MappingsStatisticsType mappingsStatisticsType = operationalInformationType.getMappingsStatistics(); | ||
return extractFromOperationalInformation(mappingsStatisticsType); | ||
} | ||
|
||
protected static List<MappingsLineDto> extractFromOperationalInformation(MappingsStatisticsType mappingsStatisticsType) { | ||
List<MappingsLineDto> retval = new ArrayList<>(); | ||
if (mappingsStatisticsType == null) { | ||
return retval; | ||
} | ||
for (MappingsStatisticsEntryType entry : mappingsStatisticsType.getEntry()) { | ||
retval.add(new MappingsLineDto(entry)); | ||
} | ||
return retval; | ||
} | ||
|
||
// private static MappingsLineDto findLineDto(List<MappingsLineDto> list, String object) { | ||
// for (MappingsLineDto lineDto : list) { | ||
// if (StringUtils.equals(lineDto.getObject(), object)) { | ||
// return lineDto; | ||
// } | ||
// } | ||
// return null; | ||
// } | ||
// | ||
// private void setValue(int count, int min, int max, long totalDuration) { | ||
// this.count += count; | ||
// if (minTime == null || min < minTime) { | ||
// minTime = min; | ||
// } | ||
// if (maxTime == null || max > maxTime) { | ||
// maxTime = max; | ||
// } | ||
// totalTime += totalDuration; | ||
// } | ||
} |
138 changes: 138 additions & 0 deletions
138
...-gui/src/main/java/com/evolveum/midpoint/web/component/progress/NotificationsLineDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
/* | ||
* Copyright (c) 2010-2015 Evolveum | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.evolveum.midpoint.web.component.progress; | ||
|
||
import com.evolveum.midpoint.schema.statistics.GenericStatisticsData; | ||
import com.evolveum.midpoint.schema.statistics.NotificationsStatisticsKey; | ||
import com.evolveum.midpoint.schema.statistics.OperationalInformation; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.NotificationsStatisticsEntryType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.NotificationsStatisticsType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.OperationalInformationType; | ||
import org.apache.commons.lang.StringUtils; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
/** | ||
* @author Pavol Mederly | ||
*/ | ||
public class NotificationsLineDto { | ||
|
||
public static final String F_TRANSPORT = "transport"; | ||
public static final String F_COUNT_SUCCESS = "countSuccess"; | ||
public static final String F_COUNT_FAILURE = "countFailure"; | ||
public static final String F_AVERAGE_TIME = "averageTime"; | ||
public static final String F_MIN_TIME = "minTime"; | ||
public static final String F_MAX_TIME = "maxTime"; | ||
public static final String F_TOTAL_TIME = "totalTime"; | ||
|
||
private String transport; | ||
private int countSuccess; | ||
private int countFailure; | ||
private Long minTime; | ||
private Long maxTime; | ||
private long totalTime; | ||
|
||
public NotificationsLineDto(String transport) { | ||
this.transport = transport; | ||
} | ||
|
||
public NotificationsLineDto(NotificationsStatisticsEntryType entry) { | ||
transport = entry.getTransport(); | ||
countSuccess = entry.getCountSuccess(); | ||
countFailure = entry.getCountFailure(); | ||
minTime = entry.getMinTime(); | ||
maxTime = entry.getMaxTime(); | ||
totalTime = entry.getTotalTime(); | ||
} | ||
|
||
public Long getAverageTime() { | ||
int count = countSuccess + countFailure; | ||
if (count > 0) { | ||
return totalTime / count; | ||
} else { | ||
return null; | ||
} | ||
} | ||
|
||
public String getTransport() { | ||
return transport; | ||
} | ||
|
||
public int getCountSuccess() { | ||
return countSuccess; | ||
} | ||
|
||
public int getCountFailure() { | ||
return countFailure; | ||
} | ||
|
||
public Long getMinTime() { | ||
return minTime; | ||
} | ||
|
||
public Long getMaxTime() { | ||
return maxTime; | ||
} | ||
|
||
public long getTotalTime() { | ||
return totalTime; | ||
} | ||
|
||
public static List<NotificationsLineDto> extractFromOperationalInformation(OperationalInformation operationalInformation) { | ||
OperationalInformationType operationalInformationType = operationalInformation.getAggregatedValue(); | ||
NotificationsStatisticsType notificationsStatisticsType = operationalInformationType.getNotificationsStatistics(); | ||
return extractFromOperationalInformation(notificationsStatisticsType); | ||
} | ||
|
||
protected static List<NotificationsLineDto> extractFromOperationalInformation(NotificationsStatisticsType notificationsStatisticsType) { | ||
List<NotificationsLineDto> retval = new ArrayList<>(); | ||
if (notificationsStatisticsType == null) { | ||
return retval; | ||
} | ||
|
||
for (NotificationsStatisticsEntryType entry : notificationsStatisticsType.getEntry()) { | ||
retval.add(new NotificationsLineDto(entry)); | ||
} | ||
return retval; | ||
} | ||
|
||
// private static NotificationsLineDto findLineDto(List<NotificationsLineDto> list, String transport) { | ||
// for (NotificationsLineDto lineDto : list) { | ||
// if (StringUtils.equals(lineDto.getTransport(), transport)) { | ||
// return lineDto; | ||
// } | ||
// } | ||
// return null; | ||
// } | ||
// | ||
// private void setValue(boolean success, int count, long min, long max, long totalDuration) { | ||
// if (success) { | ||
// this.countSuccess += count; | ||
// } else { | ||
// this.countFailure += count; | ||
// } | ||
// if (minTime == null || min < minTime) { | ||
// minTime = min; | ||
// } | ||
// if (maxTime == null || max > maxTime) { | ||
// maxTime = max; | ||
// } | ||
// totalTime += totalDuration; | ||
// } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.