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:
Giancarlo Panichi 2017-09-28 09:32:01 +00:00
parent 0ae1ed43db
commit 2dcc82318b
8 changed files with 33 additions and 29 deletions

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</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>
<attribute name="maven.pomderived" value="true"/>
</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="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="owner.project.facets" value="java"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</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>

View File

@ -1,12 +1,9 @@
<?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="/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/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="context-root" value="accounting-manager"/>
</wb-module>

View File

@ -1,4 +1,8 @@
<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"
date="2017-06-12">
<Change>Added Spaces chart [Ticket #8397]</Change>

View File

@ -13,7 +13,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.gcube.portlets.admin</groupId>
<artifactId>accounting-manager</artifactId>
<version>1.7.0-SNAPSHOT</version>
<version>1.8.0-SNAPSHOT</version>
<packaging>war</packaging>

View File

@ -426,20 +426,20 @@ public class AccountingPeriodPanel extends SimpleContainer {
case DAILY:
Date maximumDistantDay = new Date();
CalendarUtil.addMonthsToDate(
maximumDistantDay, -1);
maximumDistantDay, -3);
CalendarUtil.addDaysToDate(
maximumDistantDay, -1);
if (maximumDistantDay.compareTo(startD) >= 0) {
UtilsGXT3
.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;
}
if (maximumDistantDay.compareTo(endD) >= 0) {
UtilsGXT3
.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;
}

View File

@ -7,7 +7,7 @@ import java.util.GregorianCalendar;
import org.gcube.accounting.analytics.Filter;
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.shared.data.AccountingFilter;
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.MILLISECOND, 999);
@SuppressWarnings("unused")
TemporalConstraint temporalConstraint = new TemporalConstraint(
startCalendar.getTimeInMillis(), endCalendar.getTimeInMillis(),
PeriodModeMap.getMode(seriesRequest.getAccountingPeriod()
@ -85,10 +86,10 @@ public class AccountingQuery4Task extends AccountingQueryBuilder {
filters.add(filter);
}
}
invocation = new AccountingQueryBasic(
/*invocation = new AccountingQueryBasic(
AggregatedTaskUsageRecord.class, temporalConstraint,
filters, accountingFilterBasic.isNoContext());
*/
} else {
if (seriesRequest.getAccountingFilterDefinition() instanceof AccountingFilterTop) {
AccountingFilterTop accountingFilterTop = (AccountingFilterTop) seriesRequest
@ -103,12 +104,12 @@ public class AccountingQuery4Task extends AccountingQueryBuilder {
filters.add(filter);
}
}
invocation = new AccountingQueryTop(
/*invocation = new AccountingQueryTop(
AggregatedTaskUsageRecord.class,
accountingFilterTop.getFilterKey(),
accountingFilterTop.getShowOthers(),
accountingFilterTop.getTopNumber(),
temporalConstraint, filters);
temporalConstraint, filters);*/
} else {
if (seriesRequest.getAccountingFilterDefinition() instanceof AccountingFilterContext) {
AccountingFilterContext accountingFilterContext = (AccountingFilterContext) seriesRequest
@ -123,11 +124,11 @@ public class AccountingQuery4Task extends AccountingQueryBuilder {
filters.add(filter);
}
}
invocation = new AccountingQueryContext(
/*invocation = new AccountingQueryContext(
AggregatedTaskUsageRecord.class,
accountingFilterContext.getContext(),
temporalConstraint,
filters);
filters);*/
} else {
logger.error("Invalid Request: " + seriesRequest);
throw new ServiceException(

View File

@ -6,7 +6,7 @@ import java.util.SortedMap;
import org.gcube.accounting.analytics.Filter;
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.response.SeriesTask;
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<>();
SortedMap<Calendar, Info> infos = contextSM.get(contextValue);
for (Info info : infos.values()) {
@SuppressWarnings("unused")
JSONObject jso = info.getValue();
// Long duration =
// jso.getLong(AggregatedTaskUsageRecord.DURATION);
Long operationCount = jso
.getLong(AggregatedTaskUsageRecord.OPERATION_COUNT);
//Long operationCount = jso
// .getLong(AggregatedTaskUsageRecord.OPERATION_COUNT);
// Long maxInvocationTime =
// jso.getLong(AggregatedTaskUsageRecord.MAX_INVOCATION_TIME);
// Long minInvocationTime =
// jso.getLong(AggregatedTaskUsageRecord.MIN_INVOCATION_TIME);
series.add(new SeriesTaskData(info.getCalendar().getTime(),
operationCount));
//series.add(new SeriesTaskData(info.getCalendar().getTime(),
// operationCount));
}
SeriesTaskDataContext seriesTaskDataContext = new SeriesTaskDataContext(
contextValue.getValue(), series);

View File

@ -6,7 +6,7 @@ import java.util.SortedMap;
import org.gcube.accounting.analytics.Info;
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.response.SeriesTask;
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<>();
SortedMap<Calendar, Info> infos = topSM.get(topValue);
for (Info info : infos.values()) {
@SuppressWarnings("unused")
JSONObject jso = info.getValue();
// Long duration =
// jso.getLong(AggregatedTaskUsageRecord.DURATION);
Long operationCount = jso
.getLong(AggregatedTaskUsageRecord.OPERATION_COUNT);
//Long operationCount = jso
// .getLong(AggregatedTaskUsageRecord.OPERATION_COUNT);
// Long maxInvocationTime =
// jso.getLong(AggregatedTaskUsageRecord.MAX_INVOCATION_TIME);
// Long minInvocationTime =
// jso.getLong(AggregatedTaskUsageRecord.MIN_INVOCATION_TIME);
series.add(new SeriesTaskData(info.getCalendar().getTime(),
operationCount));
//series.add(new SeriesTaskData(info.getCalendar().getTime(),
// operationCount));
}
SeriesTaskDataTop seriesTaskDataTop = new SeriesTaskDataTop(
new FilterValue(topValue.getValue()), series);