Updated to new accounting client library
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/admin/accounting-manager@154671 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
0ae1ed43db
commit
2dcc82318b
|
@ -1,12 +1,12 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="src" output="target/accounting-manager-1.7.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
<classpathentry kind="src" output="target/accounting-manager-1.8.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="optional" value="true"/>
|
<attribute name="optional" value="true"/>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry excluding="**" kind="src" output="target/accounting-manager-1.7.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
|
<classpathentry excluding="**" kind="src" output="target/accounting-manager-1.8.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
|
@ -42,8 +42,8 @@
|
||||||
<classpathentry kind="lib" path="/home/giancarlo/gwt/gwt-2.6.1/validation-api-1.0.0.GA-sources.jar"/>
|
<classpathentry kind="lib" path="/home/giancarlo/gwt/gwt-2.6.1/validation-api-1.0.0.GA-sources.jar"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="owner.project.facets" value="java"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="output" path="target/accounting-manager-1.7.0-SNAPSHOT/WEB-INF/classes"/>
|
<classpathentry kind="output" path="target/accounting-manager-1.8.0-SNAPSHOT/WEB-INF/classes"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
||||||
<wb-module deploy-name="accounting-manager-1.7.0-SNAPSHOT">
|
<wb-module deploy-name="accounting-manager-1.8.0-SNAPSHOT">
|
||||||
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
||||||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||||
<dependent-module archiveName="accounting-manager-theme-1.2.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/accounting-manager-theme/accounting-manager-theme">
|
|
||||||
<dependency-type>uses</dependency-type>
|
|
||||||
</dependent-module>
|
|
||||||
<property name="java-output-path" value="/accounting-manager/target/accounting-manager-1.3.0-SNAPSHOT/WEB-INF/classes"/>
|
<property name="java-output-path" value="/accounting-manager/target/accounting-manager-1.3.0-SNAPSHOT/WEB-INF/classes"/>
|
||||||
<property name="context-root" value="accounting-manager"/>
|
<property name="context-root" value="accounting-manager"/>
|
||||||
</wb-module>
|
</wb-module>
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<ReleaseNotes>
|
<ReleaseNotes>
|
||||||
|
<Changeset component="org.gcube.portlets.admin.accounting-manager.1-8-0"
|
||||||
|
date="2017-10-01">
|
||||||
|
<Change>Updated to new version of accounting client library</Change>
|
||||||
|
</Changeset>
|
||||||
<Changeset component="org.gcube.portlets.admin.accounting-manager.1-7-0"
|
<Changeset component="org.gcube.portlets.admin.accounting-manager.1-7-0"
|
||||||
date="2017-06-12">
|
date="2017-06-12">
|
||||||
<Change>Added Spaces chart [Ticket #8397]</Change>
|
<Change>Added Spaces chart [Ticket #8397]</Change>
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -13,7 +13,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.gcube.portlets.admin</groupId>
|
<groupId>org.gcube.portlets.admin</groupId>
|
||||||
<artifactId>accounting-manager</artifactId>
|
<artifactId>accounting-manager</artifactId>
|
||||||
<version>1.7.0-SNAPSHOT</version>
|
<version>1.8.0-SNAPSHOT</version>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -426,20 +426,20 @@ public class AccountingPeriodPanel extends SimpleContainer {
|
||||||
case DAILY:
|
case DAILY:
|
||||||
Date maximumDistantDay = new Date();
|
Date maximumDistantDay = new Date();
|
||||||
CalendarUtil.addMonthsToDate(
|
CalendarUtil.addMonthsToDate(
|
||||||
maximumDistantDay, -1);
|
maximumDistantDay, -3);
|
||||||
CalendarUtil.addDaysToDate(
|
CalendarUtil.addDaysToDate(
|
||||||
maximumDistantDay, -1);
|
maximumDistantDay, -1);
|
||||||
if (maximumDistantDay.compareTo(startD) >= 0) {
|
if (maximumDistantDay.compareTo(startD) >= 0) {
|
||||||
UtilsGXT3
|
UtilsGXT3
|
||||||
.alert("Attention",
|
.alert("Attention",
|
||||||
"Invalid Start Date (Daily: the max interval should the last month)!");
|
"Invalid Start Date (Daily: the max interval should the last three month)!");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maximumDistantDay.compareTo(endD) >= 0) {
|
if (maximumDistantDay.compareTo(endD) >= 0) {
|
||||||
UtilsGXT3
|
UtilsGXT3
|
||||||
.alert("Attention",
|
.alert("Attention",
|
||||||
"Invalid End Date (Daily: the max interval should the last month)!");
|
"Invalid End Date (Daily: the max interval should the last three month)!");
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ import java.util.GregorianCalendar;
|
||||||
|
|
||||||
import org.gcube.accounting.analytics.Filter;
|
import org.gcube.accounting.analytics.Filter;
|
||||||
import org.gcube.accounting.analytics.TemporalConstraint;
|
import org.gcube.accounting.analytics.TemporalConstraint;
|
||||||
import org.gcube.accounting.datamodel.aggregation.AggregatedTaskUsageRecord;
|
//import org.gcube.accounting.datamodel.aggregation.AggregatedTaskUsageRecord;
|
||||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.PeriodModeMap;
|
import org.gcube.portlets.admin.accountingmanager.server.amservice.PeriodModeMap;
|
||||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingFilter;
|
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingFilter;
|
||||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingFilterBasic;
|
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingFilterBasic;
|
||||||
|
@ -61,6 +61,7 @@ public class AccountingQuery4Task extends AccountingQueryBuilder {
|
||||||
endCalendar.set(GregorianCalendar.SECOND, 59);
|
endCalendar.set(GregorianCalendar.SECOND, 59);
|
||||||
endCalendar.set(GregorianCalendar.MILLISECOND, 999);
|
endCalendar.set(GregorianCalendar.MILLISECOND, 999);
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
TemporalConstraint temporalConstraint = new TemporalConstraint(
|
TemporalConstraint temporalConstraint = new TemporalConstraint(
|
||||||
startCalendar.getTimeInMillis(), endCalendar.getTimeInMillis(),
|
startCalendar.getTimeInMillis(), endCalendar.getTimeInMillis(),
|
||||||
PeriodModeMap.getMode(seriesRequest.getAccountingPeriod()
|
PeriodModeMap.getMode(seriesRequest.getAccountingPeriod()
|
||||||
|
@ -85,10 +86,10 @@ public class AccountingQuery4Task extends AccountingQueryBuilder {
|
||||||
filters.add(filter);
|
filters.add(filter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
invocation = new AccountingQueryBasic(
|
/*invocation = new AccountingQueryBasic(
|
||||||
AggregatedTaskUsageRecord.class, temporalConstraint,
|
AggregatedTaskUsageRecord.class, temporalConstraint,
|
||||||
filters, accountingFilterBasic.isNoContext());
|
filters, accountingFilterBasic.isNoContext());
|
||||||
|
*/
|
||||||
} else {
|
} else {
|
||||||
if (seriesRequest.getAccountingFilterDefinition() instanceof AccountingFilterTop) {
|
if (seriesRequest.getAccountingFilterDefinition() instanceof AccountingFilterTop) {
|
||||||
AccountingFilterTop accountingFilterTop = (AccountingFilterTop) seriesRequest
|
AccountingFilterTop accountingFilterTop = (AccountingFilterTop) seriesRequest
|
||||||
|
@ -103,12 +104,12 @@ public class AccountingQuery4Task extends AccountingQueryBuilder {
|
||||||
filters.add(filter);
|
filters.add(filter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
invocation = new AccountingQueryTop(
|
/*invocation = new AccountingQueryTop(
|
||||||
AggregatedTaskUsageRecord.class,
|
AggregatedTaskUsageRecord.class,
|
||||||
accountingFilterTop.getFilterKey(),
|
accountingFilterTop.getFilterKey(),
|
||||||
accountingFilterTop.getShowOthers(),
|
accountingFilterTop.getShowOthers(),
|
||||||
accountingFilterTop.getTopNumber(),
|
accountingFilterTop.getTopNumber(),
|
||||||
temporalConstraint, filters);
|
temporalConstraint, filters);*/
|
||||||
} else {
|
} else {
|
||||||
if (seriesRequest.getAccountingFilterDefinition() instanceof AccountingFilterContext) {
|
if (seriesRequest.getAccountingFilterDefinition() instanceof AccountingFilterContext) {
|
||||||
AccountingFilterContext accountingFilterContext = (AccountingFilterContext) seriesRequest
|
AccountingFilterContext accountingFilterContext = (AccountingFilterContext) seriesRequest
|
||||||
|
@ -123,11 +124,11 @@ public class AccountingQuery4Task extends AccountingQueryBuilder {
|
||||||
filters.add(filter);
|
filters.add(filter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
invocation = new AccountingQueryContext(
|
/*invocation = new AccountingQueryContext(
|
||||||
AggregatedTaskUsageRecord.class,
|
AggregatedTaskUsageRecord.class,
|
||||||
accountingFilterContext.getContext(),
|
accountingFilterContext.getContext(),
|
||||||
temporalConstraint,
|
temporalConstraint,
|
||||||
filters);
|
filters);*/
|
||||||
} else {
|
} else {
|
||||||
logger.error("Invalid Request: " + seriesRequest);
|
logger.error("Invalid Request: " + seriesRequest);
|
||||||
throw new ServiceException(
|
throw new ServiceException(
|
||||||
|
|
|
@ -6,7 +6,7 @@ import java.util.SortedMap;
|
||||||
|
|
||||||
import org.gcube.accounting.analytics.Filter;
|
import org.gcube.accounting.analytics.Filter;
|
||||||
import org.gcube.accounting.analytics.Info;
|
import org.gcube.accounting.analytics.Info;
|
||||||
import org.gcube.accounting.datamodel.aggregation.AggregatedTaskUsageRecord;
|
//import org.gcube.accounting.datamodel.aggregation.AggregatedTaskUsageRecord;
|
||||||
import org.gcube.portlets.admin.accountingmanager.shared.data.Context;
|
import org.gcube.portlets.admin.accountingmanager.shared.data.Context;
|
||||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesTask;
|
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesTask;
|
||||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.task.SeriesTaskContext;
|
import org.gcube.portlets.admin.accountingmanager.shared.data.response.task.SeriesTaskContext;
|
||||||
|
@ -51,18 +51,19 @@ public class SeriesResponse4TaskContext extends SeriesResponseBuilder {
|
||||||
ArrayList<SeriesTaskData> series = new ArrayList<>();
|
ArrayList<SeriesTaskData> series = new ArrayList<>();
|
||||||
SortedMap<Calendar, Info> infos = contextSM.get(contextValue);
|
SortedMap<Calendar, Info> infos = contextSM.get(contextValue);
|
||||||
for (Info info : infos.values()) {
|
for (Info info : infos.values()) {
|
||||||
|
@SuppressWarnings("unused")
|
||||||
JSONObject jso = info.getValue();
|
JSONObject jso = info.getValue();
|
||||||
// Long duration =
|
// Long duration =
|
||||||
// jso.getLong(AggregatedTaskUsageRecord.DURATION);
|
// jso.getLong(AggregatedTaskUsageRecord.DURATION);
|
||||||
Long operationCount = jso
|
//Long operationCount = jso
|
||||||
.getLong(AggregatedTaskUsageRecord.OPERATION_COUNT);
|
// .getLong(AggregatedTaskUsageRecord.OPERATION_COUNT);
|
||||||
// Long maxInvocationTime =
|
// Long maxInvocationTime =
|
||||||
// jso.getLong(AggregatedTaskUsageRecord.MAX_INVOCATION_TIME);
|
// jso.getLong(AggregatedTaskUsageRecord.MAX_INVOCATION_TIME);
|
||||||
// Long minInvocationTime =
|
// Long minInvocationTime =
|
||||||
// jso.getLong(AggregatedTaskUsageRecord.MIN_INVOCATION_TIME);
|
// jso.getLong(AggregatedTaskUsageRecord.MIN_INVOCATION_TIME);
|
||||||
|
|
||||||
series.add(new SeriesTaskData(info.getCalendar().getTime(),
|
//series.add(new SeriesTaskData(info.getCalendar().getTime(),
|
||||||
operationCount));
|
// operationCount));
|
||||||
}
|
}
|
||||||
SeriesTaskDataContext seriesTaskDataContext = new SeriesTaskDataContext(
|
SeriesTaskDataContext seriesTaskDataContext = new SeriesTaskDataContext(
|
||||||
contextValue.getValue(), series);
|
contextValue.getValue(), series);
|
||||||
|
|
|
@ -6,7 +6,7 @@ import java.util.SortedMap;
|
||||||
|
|
||||||
import org.gcube.accounting.analytics.Info;
|
import org.gcube.accounting.analytics.Info;
|
||||||
import org.gcube.accounting.analytics.NumberedFilter;
|
import org.gcube.accounting.analytics.NumberedFilter;
|
||||||
import org.gcube.accounting.datamodel.aggregation.AggregatedTaskUsageRecord;
|
//import org.gcube.accounting.datamodel.aggregation.AggregatedTaskUsageRecord;
|
||||||
import org.gcube.portlets.admin.accountingmanager.shared.data.FilterValue;
|
import org.gcube.portlets.admin.accountingmanager.shared.data.FilterValue;
|
||||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesTask;
|
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesTask;
|
||||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.task.SeriesTaskData;
|
import org.gcube.portlets.admin.accountingmanager.shared.data.response.task.SeriesTaskData;
|
||||||
|
@ -53,18 +53,19 @@ public class SeriesResponse4TaskTop extends SeriesResponseBuilder {
|
||||||
ArrayList<SeriesTaskData> series = new ArrayList<>();
|
ArrayList<SeriesTaskData> series = new ArrayList<>();
|
||||||
SortedMap<Calendar, Info> infos = topSM.get(topValue);
|
SortedMap<Calendar, Info> infos = topSM.get(topValue);
|
||||||
for (Info info : infos.values()) {
|
for (Info info : infos.values()) {
|
||||||
|
@SuppressWarnings("unused")
|
||||||
JSONObject jso = info.getValue();
|
JSONObject jso = info.getValue();
|
||||||
// Long duration =
|
// Long duration =
|
||||||
// jso.getLong(AggregatedTaskUsageRecord.DURATION);
|
// jso.getLong(AggregatedTaskUsageRecord.DURATION);
|
||||||
Long operationCount = jso
|
//Long operationCount = jso
|
||||||
.getLong(AggregatedTaskUsageRecord.OPERATION_COUNT);
|
// .getLong(AggregatedTaskUsageRecord.OPERATION_COUNT);
|
||||||
// Long maxInvocationTime =
|
// Long maxInvocationTime =
|
||||||
// jso.getLong(AggregatedTaskUsageRecord.MAX_INVOCATION_TIME);
|
// jso.getLong(AggregatedTaskUsageRecord.MAX_INVOCATION_TIME);
|
||||||
// Long minInvocationTime =
|
// Long minInvocationTime =
|
||||||
// jso.getLong(AggregatedTaskUsageRecord.MIN_INVOCATION_TIME);
|
// jso.getLong(AggregatedTaskUsageRecord.MIN_INVOCATION_TIME);
|
||||||
|
|
||||||
series.add(new SeriesTaskData(info.getCalendar().getTime(),
|
//series.add(new SeriesTaskData(info.getCalendar().getTime(),
|
||||||
operationCount));
|
// operationCount));
|
||||||
}
|
}
|
||||||
SeriesTaskDataTop seriesTaskDataTop = new SeriesTaskDataTop(
|
SeriesTaskDataTop seriesTaskDataTop = new SeriesTaskDataTop(
|
||||||
new FilterValue(topValue.getValue()), series);
|
new FilterValue(topValue.getValue()), series);
|
||||||
|
|
Loading…
Reference in New Issue