2251: Accounting Manager - Stacked column chart for tops
Task-Url: https://support.d4science.org/issues/2251 Updated Stacked Chart Support git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/admin/accounting-manager@124288 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
198d8c2147
commit
c0d2aeb36d
|
@ -1,10 +1,12 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.client.maindata.charts;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.job.JobChart;
|
||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.job.JobChartBasicPanel;
|
||||
import org.gcube.portlets.admin.accountingmanager.client.state.AccountingStateData;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesJob;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.AccountingManagerChartDrawException;
|
||||
|
||||
import com.sencha.gxt.widget.core.client.container.SimpleContainer;
|
||||
|
||||
/**
|
||||
* Accounting Chart 4 Job
|
||||
*
|
||||
|
@ -36,12 +38,43 @@ public class AccountingChart4Job extends AccountingChartBuilder {
|
|||
accountingChartSpec.setChart(accountingChartPanel);
|
||||
return;
|
||||
}
|
||||
|
||||
JobChart container=new JobChart(accountingStateData);
|
||||
|
||||
|
||||
SimpleContainer container = createJobChartPanel();
|
||||
|
||||
accountingChartPanel = new AccountingChartPanel(container);
|
||||
|
||||
accountingChartSpec.setChart(accountingChartPanel);
|
||||
|
||||
}
|
||||
|
||||
private SimpleContainer createJobChartPanel()
|
||||
throws AccountingManagerChartDrawException {
|
||||
|
||||
if (accountingStateData == null
|
||||
|| accountingStateData.getSeriesRequest() == null
|
||||
|| accountingStateData.getSeriesRequest()
|
||||
.getAccountingFilterDefinition() == null
|
||||
|| accountingStateData.getSeriesRequest()
|
||||
.getAccountingFilterDefinition()
|
||||
.getChartType() == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
switch (accountingStateData.getSeriesRequest()
|
||||
.getAccountingFilterDefinition().getChartType()) {
|
||||
|
||||
case Top:
|
||||
return null;
|
||||
//return new JobChartTopPanel(accountingStateData);
|
||||
//createJobChart(new JobChart4Top(accountingStateData));
|
||||
case Basic:
|
||||
return new JobChartBasicPanel(accountingStateData);
|
||||
//createJobChart(new JobChart4Basic(
|
||||
//accountingStateData));
|
||||
default:
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.client.maindata.charts;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartBasicPanel;
|
||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartTopPanel;
|
||||
import org.gcube.portlets.admin.accountingmanager.client.state.AccountingStateData;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesService;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.AccountingManagerChartDrawException;
|
||||
|
||||
import com.sencha.gxt.widget.core.client.container.SimpleContainer;
|
||||
|
||||
/**
|
||||
* Accounting Chart 4 Service
|
||||
*
|
||||
|
@ -13,7 +16,7 @@ import org.gcube.portlets.admin.accountingmanager.shared.exception.AccountingMan
|
|||
*
|
||||
*/
|
||||
public class AccountingChart4Service extends AccountingChartBuilder {
|
||||
|
||||
|
||||
private AccountingStateData accountingStateData;
|
||||
|
||||
public AccountingChart4Service(AccountingStateData accountingStateData) {
|
||||
|
@ -22,8 +25,8 @@ public class AccountingChart4Service extends AccountingChartBuilder {
|
|||
|
||||
@Override
|
||||
public void buildChart() throws AccountingManagerChartDrawException {
|
||||
AccountingChartPanel accountingChartPanel=null;
|
||||
|
||||
AccountingChartPanel accountingChartPanel = null;
|
||||
|
||||
if (accountingStateData == null
|
||||
|| accountingStateData.getAccountingType() == null
|
||||
|| accountingStateData.getSeriesRequest() == null
|
||||
|
@ -37,13 +40,37 @@ public class AccountingChart4Service extends AccountingChartBuilder {
|
|||
return;
|
||||
}
|
||||
|
||||
ServiceChartBasicPanel container=new ServiceChartBasicPanel(accountingStateData);
|
||||
|
||||
accountingChartPanel=new AccountingChartPanel(container);
|
||||
SimpleContainer container = createServiceChartPanel();
|
||||
|
||||
accountingChartPanel = new AccountingChartPanel(container);
|
||||
|
||||
accountingChartSpec.setChart(accountingChartPanel);
|
||||
|
||||
}
|
||||
|
||||
|
||||
private SimpleContainer createServiceChartPanel()
|
||||
throws AccountingManagerChartDrawException {
|
||||
|
||||
if (accountingStateData == null
|
||||
|| accountingStateData.getSeriesRequest() == null
|
||||
|| accountingStateData.getSeriesRequest()
|
||||
.getAccountingFilterDefinition() == null
|
||||
|| accountingStateData.getSeriesRequest()
|
||||
.getAccountingFilterDefinition().getChartType() == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
switch (accountingStateData.getSeriesRequest()
|
||||
.getAccountingFilterDefinition().getChartType()) {
|
||||
|
||||
case Top:
|
||||
return new ServiceChartTopPanel(accountingStateData);
|
||||
case Basic:
|
||||
return new ServiceChartBasicPanel(accountingStateData);
|
||||
default:
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@ import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.storage
|
|||
import org.gcube.portlets.admin.accountingmanager.client.state.AccountingStateData;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesStorage;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.AccountingManagerChartDrawException;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.AccountingManagerStorageChartDrawException;
|
||||
|
||||
import com.sencha.gxt.widget.core.client.container.SimpleContainer;
|
||||
|
||||
|
@ -50,7 +49,7 @@ public class AccountingChart4Storage extends AccountingChartBuilder {
|
|||
}
|
||||
|
||||
private SimpleContainer createStorageChartPanel()
|
||||
throws AccountingManagerStorageChartDrawException {
|
||||
throws AccountingManagerChartDrawException {
|
||||
|
||||
if (accountingStateData == null
|
||||
|| accountingStateData.getSeriesRequest() == null
|
||||
|
|
|
@ -4,12 +4,12 @@ import java.util.Date;
|
|||
|
||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.ChartTimeMeasure;
|
||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.DownloadConstants;
|
||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.JobChartMeasure;
|
||||
import org.gcube.portlets.admin.accountingmanager.client.resource.AccountingManagerResources;
|
||||
import org.gcube.portlets.admin.accountingmanager.client.state.AccountingStateData;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesJob;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesService;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.job.SeriesJobBasic;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.job.SeriesJobData;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.service.SeriesServiceData;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.github.highcharts4gwt.client.view.widget.HighchartsLayoutPanel;
|
||||
|
@ -47,7 +47,7 @@ import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
|
|||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class JobChart extends SimpleContainer {
|
||||
public class JobChartBasicPanel extends SimpleContainer {
|
||||
private DateTimeFormat dtf=DateTimeFormat.getFormat(PredefinedFormat.YEAR_MONTH_DAY);
|
||||
|
||||
private static final String SINGLE_AXIS = "Single Axis";
|
||||
|
@ -61,7 +61,7 @@ public class JobChart extends SimpleContainer {
|
|||
private MenuItem downloadSVGItem;
|
||||
ChartOptions options;
|
||||
|
||||
public JobChart(AccountingStateData accountingStateData) {
|
||||
public JobChartBasicPanel(AccountingStateData accountingStateData) {
|
||||
this.accountingStateData = accountingStateData;
|
||||
forceLayoutOnResize = true;
|
||||
create();
|
||||
|
@ -195,7 +195,7 @@ public class JobChart extends SimpleContainer {
|
|||
var chart = $wnd
|
||||
.jQuery('#' + id)
|
||||
.highcharts(
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartBasicPanel::options);
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.job.JobChartBasicPanel::options);
|
||||
console.log(chart);
|
||||
chart.exportChart();
|
||||
|
||||
|
@ -206,7 +206,7 @@ public class JobChart extends SimpleContainer {
|
|||
var chart = $wnd
|
||||
.jQuery('#' + id)
|
||||
.highcharts(
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartBasicPanel::options);
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.job.JobChartBasicPanel::options);
|
||||
console.log(chart);
|
||||
chart.exportChart({
|
||||
type : 'image/jpeg'
|
||||
|
@ -219,7 +219,7 @@ public class JobChart extends SimpleContainer {
|
|||
var chart = $wnd
|
||||
.jQuery('#' + id)
|
||||
.highcharts(
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartBasicPanel::options);
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.job.JobChartBasicPanel::options);
|
||||
console.log(chart);
|
||||
chart.exportChart({
|
||||
type : 'application/pdf'
|
||||
|
@ -232,7 +232,7 @@ public class JobChart extends SimpleContainer {
|
|||
var chart = $wnd
|
||||
.jQuery('#' + id)
|
||||
.highcharts(
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartBasicPanel::options);
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.job.JobChartBasicPanel::options);
|
||||
console.log(chart);
|
||||
chart.exportChart({
|
||||
type : 'image/svg+xml'
|
||||
|
@ -243,6 +243,11 @@ public class JobChart extends SimpleContainer {
|
|||
private void createMultiAxisChart() {
|
||||
SeriesJob seriesJob = (SeriesJob) accountingStateData
|
||||
.getSeriesResponse();
|
||||
if(!(seriesJob.getSeriesJobDefinition() instanceof SeriesJobBasic)){
|
||||
//throw new Exception("Invalid SeriesServiceBasic!");
|
||||
return;
|
||||
}
|
||||
SeriesJobBasic seriesJobBasic=(SeriesJobBasic)seriesJob.getSeriesJobDefinition();
|
||||
|
||||
double minRange = ChartTimeMeasure
|
||||
.calculateMinRange(accountingStateData.getSeriesRequest()
|
||||
|
@ -266,7 +271,7 @@ public class JobChart extends SimpleContainer {
|
|||
options = highchartsFactory.createChartOptions();
|
||||
|
||||
options.navigation().buttonOptions().enabled(false);
|
||||
options.exporting().filename("AccountingService");
|
||||
options.exporting().filename("AccountingJobBasic");
|
||||
options.chart().zoomType("xy");
|
||||
|
||||
options.title().text("Accounting Job");
|
||||
|
@ -283,7 +288,7 @@ public class JobChart extends SimpleContainer {
|
|||
options.xAxis().type("datetime").minRange(minRange);
|
||||
|
||||
// yAxis
|
||||
String multiAxis = "[{" + " \"id\": \"OperationCount\","
|
||||
String multiAxis = "[{" + " \"id\": \""+JobChartMeasure.OperationCount.name()+"\","
|
||||
+ " \"labels\": { " + " \"format\": \"{value}\","
|
||||
+ " \"style\": { " + " \"color\": \""
|
||||
+ colors.get(1)
|
||||
|
@ -291,7 +296,7 @@ public class JobChart extends SimpleContainer {
|
|||
+ " }"
|
||||
+ " },"
|
||||
+ " \"title\": { "
|
||||
+ " \"text\": \"Operation Count\","
|
||||
+ " \"text\": \""+JobChartMeasure.OperationCount.getLabel()+"\","
|
||||
+ " \"style\": {"
|
||||
+ " \"color\": \""
|
||||
+ colors.get(1)
|
||||
|
@ -299,9 +304,9 @@ public class JobChart extends SimpleContainer {
|
|||
+ " }"
|
||||
+ " }"
|
||||
+ "} , {"
|
||||
+ " \"id\": \"Duration\", "
|
||||
+ " \"id\": \""+JobChartMeasure.Duration.name()+"\", "
|
||||
+ " \"title\": {"
|
||||
+ " \"text\": \"Duration\","
|
||||
+ " \"text\": \""+JobChartMeasure.Duration.getLabel()+"\","
|
||||
+ " \"style\": {"
|
||||
+ " \"color\": \""
|
||||
+ colors.get(0)
|
||||
|
@ -319,9 +324,9 @@ public class JobChart extends SimpleContainer {
|
|||
+ " \"opposite\": \"true\""
|
||||
+ ", \"showFirstLabel\": \"false\""
|
||||
+ "} , {"
|
||||
+ " \"id\": \"MaxInvocationTime\", "
|
||||
+ " \"id\": \""+JobChartMeasure.MaxInvocationTime.name()+"\", "
|
||||
+ " \"title\": {"
|
||||
+ " \"text\": \"Max Invocation Time\","
|
||||
+ " \"text\": \""+JobChartMeasure.MaxInvocationTime.getLabel()+"\","
|
||||
+ " \"style\": {"
|
||||
+ " \"color\": \""
|
||||
+ colors.get(2)
|
||||
|
@ -339,9 +344,9 @@ public class JobChart extends SimpleContainer {
|
|||
+ " \"opposite\": \"true\""
|
||||
+ ", \"showFirstLabel\": \"false\""
|
||||
+ "} , {"
|
||||
+ " \"id\": \"MinInvocationTime\", "
|
||||
+ " \"id\": \""+JobChartMeasure.MinInvocationTime.name()+"\", "
|
||||
+ " \"title\": {"
|
||||
+ " \"text\": \"Min Invocation Time\","
|
||||
+ " \"text\": \""+JobChartMeasure.MinInvocationTime.getLabel()+"\","
|
||||
+ " \"style\": {"
|
||||
+ " \"color\": \""
|
||||
+ colors.get(3)
|
||||
|
@ -375,7 +380,7 @@ public class JobChart extends SimpleContainer {
|
|||
|
||||
SeriesColumn seriesOperationCount = highchartsFactory
|
||||
.createSeriesColumn();
|
||||
seriesOperationCount.name("Operation Count");
|
||||
seriesOperationCount.name(JobChartMeasure.OperationCount.getLabel());
|
||||
seriesOperationCount.color(colors.get(1));
|
||||
seriesOperationCount.type("column");
|
||||
|
||||
|
@ -386,9 +391,9 @@ public class JobChart extends SimpleContainer {
|
|||
dateStart.getTime());
|
||||
|
||||
SeriesArea seriesDuration = highchartsFactory.createSeriesArea();
|
||||
seriesDuration.name("Duration");
|
||||
seriesDuration.name(JobChartMeasure.Duration.getLabel());
|
||||
seriesDuration.color(colors.get(0));
|
||||
seriesDuration.yAxisAsString("Duration");
|
||||
seriesDuration.yAxisAsString(JobChartMeasure.Duration.name());
|
||||
|
||||
ArrayNumber dataDuration = seriesDuration.dataAsArrayNumber();
|
||||
|
||||
|
@ -396,9 +401,9 @@ public class JobChart extends SimpleContainer {
|
|||
|
||||
SeriesArea seriesMaxInvocationTime = highchartsFactory
|
||||
.createSeriesArea();
|
||||
seriesMaxInvocationTime.name("Max Invocation Time");
|
||||
seriesMaxInvocationTime.name(JobChartMeasure.MaxInvocationTime.getLabel());
|
||||
seriesMaxInvocationTime.color(colors.get(2));
|
||||
seriesMaxInvocationTime.yAxisAsString("MaxInvocationTime");
|
||||
seriesMaxInvocationTime.yAxisAsString(JobChartMeasure.MaxInvocationTime.name());
|
||||
|
||||
ArrayNumber dataMaxInvocationTime = seriesMaxInvocationTime
|
||||
.dataAsArrayNumber();
|
||||
|
@ -408,9 +413,9 @@ public class JobChart extends SimpleContainer {
|
|||
|
||||
SeriesArea seriesMinInvocationTime = highchartsFactory
|
||||
.createSeriesArea();
|
||||
seriesMinInvocationTime.name("Min Invocation Time");
|
||||
seriesMinInvocationTime.name(JobChartMeasure.MinInvocationTime.getLabel());
|
||||
seriesMinInvocationTime.color(colors.get(3));
|
||||
seriesMinInvocationTime.yAxisAsString("MinInvocationTime");
|
||||
seriesMinInvocationTime.yAxisAsString(JobChartMeasure.MinInvocationTime.name());
|
||||
|
||||
ArrayNumber dataMinInvocationTime = seriesMinInvocationTime
|
||||
.dataAsArrayNumber();
|
||||
|
@ -418,7 +423,7 @@ public class JobChart extends SimpleContainer {
|
|||
seriesMinInvocationTime.pointInterval(interval).pointStart(
|
||||
dateStart.getTime());
|
||||
|
||||
for (SeriesJobData seriesServiceData : seriesJob.getSeries()) {
|
||||
for (SeriesJobData seriesServiceData : seriesJobBasic.getSeries()) {
|
||||
dataOperationCount.push(seriesServiceData.getOperationCount());
|
||||
dataDuration.push(seriesServiceData.getOperationCount());
|
||||
dataMaxInvocationTime
|
||||
|
@ -454,9 +459,16 @@ public class JobChart extends SimpleContainer {
|
|||
}
|
||||
|
||||
private void createSingleAxisChart() {
|
||||
SeriesService seriesService = (SeriesService) accountingStateData
|
||||
SeriesJob seriesJob = (SeriesJob) accountingStateData
|
||||
.getSeriesResponse();
|
||||
|
||||
if(!(seriesJob.getSeriesJobDefinition() instanceof SeriesJobBasic)){
|
||||
Log.error("Invalid SeriesJobBasic!");
|
||||
return;
|
||||
}
|
||||
SeriesJobBasic seriesJobBasic=(SeriesJobBasic)seriesJob.getSeriesJobDefinition();
|
||||
|
||||
|
||||
double minRange = ChartTimeMeasure
|
||||
.calculateMinRange(accountingStateData.getSeriesRequest()
|
||||
.getAccountingPeriod());
|
||||
|
@ -499,7 +511,7 @@ public class JobChart extends SimpleContainer {
|
|||
// options.yAxis().title().text("Exchange rate");
|
||||
// Highcharts.getOptions().colors[0]
|
||||
|
||||
String multiAxis = "[{" + " \"id\": \"OperationCount\","
|
||||
String multiAxis = "[{" + " \"id\": \""+JobChartMeasure.OperationCount.name()+"\","
|
||||
+ " \"labels\": { " + " \"format\": \"{value}\","
|
||||
+ " \"style\": { " + " \"color\": \""
|
||||
+ colors.get(1)
|
||||
|
@ -507,7 +519,7 @@ public class JobChart extends SimpleContainer {
|
|||
+ " }"
|
||||
+ " },"
|
||||
+ " \"title\": { "
|
||||
+ " \"text\": \"Operation Count\","
|
||||
+ " \"text\": \""+JobChartMeasure.OperationCount.getLabel()+"\","
|
||||
+ " \"style\": {"
|
||||
+ " \"color\": \""
|
||||
+ colors.get(1)
|
||||
|
@ -550,7 +562,7 @@ public class JobChart extends SimpleContainer {
|
|||
|
||||
SeriesColumn seriesOperationCount = highchartsFactory
|
||||
.createSeriesColumn();
|
||||
seriesOperationCount.name("Operation Count");
|
||||
seriesOperationCount.name(JobChartMeasure.OperationCount.getLabel());
|
||||
seriesOperationCount.color(colors.get(1));
|
||||
seriesOperationCount.type("column");
|
||||
|
||||
|
@ -561,7 +573,7 @@ public class JobChart extends SimpleContainer {
|
|||
dateStart.getTime());
|
||||
|
||||
SeriesArea seriesDuration = highchartsFactory.createSeriesArea();
|
||||
seriesDuration.name("Duration");
|
||||
seriesDuration.name(JobChartMeasure.Duration.getLabel());
|
||||
seriesDuration.color(colors.get(0));
|
||||
|
||||
ArrayNumber dataDuration = seriesDuration.dataAsArrayNumber();
|
||||
|
@ -570,7 +582,7 @@ public class JobChart extends SimpleContainer {
|
|||
|
||||
SeriesArea seriesMaxInvocationTime = highchartsFactory
|
||||
.createSeriesArea();
|
||||
seriesMaxInvocationTime.name("Max Invocation Time");
|
||||
seriesMaxInvocationTime.name(JobChartMeasure.MaxInvocationTime.getLabel());
|
||||
seriesMaxInvocationTime.color(colors.get(2));
|
||||
|
||||
ArrayNumber dataMaxInvocationTime = seriesMaxInvocationTime
|
||||
|
@ -581,7 +593,7 @@ public class JobChart extends SimpleContainer {
|
|||
|
||||
SeriesArea seriesMinInvocationTime = highchartsFactory
|
||||
.createSeriesArea();
|
||||
seriesMinInvocationTime.name("Min Invocation Time");
|
||||
seriesMinInvocationTime.name(JobChartMeasure.MinInvocationTime.getLabel());
|
||||
seriesMinInvocationTime.color(colors.get(3));
|
||||
// seriesMinInvocationTime.yAxisAsString("MinInvocationTime");
|
||||
|
||||
|
@ -591,13 +603,20 @@ public class JobChart extends SimpleContainer {
|
|||
seriesMinInvocationTime.pointInterval(interval).pointStart(
|
||||
dateStart.getTime());
|
||||
|
||||
for (SeriesServiceData seriesServiceData : seriesService.getSeries()) {
|
||||
dataOperationCount.push(seriesServiceData.getOperationCount());
|
||||
dataDuration.push(seriesServiceData.getDuration());
|
||||
for (SeriesJobData seriesJobData : seriesJobBasic.getSeries()) {
|
||||
//TODO fix data
|
||||
dataOperationCount.push(seriesJobData.getOperationCount());
|
||||
dataDuration.push(seriesJobData.getOperationCount());
|
||||
dataMaxInvocationTime
|
||||
.push(seriesServiceData.getMaxInvocationTime());
|
||||
.push(seriesJobData.getOperationCount());
|
||||
dataMinInvocationTime
|
||||
.push(seriesServiceData.getMinInvocationTime());
|
||||
.push(seriesJobData.getOperationCount());
|
||||
|
||||
//dataDuration.push(seriesServiceData.getDuration());
|
||||
//dataMaxInvocationTime
|
||||
// .push(seriesServiceData.getMaxInvocationTime());
|
||||
//dataMinInvocationTime
|
||||
// .push(seriesServiceData.getMinInvocationTime());
|
||||
}
|
||||
|
||||
options.series().addToEnd(seriesOperationCount);
|
|
@ -272,7 +272,7 @@ public class ServiceChartBasicPanel extends SimpleContainer {
|
|||
options = highchartsFactory.createChartOptions();
|
||||
|
||||
options.navigation().buttonOptions().enabled(false);
|
||||
options.exporting().filename("AccountingService");
|
||||
options.exporting().filename("AccountingServiceBasic");
|
||||
options.chart().zoomType("xy");
|
||||
|
||||
options.title().text("Accounting Service");
|
||||
|
@ -458,7 +458,7 @@ public class ServiceChartBasicPanel extends SimpleContainer {
|
|||
.getSeriesResponse();
|
||||
|
||||
if(!(seriesService.getSerieServiceDefinition() instanceof SeriesServiceBasic)){
|
||||
//throw new Exception("Invalid SeriesServiceBasic!");
|
||||
Log.debug("Invalid SeriesServiceBasic!");
|
||||
return;
|
||||
}
|
||||
SeriesServiceBasic seriesServiceBasic=(SeriesServiceBasic)seriesService.getSerieServiceDefinition();
|
||||
|
|
|
@ -9,6 +9,7 @@ import org.gcube.portlets.admin.accountingmanager.client.resource.AccountingMana
|
|||
import org.gcube.portlets.admin.accountingmanager.client.state.AccountingStateData;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesService;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.service.SeriesServiceData;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.service.SeriesServiceTop;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.github.highcharts4gwt.client.view.widget.HighchartsLayoutPanel;
|
||||
|
@ -196,7 +197,7 @@ public class ServiceChartTopPanel extends SimpleContainer {
|
|||
var chart = $wnd
|
||||
.jQuery('#' + id)
|
||||
.highcharts(
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartBasicPanel::options);
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartTopPanel::options);
|
||||
console.log(chart);
|
||||
chart.exportChart();
|
||||
|
||||
|
@ -207,7 +208,7 @@ public class ServiceChartTopPanel extends SimpleContainer {
|
|||
var chart = $wnd
|
||||
.jQuery('#' + id)
|
||||
.highcharts(
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartBasicPanel::options);
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartTopPanel::options);
|
||||
console.log(chart);
|
||||
chart.exportChart({
|
||||
type : 'image/jpeg'
|
||||
|
@ -220,7 +221,7 @@ public class ServiceChartTopPanel extends SimpleContainer {
|
|||
var chart = $wnd
|
||||
.jQuery('#' + id)
|
||||
.highcharts(
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartBasicPanel::options);
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartTopPanel::options);
|
||||
console.log(chart);
|
||||
chart.exportChart({
|
||||
type : 'application/pdf'
|
||||
|
@ -233,7 +234,7 @@ public class ServiceChartTopPanel extends SimpleContainer {
|
|||
var chart = $wnd
|
||||
.jQuery('#' + id)
|
||||
.highcharts(
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartBasicPanel::options);
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartTopPanel::options);
|
||||
console.log(chart);
|
||||
chart.exportChart({
|
||||
type : 'image/svg+xml'
|
||||
|
@ -244,6 +245,13 @@ public class ServiceChartTopPanel extends SimpleContainer {
|
|||
private void createMultiAxisChart() {
|
||||
SeriesService seriesService = (SeriesService) accountingStateData
|
||||
.getSeriesResponse();
|
||||
|
||||
if(!(seriesService.getSerieServiceDefinition() instanceof SeriesServiceTop)){
|
||||
Log.debug("Invalid SeriesServiceTop!");
|
||||
return;
|
||||
}
|
||||
SeriesServiceTop seriesServiceTop=(SeriesServiceTop)seriesService.getSerieServiceDefinition();
|
||||
|
||||
|
||||
double minRange = ChartTimeMeasure
|
||||
.calculateMinRange(accountingStateData.getSeriesRequest()
|
||||
|
@ -267,7 +275,7 @@ public class ServiceChartTopPanel extends SimpleContainer {
|
|||
options = highchartsFactory.createChartOptions();
|
||||
|
||||
options.navigation().buttonOptions().enabled(false);
|
||||
options.exporting().filename("AccountingService");
|
||||
options.exporting().filename("AccountingServiceTop");
|
||||
options.chart().zoomType("xy");
|
||||
|
||||
options.title().text("Accounting Service");
|
||||
|
@ -419,7 +427,7 @@ public class ServiceChartTopPanel extends SimpleContainer {
|
|||
seriesMinInvocationTime.pointInterval(interval).pointStart(
|
||||
dateStart.getTime());
|
||||
|
||||
for (SeriesServiceData seriesServiceData : seriesService.getSeries()) {
|
||||
for (SeriesServiceData seriesServiceData : seriesServiceTop.getSeriesServiceDataTopList().get(0).getSeries()) {
|
||||
dataOperationCount.push(seriesServiceData.getOperationCount());
|
||||
dataDuration.push(seriesServiceData.getDuration());
|
||||
dataMaxInvocationTime
|
||||
|
@ -451,7 +459,14 @@ public class ServiceChartTopPanel extends SimpleContainer {
|
|||
private void createSingleAxisChart() {
|
||||
SeriesService seriesService = (SeriesService) accountingStateData
|
||||
.getSeriesResponse();
|
||||
|
||||
if(!(seriesService.getSerieServiceDefinition() instanceof SeriesServiceTop)){
|
||||
Log.debug("Invalid SeriesServiceTop!");
|
||||
return;
|
||||
}
|
||||
SeriesServiceTop seriesServiceTop=(SeriesServiceTop)seriesService.getSerieServiceDefinition();
|
||||
|
||||
|
||||
double minRange = ChartTimeMeasure
|
||||
.calculateMinRange(accountingStateData.getSeriesRequest()
|
||||
.getAccountingPeriod());
|
||||
|
@ -586,7 +601,7 @@ public class ServiceChartTopPanel extends SimpleContainer {
|
|||
seriesMinInvocationTime.pointInterval(interval).pointStart(
|
||||
dateStart.getTime());
|
||||
|
||||
for (SeriesServiceData seriesServiceData : seriesService.getSeries()) {
|
||||
for (SeriesServiceData seriesServiceData : seriesServiceTop.getSeriesServiceDataTopList().get(0).getSeries()) {
|
||||
dataOperationCount.push(seriesServiceData.getOperationCount());
|
||||
dataDuration.push(seriesServiceData.getDuration());
|
||||
dataMaxInvocationTime
|
||||
|
|
|
@ -8,6 +8,7 @@ import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.D
|
|||
import org.gcube.portlets.admin.accountingmanager.client.resource.AccountingManagerResources;
|
||||
import org.gcube.portlets.admin.accountingmanager.client.state.AccountingStateData;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesStorage;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.storage.SeriesStorageBasic;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.storage.SeriesStorageData;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
|
@ -305,6 +306,12 @@ public class StorageChartBasicPanel extends SimpleContainer {
|
|||
private void createChart() {
|
||||
SeriesStorage seriesStorage = (SeriesStorage) accountingStateData
|
||||
.getSeriesResponse();
|
||||
|
||||
if(!(seriesStorage.getSeriesStorageDefinition() instanceof SeriesStorageBasic)){
|
||||
Log.debug("Invalid SeriesStorageBasic!");
|
||||
return;
|
||||
}
|
||||
SeriesStorageBasic seriesStorageBasic=(SeriesStorageBasic)seriesStorage.getSeriesStorageDefinition();
|
||||
|
||||
double minRange = ChartTimeMeasure
|
||||
.calculateMinRange(accountingStateData.getSeriesRequest()
|
||||
|
@ -329,7 +336,7 @@ public class StorageChartBasicPanel extends SimpleContainer {
|
|||
options = highchartsFactory.createChartOptions();
|
||||
options.chart().zoomType("xy");
|
||||
options.exporting().buttons().contextButton().enabled(false);
|
||||
options.exporting().filename("AccountingStorage");
|
||||
options.exporting().filename("AccountingStorageBasic");
|
||||
options.title().text("Accounting Storage");
|
||||
|
||||
/*
|
||||
|
@ -415,7 +422,7 @@ public class StorageChartBasicPanel extends SimpleContainer {
|
|||
seriesDataVolume.pointInterval(interval)
|
||||
.pointStart(dateStart.getTime());
|
||||
|
||||
for (SeriesStorageData seriesStorageData : seriesStorage.getSeries()) {
|
||||
for (SeriesStorageData seriesStorageData : seriesStorageBasic.getSeries()) {
|
||||
dataOperationCount.push(seriesStorageData.getOperationCount());
|
||||
dataDataVolume
|
||||
.push(seriesStorageData.getDataVolume() / unitMeasure);
|
||||
|
|
|
@ -11,6 +11,7 @@ import org.gcube.portlets.admin.accountingmanager.client.resource.AccountingMana
|
|||
import org.gcube.portlets.admin.accountingmanager.client.state.AccountingStateData;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesStorage;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.storage.SeriesStorageData;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.storage.SeriesStorageTop;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.github.highcharts4gwt.client.view.widget.HighchartsLayoutPanel;
|
||||
|
@ -47,7 +48,7 @@ import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
|
|||
public class StorageChartTopPanel extends SimpleContainer {
|
||||
|
||||
private static final String DATA_VOLUME_UNIT = "Data Volume Unit";
|
||||
private static final String MEASURE_TYPE = "Measure";
|
||||
// private static final String MEASURE_TYPE = "Measure";
|
||||
|
||||
private DateTimeFormat dtf = DateTimeFormat
|
||||
.getFormat(PredefinedFormat.YEAR_MONTH_DAY);
|
||||
|
@ -73,9 +74,13 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
|
||||
private ChartOptions options;
|
||||
|
||||
private StorageChartMeasure measure = StorageChartMeasure.DataVolume;
|
||||
private TextButton measureButton;
|
||||
|
||||
private VerticalLayoutContainer vert;
|
||||
private long unitMeasure = ByteUnitMeasure.getMegaByteDimForStorage();
|
||||
private String unitMeasureLabel = ByteUnitMeasure.MB;
|
||||
private TextButton unitButton;
|
||||
|
||||
public StorageChartTopPanel(AccountingStateData accountingStateData) {
|
||||
this.accountingStateData = accountingStateData;
|
||||
|
@ -97,14 +102,15 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
downloadButton.setMenu(createDownloadMenu());
|
||||
|
||||
// Measure
|
||||
final TextButton measureButton = new TextButton(MEASURE_TYPE,
|
||||
measureButton = new TextButton(
|
||||
StorageChartMeasure.DataVolume.getLabel(),
|
||||
AccountingManagerResources.INSTANCE.accountingByte24());
|
||||
measureButton.setIconAlign(IconAlign.RIGHT);
|
||||
measureButton.setArrowAlign(ButtonArrowAlign.RIGHT);
|
||||
measureButton.setMenu(createMeasureMenu());
|
||||
|
||||
// Unit
|
||||
final TextButton unitButton = new TextButton(DATA_VOLUME_UNIT,
|
||||
unitButton = new TextButton(DATA_VOLUME_UNIT,
|
||||
AccountingManagerResources.INSTANCE.accountingByte24());
|
||||
unitButton.setIconAlign(IconAlign.RIGHT);
|
||||
unitButton.setArrowAlign(ButtonArrowAlign.RIGHT);
|
||||
|
@ -215,7 +221,8 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
|
||||
@Override
|
||||
public void onSelection(SelectionEvent<Item> event) {
|
||||
// DataVolume
|
||||
measureButton.setText(StorageChartMeasure.DataVolume.getLabel());
|
||||
measure=StorageChartMeasure.DataVolume;
|
||||
updateChart();
|
||||
}
|
||||
});
|
||||
|
@ -224,7 +231,9 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
|
||||
@Override
|
||||
public void onSelection(SelectionEvent<Item> event) {
|
||||
// OperationCount
|
||||
measureButton.setText(StorageChartMeasure.OperationCount
|
||||
.getLabel());
|
||||
measure=StorageChartMeasure.OperationCount;
|
||||
updateChart();
|
||||
}
|
||||
});
|
||||
|
@ -351,6 +360,13 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
SeriesStorage seriesStorage = (SeriesStorage) accountingStateData
|
||||
.getSeriesResponse();
|
||||
|
||||
if (!(seriesStorage.getSeriesStorageDefinition() instanceof SeriesStorageTop)) {
|
||||
Log.debug("Invalid SeriesStorageTop!");
|
||||
return;
|
||||
}
|
||||
SeriesStorageTop seriesStorageTop = (SeriesStorageTop) seriesStorage
|
||||
.getSeriesStorageDefinition();
|
||||
|
||||
double minRange = ChartTimeMeasure
|
||||
.calculateMinRange(accountingStateData.getSeriesRequest()
|
||||
.getAccountingPeriod());
|
||||
|
@ -400,19 +416,34 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
+ " }" + " }");
|
||||
|
||||
ArrayList<SeriesColumn> seriesColumn = new ArrayList<>();
|
||||
for (int i = 1; i < 6; i++) {
|
||||
for (int i = 0; i < seriesStorageTop.getSeriesStorageDataTopList()
|
||||
.size(); i++) {
|
||||
SeriesColumn seriesColumnData = highchartsFactory
|
||||
.createSeriesColumn();
|
||||
seriesColumnData.name("Operation Count" + i);
|
||||
|
||||
seriesColumnData.name(seriesStorageTop
|
||||
.getSeriesStorageDataTopList().get(i).getFilterValue()
|
||||
.getValue());
|
||||
seriesColumnData.color(colors.get(i));
|
||||
seriesColumnData.type("column");
|
||||
|
||||
ArrayNumber data = seriesColumnData
|
||||
.dataAsArrayNumber();
|
||||
ArrayNumber data = seriesColumnData.dataAsArrayNumber();
|
||||
|
||||
for (SeriesStorageData seriesStorageData : seriesStorageTop
|
||||
.getSeriesStorageDataTopList().get(i).getSeries()) {
|
||||
switch (measure) {
|
||||
case DataVolume:
|
||||
data.push(seriesStorageData.getDataVolume());
|
||||
break;
|
||||
case OperationCount:
|
||||
data.push(seriesStorageData.getOperationCount());
|
||||
break;
|
||||
default:
|
||||
data.push(seriesStorageData.getDataVolume());
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
for (SeriesStorageData seriesStorageData : seriesStorage
|
||||
.getSeries()) {
|
||||
data.push(seriesStorageData.getOperationCount());
|
||||
}
|
||||
|
||||
seriesColumnData.pointInterval(interval).pointStart(
|
||||
|
@ -432,66 +463,45 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
}
|
||||
|
||||
private String retrieveYAxis(ArrayString colors) {
|
||||
StorageChartMeasure storageChartMeasure = StorageChartMeasure.DataVolume;
|
||||
|
||||
switch (storageChartMeasure) {
|
||||
switch (measure) {
|
||||
case DataVolume:
|
||||
return "[{" + " \"id\": \"Data Volume\"," + " \"labels\": {"
|
||||
+ " \"format\": \"{value} "
|
||||
+ unitMeasureLabel
|
||||
+ "\","
|
||||
+ " \"style\": {"
|
||||
+ " \"color\": \""
|
||||
+ colors.get(0)
|
||||
+ "\""
|
||||
+ " }"
|
||||
+ " },"
|
||||
+ " \"stackLabels\": {"
|
||||
+ " \"enabled\": \"true\","
|
||||
+ " \"style\": {"
|
||||
+ " \"fontWeight\": \"bold\","
|
||||
+ " \"color\": \"gray\""
|
||||
+ " } "
|
||||
+ " },"
|
||||
+ " \"title\": { "
|
||||
+ " \"text\": \"Data Volume\","
|
||||
+ " \"style\": {"
|
||||
+ " \"color\": \""
|
||||
+ colors.get(1) + "\"" + " }" + " }" + "}]";
|
||||
|
||||
case OperationCount:
|
||||
return "[{" + " \"id\": \"OperationCount\"," + " \"labels\": { "
|
||||
+ " \"format\": \"{value}\"," + " \"style\": { "
|
||||
+ " \"color\": \"" + colors.get(1) + "\"" + " }"
|
||||
return "[{" + " \"id\": \"" + StorageChartMeasure.DataVolume.name()
|
||||
+ "\"," + " \"labels\": {" + " \"format\": \"{value} "
|
||||
+ unitMeasureLabel + "\"," + " \"style\": {"
|
||||
+ " \"color\": \"" + colors.get(0) + "\"" + " }"
|
||||
+ " }," + " \"stackLabels\": {" + " \"enabled\": \"true\","
|
||||
+ " \"style\": {" + " \"fontWeight\": \"bold\","
|
||||
+ " \"color\": \"gray\"" + " } " + " },"
|
||||
+ " \"title\": { " + " \"text\": \"Operation Count\","
|
||||
+ " \"title\": { " + " \"text\": \""
|
||||
+ StorageChartMeasure.DataVolume.getLabel() + "\","
|
||||
+ " \"style\": {" + " \"color\": \""
|
||||
+ colors.get(1) + "\"" + " }" + " }" + "}]";
|
||||
|
||||
case OperationCount:
|
||||
return "[{" + " \"id\": \""
|
||||
+ StorageChartMeasure.OperationCount.name() + "\","
|
||||
+ " \"labels\": { " + " \"format\": \"{value}\","
|
||||
+ " \"style\": { " + " \"color\": \""
|
||||
+ colors.get(1) + "\"" + " }" + " },"
|
||||
+ " \"stackLabels\": {" + " \"enabled\": \"true\","
|
||||
+ " \"style\": {" + " \"fontWeight\": \"bold\","
|
||||
+ " \"color\": \"gray\"" + " } " + " },"
|
||||
+ " \"title\": { " + " \"text\": \""
|
||||
+ StorageChartMeasure.OperationCount.getLabel() + "\","
|
||||
+ " \"style\": {" + " \"color\": \""
|
||||
+ colors.get(1) + "\"" + " }" + " }" + "}]";
|
||||
|
||||
default:
|
||||
return "[{" + " \"id\": \"Data Volume\"," + " \"labels\": {"
|
||||
+ " \"format\": \"{value} "
|
||||
+ unitMeasureLabel
|
||||
+ "\","
|
||||
+ " \"style\": {"
|
||||
+ " \"color\": \""
|
||||
+ colors.get(0)
|
||||
+ "\""
|
||||
+ " }"
|
||||
+ " },"
|
||||
+ " \"stackLabels\": {"
|
||||
+ " \"enabled\": \"true\","
|
||||
+ " \"style\": {"
|
||||
+ " \"fontWeight\": \"bold\","
|
||||
+ " \"color\": \"gray\""
|
||||
+ " } "
|
||||
+ " },"
|
||||
+ " \"title\": { "
|
||||
+ " \"text\": \"Data Volume\","
|
||||
+ " \"style\": {"
|
||||
+ " \"color\": \""
|
||||
return "[{" + " \"id\": \"" + StorageChartMeasure.DataVolume.name()
|
||||
+ "\"," + " \"labels\": {" + " \"format\": \"{value} "
|
||||
+ unitMeasureLabel + "\"," + " \"style\": {"
|
||||
+ " \"color\": \"" + colors.get(0) + "\"" + " }"
|
||||
+ " }," + " \"stackLabels\": {" + " \"enabled\": \"true\","
|
||||
+ " \"style\": {" + " \"fontWeight\": \"bold\","
|
||||
+ " \"color\": \"gray\"" + " } " + " },"
|
||||
+ " \"title\": { " + " \"text\": \""
|
||||
+ StorageChartMeasure.DataVolume.getLabel() + "\","
|
||||
+ " \"style\": {" + " \"color\": \""
|
||||
+ colors.get(1) + "\"" + " }" + " }" + "}]";
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Storage Chart Measure
|
||||
*
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
|
||||
public enum JobChartMeasure {
|
||||
|
||||
Duration("Duration"), MaxInvocationTime("Max Invocation Time"), MinInvocationTime(
|
||||
"Min Invocation Time"), OperationCount("Operation Count");
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
private JobChartMeasure(final String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
private final String id;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public static JobChartMeasure getFromId(String id) {
|
||||
if (id == null || id.isEmpty())
|
||||
return null;
|
||||
|
||||
for (JobChartMeasure measure : values()) {
|
||||
if (measure.id.compareToIgnoreCase(id) == 0) {
|
||||
return measure;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List<JobChartMeasure> asList() {
|
||||
List<JobChartMeasure> list = Arrays.asList(values());
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
|
@ -49,9 +49,9 @@ public enum ServiceChartMeasure {
|
|||
if (id == null || id.isEmpty())
|
||||
return null;
|
||||
|
||||
for (ServiceChartMeasure columnDataType : values()) {
|
||||
if (columnDataType.id.compareToIgnoreCase(id) == 0) {
|
||||
return columnDataType;
|
||||
for (ServiceChartMeasure measure : values()) {
|
||||
if (measure.id.compareToIgnoreCase(id) == 0) {
|
||||
return measure;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -48,9 +48,9 @@ public enum StorageChartMeasure {
|
|||
if (id == null || id.isEmpty())
|
||||
return null;
|
||||
|
||||
for (StorageChartMeasure columnDataType : values()) {
|
||||
if (columnDataType.id.compareToIgnoreCase(id) == 0) {
|
||||
return columnDataType;
|
||||
for (StorageChartMeasure measure : values()) {
|
||||
if (measure.id.compareToIgnoreCase(id) == 0) {
|
||||
return measure;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -78,7 +78,7 @@ public class AccountingCaller implements AccountingCallerInterface {
|
|||
switch (query.getChartType()) {
|
||||
case Basic:
|
||||
AccountingQueryBasic accountingQueryBasic = (AccountingQueryBasic) query;
|
||||
AccountingCommandBasic accountingCommandBasic=new AccountingCommandBasic(accountingQueryBasic,accountingType, seriesRequest);
|
||||
AccountingCommandBasic accountingCommandBasic=new AccountingCommandBasic(accountingQueryBasic,accountingType);
|
||||
return accountingCommandBasic.execute();
|
||||
case Top:
|
||||
AccountingQueryTop accountingQueryTop = (AccountingQueryTop) query;
|
||||
|
|
|
@ -5,22 +5,30 @@ import java.util.Arrays;
|
|||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.query.AccountingQuery4Job;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.query.AccountingQuery4Portlet;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.query.AccountingQuery4Service;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.query.AccountingQuery4Storage;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.query.AccountingQuery4Task;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.query.AccountingQueryBuilder;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingType;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.FilterKey;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.FilterValue;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.FilterValuesRequest;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.query.SeriesRequest;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesJob;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesResponse;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesService;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesStorage;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.job.SeriesJobBasic;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.job.SeriesJobData;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.job.SeriesJobDataTop;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.job.SeriesJobDefinition;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.job.SeriesJobTop;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.service.SeriesServiceBasic;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.service.SeriesServiceData;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.service.SeriesServiceDataTop;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.service.SeriesServiceDefinition;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.service.SeriesServiceTop;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.storage.SeriesStorageBasic;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.storage.SeriesStorageData;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.storage.SeriesStorageDataTop;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.storage.SeriesStorageDefinition;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.storage.SeriesStorageTop;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.AccountingManagerServiceException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -120,30 +128,111 @@ public class AccountingCallerTester implements AccountingCallerInterface {
|
|||
SeriesResponse seriesResponse = null;
|
||||
switch (accountingType) {
|
||||
case JOB:
|
||||
SeriesJobDefinition serieJobDefinition = null;
|
||||
if (seriesRequest.getAccountingFilterDefinition()
|
||||
.getChartType() != null) {
|
||||
ArrayList<SeriesJobData> seriesJobData = new ArrayList<>();
|
||||
for (int i = 0; i < 30; i++) {
|
||||
SeriesJobData data = new SeriesJobData(
|
||||
new Date(),
|
||||
new Double(10 * Math.random()).longValue(),
|
||||
new Double(10 * Math.random()).longValue(),
|
||||
new Double(10 * Math.random()).longValue(),
|
||||
new Double(100 * Math.random()).longValue());
|
||||
seriesJobData.add(data);
|
||||
|
||||
}
|
||||
switch (seriesRequest.getAccountingFilterDefinition()
|
||||
.getChartType()) {
|
||||
case Basic:
|
||||
serieJobDefinition = new SeriesJobBasic(seriesJobData);
|
||||
break;
|
||||
case Top:
|
||||
ArrayList<SeriesJobDataTop> seriesJobDataTopList=new ArrayList<>();
|
||||
SeriesJobDataTop seriesJobDataTop = new SeriesJobDataTop(
|
||||
new FilterValue("giancarlo.panichi"),
|
||||
seriesJobData);
|
||||
seriesJobDataTopList.add(seriesJobDataTop);
|
||||
serieJobDefinition = new SeriesJobTop(
|
||||
seriesJobDataTopList);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
seriesResponse = new SeriesJob(serieJobDefinition);
|
||||
|
||||
break;
|
||||
case PORTLET:
|
||||
break;
|
||||
case SERVICE:
|
||||
break;
|
||||
case STORAGE:
|
||||
SeriesStorageDefinition serieStorageDefinition=null;
|
||||
SeriesServiceDefinition serieServiceDefinition = null;
|
||||
if (seriesRequest.getAccountingFilterDefinition()
|
||||
.getChartType() != null) {
|
||||
ArrayList<SeriesServiceData> seriesServiceData = new ArrayList<>();
|
||||
for (int i = 0; i < 30; i++) {
|
||||
SeriesServiceData data = new SeriesServiceData(
|
||||
new Date(),
|
||||
new Double(10 * Math.random()).longValue(),
|
||||
new Double(10 * Math.random()).longValue(),
|
||||
new Double(10 * Math.random()).longValue(),
|
||||
new Double(100 * Math.random()).longValue());
|
||||
seriesServiceData.add(data);
|
||||
|
||||
}
|
||||
switch (seriesRequest.getAccountingFilterDefinition()
|
||||
.getChartType()) {
|
||||
case Basic:
|
||||
ArrayList<SeriesStorageData> seriesStorageData = new ArrayList<>();
|
||||
for (int i = 0; i < 30; i++) {
|
||||
SeriesStorageData data = new SeriesStorageData(
|
||||
new Date(),
|
||||
new Double(10 * Math.random()).longValue(),
|
||||
new Double(100 * Math.random()).longValue());
|
||||
seriesStorageData.add(data);
|
||||
|
||||
}
|
||||
serieStorageDefinition=new SeriesStorageBasic(seriesStorageData);
|
||||
serieServiceDefinition = new SeriesServiceBasic(seriesServiceData);
|
||||
break;
|
||||
case Top:
|
||||
ArrayList<SeriesServiceDataTop> seriesServiceDataTopList=new ArrayList<>();
|
||||
SeriesServiceDataTop seriesServiceDataTop = new SeriesServiceDataTop(
|
||||
new FilterValue("giancarlo.panichi"),
|
||||
seriesServiceData);
|
||||
seriesServiceDataTopList.add(seriesServiceDataTop);
|
||||
serieServiceDefinition = new SeriesServiceTop(
|
||||
seriesServiceDataTopList);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
seriesResponse = new SeriesService(serieServiceDefinition);
|
||||
|
||||
|
||||
break;
|
||||
case STORAGE:
|
||||
SeriesStorageDefinition serieStorageDefinition = null;
|
||||
if (seriesRequest.getAccountingFilterDefinition()
|
||||
.getChartType() != null) {
|
||||
ArrayList<SeriesStorageData> seriesStorageData = new ArrayList<>();
|
||||
for (int i = 0; i < 30; i++) {
|
||||
SeriesStorageData data = new SeriesStorageData(
|
||||
new Date(),
|
||||
new Double(10 * Math.random()).longValue(),
|
||||
new Double(100 * Math.random()).longValue());
|
||||
seriesStorageData.add(data);
|
||||
|
||||
}
|
||||
switch (seriesRequest.getAccountingFilterDefinition()
|
||||
.getChartType()) {
|
||||
case Basic:
|
||||
serieStorageDefinition = new SeriesStorageBasic(
|
||||
seriesStorageData);
|
||||
break;
|
||||
case Top:
|
||||
ArrayList<SeriesStorageDataTop> seriesStorageDataTopList=new ArrayList<>();
|
||||
SeriesStorageDataTop seriesStorageDataTop = new SeriesStorageDataTop(
|
||||
new FilterValue("giancarlo.panichi"),
|
||||
seriesStorageData);
|
||||
seriesStorageDataTopList.add(seriesStorageDataTop);
|
||||
serieStorageDefinition = new SeriesStorageTop(
|
||||
seriesStorageDataTopList);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -175,6 +264,4 @@ public class AccountingCallerTester implements AccountingCallerInterface {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -5,15 +5,14 @@ import java.util.List;
|
|||
import org.gcube.accounting.analytics.Info;
|
||||
import org.gcube.accounting.analytics.ResourceRecordQuery;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.query.AccountingQueryBasic;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.response.SeriesResponse4Job;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.response.SeriesResponse4Portlet;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.response.SeriesResponse4Service;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.response.SeriesResponse4Storage;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.response.SeriesResponse4Task;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.response.SeriesResponse4JobBasic;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.response.SeriesResponse4PortletBasic;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.response.SeriesResponse4ServiceBasic;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.response.SeriesResponse4StorageBasic;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.response.SeriesResponse4TaskBasic;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.response.SeriesResponseBuilder;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.response.SeriesResponseDirector;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingType;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.query.SeriesRequest;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesResponse;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.AccountingManagerServiceException;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -30,12 +29,10 @@ public class AccountingCommandBasic implements AccountingCommand<SeriesResponse>
|
|||
|
||||
private AccountingQueryBasic accountingQueryBasic;
|
||||
private AccountingType accountingType;
|
||||
private SeriesRequest seriesRequest;
|
||||
|
||||
public AccountingCommandBasic(AccountingQueryBasic accountingQueryBasic, AccountingType accountingType, SeriesRequest seriesRequest){
|
||||
public AccountingCommandBasic(AccountingQueryBasic accountingQueryBasic, AccountingType accountingType){
|
||||
this.accountingQueryBasic=accountingQueryBasic;
|
||||
this.accountingType=accountingType;
|
||||
this.seriesRequest=seriesRequest;
|
||||
}
|
||||
|
||||
|
||||
|
@ -87,15 +84,15 @@ public class AccountingCommandBasic implements AccountingCommand<SeriesResponse>
|
|||
|
||||
switch (accountingType) {
|
||||
case JOB:
|
||||
return new SeriesResponse4Job(infos);
|
||||
return new SeriesResponse4JobBasic(infos);
|
||||
case PORTLET:
|
||||
return new SeriesResponse4Portlet(infos);
|
||||
return new SeriesResponse4PortletBasic(infos);
|
||||
case SERVICE:
|
||||
return new SeriesResponse4Service(infos);
|
||||
return new SeriesResponse4ServiceBasic(infos);
|
||||
case STORAGE:
|
||||
return new SeriesResponse4Storage(infos);
|
||||
return new SeriesResponse4StorageBasic(infos);
|
||||
case TASK:
|
||||
return new SeriesResponse4Task(infos);
|
||||
return new SeriesResponse4TaskBasic(infos);
|
||||
default:
|
||||
throw new AccountingManagerServiceException(
|
||||
"Error request type is unknow!");
|
||||
|
|
|
@ -5,11 +5,16 @@ import java.util.List;
|
|||
import org.gcube.accounting.analytics.Info;
|
||||
import org.gcube.accounting.analytics.ResourceRecordQuery;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.query.AccountingQueryTop;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.response.SeriesResponse4Job;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.response.SeriesResponse4Portlet;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.response.SeriesResponse4Service;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.response.SeriesResponse4Storage;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.response.SeriesResponse4Task;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.response.SeriesResponse4JobBasic;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.response.SeriesResponse4JobTop;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.response.SeriesResponse4PortletBasic;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.response.SeriesResponse4PortletTop;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.response.SeriesResponse4ServiceBasic;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.response.SeriesResponse4ServiceTop;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.response.SeriesResponse4StorageBasic;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.response.SeriesResponse4StorageTop;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.response.SeriesResponse4TaskBasic;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.response.SeriesResponse4TaskTop;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.response.SeriesResponseBuilder;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingType;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.query.SeriesRequest;
|
||||
|
@ -90,15 +95,15 @@ public class AccountingCommandTop implements AccountingCommand<SeriesResponse> {
|
|||
|
||||
switch (accountingType) {
|
||||
case JOB:
|
||||
return new SeriesResponse4Job(infos);
|
||||
return new SeriesResponse4JobTop(infos);
|
||||
case PORTLET:
|
||||
return new SeriesResponse4Portlet(infos);
|
||||
return new SeriesResponse4PortletTop(infos);
|
||||
case SERVICE:
|
||||
return new SeriesResponse4Service(infos);
|
||||
return new SeriesResponse4ServiceTop(infos);
|
||||
case STORAGE:
|
||||
return new SeriesResponse4Storage(infos);
|
||||
return new SeriesResponse4StorageTop(infos);
|
||||
case TASK:
|
||||
return new SeriesResponse4Task(infos);
|
||||
return new SeriesResponse4TaskTop(infos);
|
||||
default:
|
||||
throw new AccountingManagerServiceException(
|
||||
"Error request type is unknow!");
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.server.amservice.response;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.accounting.analytics.Info;
|
||||
import org.gcube.accounting.datamodel.aggregation.AggregatedJobUsageRecord;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesJob;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.job.SeriesJobBasic;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.job.SeriesJobData;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.AccountingManagerServiceException;
|
||||
import org.json.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Series Response 4 Job Basic
|
||||
*
|
||||
* @author "Giancarlo Panichi" email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class SeriesResponse4JobBasic extends SeriesResponseBuilder {
|
||||
protected static Logger logger = LoggerFactory
|
||||
.getLogger(SeriesResponse4JobBasic.class);
|
||||
private List<Info> infos;
|
||||
|
||||
public SeriesResponse4JobBasic(List<Info> infos) {
|
||||
this.infos = infos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildSeriesResponse() throws AccountingManagerServiceException {
|
||||
try {
|
||||
if (infos.size() <= 0) {
|
||||
logger.error("Error creating series for job accounting: No data available!");
|
||||
throw new AccountingManagerServiceException(
|
||||
"No data available!");
|
||||
}
|
||||
|
||||
ArrayList<SeriesJobData> series = new ArrayList<SeriesJobData>();
|
||||
for (Info info : infos) {
|
||||
JSONObject jso = info.getValue();
|
||||
// Long duration =
|
||||
// jso.getLong(AggregatedJobUsageRecord.DURATION);
|
||||
Long operationCount = jso
|
||||
.getLong(AggregatedJobUsageRecord.OPERATION_COUNT);
|
||||
// Long maxInvocationTime =
|
||||
// jso.getLong(AggregatedServiceUsageRecord.MAX_INVOCATION_TIME);
|
||||
// Long minInvocationTime =
|
||||
// jso.getLong(AggregatedServiceUsageRecord.MIN_INVOCATION_TIME);
|
||||
|
||||
series.add(new SeriesJobData(info.getCalendar().getTime(),
|
||||
operationCount, operationCount, operationCount,
|
||||
operationCount));
|
||||
|
||||
}
|
||||
|
||||
SeriesJobBasic seriesJobBasic = new SeriesJobBasic(series);
|
||||
|
||||
SeriesJob seriesJob = new SeriesJob(seriesJobBasic);
|
||||
|
||||
seriesResponseSpec.setSr(seriesJob);
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error creating series for job accounting basic chart: "
|
||||
+ e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new AccountingManagerServiceException(
|
||||
"Error creating series for job accounting basic chart: "
|
||||
+ e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -6,6 +6,7 @@ import java.util.List;
|
|||
import org.gcube.accounting.analytics.Info;
|
||||
import org.gcube.accounting.datamodel.aggregation.AggregatedJobUsageRecord;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesJob;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.job.SeriesJobBasic;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.job.SeriesJobData;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.AccountingManagerServiceException;
|
||||
import org.json.JSONObject;
|
||||
|
@ -13,18 +14,18 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Series Response 4 Job
|
||||
* Series Response 4 Job Basic
|
||||
*
|
||||
* @author "Giancarlo Panichi" email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class SeriesResponse4Job extends SeriesResponseBuilder {
|
||||
public class SeriesResponse4JobTop extends SeriesResponseBuilder {
|
||||
protected static Logger logger = LoggerFactory
|
||||
.getLogger(SeriesResponse4Job.class);
|
||||
.getLogger(SeriesResponse4JobTop.class);
|
||||
private List<Info> infos;
|
||||
|
||||
public SeriesResponse4Job(List<Info> infos) {
|
||||
public SeriesResponse4JobTop(List<Info> infos) {
|
||||
this.infos=infos;
|
||||
}
|
||||
|
||||
|
@ -45,17 +46,21 @@ public class SeriesResponse4Job extends SeriesResponseBuilder {
|
|||
//Long maxInvocationTime = jso.getLong(AggregatedServiceUsageRecord.MAX_INVOCATION_TIME);
|
||||
//Long minInvocationTime = jso.getLong(AggregatedServiceUsageRecord.MIN_INVOCATION_TIME);
|
||||
|
||||
series.add(new SeriesJobData(info.getCalendar().getTime(), operationCount));
|
||||
series.add(new SeriesJobData(info.getCalendar().getTime(),
|
||||
operationCount, operationCount, operationCount,
|
||||
operationCount));
|
||||
|
||||
}
|
||||
|
||||
SeriesJob seriesService = new SeriesJob(series);
|
||||
SeriesJobBasic seriesJobBasic=new SeriesJobBasic(series);
|
||||
|
||||
SeriesJob seriesJob = new SeriesJob(seriesJobBasic);
|
||||
|
||||
seriesResponseSpec.setSr(seriesService);
|
||||
seriesResponseSpec.setSr(seriesJob);
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error creating series for job accounting: "+e.getLocalizedMessage());
|
||||
logger.error("Error creating series for job accounting basic chart: "+e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new AccountingManagerServiceException("Error creating series for job accounting: "+e.getLocalizedMessage());
|
||||
throw new AccountingManagerServiceException("Error creating series for job accounting basic chart: "+e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.server.amservice.response;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.accounting.analytics.Info;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesResponse;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.AccountingManagerServiceException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Series Response 4 Portlet Basic
|
||||
*
|
||||
* @author "Giancarlo Panichi" email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class SeriesResponse4PortletBasic extends SeriesResponseBuilder {
|
||||
protected static Logger logger = LoggerFactory
|
||||
.getLogger(SeriesResponse4PortletBasic.class);
|
||||
|
||||
private List<Info> infos;
|
||||
|
||||
public SeriesResponse4PortletBasic(List<Info> infos) {
|
||||
this.infos=infos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildSeriesResponse() throws AccountingManagerServiceException {
|
||||
if(infos.size()<=0){
|
||||
logger.error("Error creating series for portlet accounting: No data available!");
|
||||
throw new AccountingManagerServiceException("No data available!");
|
||||
}
|
||||
|
||||
//SeriesPortletBasic seriesPortletBasic=new SeriesPortletBasic(series);
|
||||
//SeriesPortlet seriesPortlet = new SeriesPortlet(seriesPortletBasic);
|
||||
|
||||
SeriesResponse seriesResponse = new SeriesResponse();
|
||||
|
||||
seriesResponseSpec.setSr(seriesResponse);
|
||||
|
||||
}
|
||||
}
|
|
@ -9,19 +9,19 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Series Response 4 Portlet
|
||||
* Series Response 4 Portlet Basic
|
||||
*
|
||||
* @author "Giancarlo Panichi" email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class SeriesResponse4Portlet extends SeriesResponseBuilder {
|
||||
public class SeriesResponse4PortletTop extends SeriesResponseBuilder {
|
||||
protected static Logger logger = LoggerFactory
|
||||
.getLogger(SeriesResponse4Portlet.class);
|
||||
.getLogger(SeriesResponse4PortletTop.class);
|
||||
|
||||
private List<Info> infos;
|
||||
|
||||
public SeriesResponse4Portlet(List<Info> infos) {
|
||||
public SeriesResponse4PortletTop(List<Info> infos) {
|
||||
this.infos=infos;
|
||||
}
|
||||
|
||||
|
@ -32,6 +32,9 @@ public class SeriesResponse4Portlet extends SeriesResponseBuilder {
|
|||
throw new AccountingManagerServiceException("No data available!");
|
||||
}
|
||||
|
||||
//SeriesPortletBasic seriesPortletBasic=new SeriesPortletBasic(series);
|
||||
//SeriesPortlet seriesPortlet = new SeriesPortlet(seriesPortletBasic);
|
||||
|
||||
SeriesResponse seriesResponse = new SeriesResponse();
|
||||
|
||||
seriesResponseSpec.setSr(seriesResponse);
|
|
@ -0,0 +1,65 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.server.amservice.response;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.accounting.analytics.Info;
|
||||
import org.gcube.accounting.datamodel.aggregation.AggregatedServiceUsageRecord;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesService;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.service.SeriesServiceBasic;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.service.SeriesServiceData;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.AccountingManagerServiceException;
|
||||
import org.json.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Series Response 4 Service Basic
|
||||
*
|
||||
* @author "Giancarlo Panichi" email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class SeriesResponse4ServiceBasic extends SeriesResponseBuilder {
|
||||
protected static Logger logger = LoggerFactory
|
||||
.getLogger(SeriesResponse4ServiceBasic.class);
|
||||
private List<Info> infos;
|
||||
|
||||
public SeriesResponse4ServiceBasic(List<Info> infos) {
|
||||
this.infos=infos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildSeriesResponse() throws AccountingManagerServiceException {
|
||||
try {
|
||||
if(infos.size()<=0){
|
||||
logger.error("Error creating series for service accounting: No data available!");
|
||||
throw new AccountingManagerServiceException("No data available!");
|
||||
}
|
||||
|
||||
ArrayList<SeriesServiceData> series=new ArrayList<SeriesServiceData>();
|
||||
for (Info info : infos) {
|
||||
JSONObject jso = info.getValue();
|
||||
Long duration = jso.getLong(AggregatedServiceUsageRecord.DURATION);
|
||||
Long operationCount = jso
|
||||
.getLong(AggregatedServiceUsageRecord.OPERATION_COUNT);
|
||||
Long maxInvocationTime = jso.getLong(AggregatedServiceUsageRecord.MAX_INVOCATION_TIME);
|
||||
Long minInvocationTime = jso.getLong(AggregatedServiceUsageRecord.MIN_INVOCATION_TIME);
|
||||
|
||||
series.add(new SeriesServiceData(info.getCalendar().getTime(), operationCount, duration, maxInvocationTime, minInvocationTime));
|
||||
|
||||
}
|
||||
|
||||
SeriesServiceBasic seriesServiceBasic=new SeriesServiceBasic(series);
|
||||
|
||||
SeriesService seriesService = new SeriesService(seriesServiceBasic);
|
||||
|
||||
seriesResponseSpec.setSr(seriesService);
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error creating series for service accounting chart basic: "+e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new AccountingManagerServiceException("Error creating series for service accounting chart basic: "+e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -6,6 +6,7 @@ import java.util.List;
|
|||
import org.gcube.accounting.analytics.Info;
|
||||
import org.gcube.accounting.datamodel.aggregation.AggregatedServiceUsageRecord;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesService;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.service.SeriesServiceBasic;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.service.SeriesServiceData;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.AccountingManagerServiceException;
|
||||
import org.json.JSONObject;
|
||||
|
@ -13,18 +14,18 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Series Response 4 Service
|
||||
* Series Response 4 Service Basic
|
||||
*
|
||||
* @author "Giancarlo Panichi" email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class SeriesResponse4Service extends SeriesResponseBuilder {
|
||||
public class SeriesResponse4ServiceTop extends SeriesResponseBuilder {
|
||||
protected static Logger logger = LoggerFactory
|
||||
.getLogger(SeriesResponse4Service.class);
|
||||
.getLogger(SeriesResponse4ServiceTop.class);
|
||||
private List<Info> infos;
|
||||
|
||||
public SeriesResponse4Service(List<Info> infos) {
|
||||
public SeriesResponse4ServiceTop(List<Info> infos) {
|
||||
this.infos=infos;
|
||||
}
|
||||
|
||||
|
@ -49,13 +50,15 @@ public class SeriesResponse4Service extends SeriesResponseBuilder {
|
|||
|
||||
}
|
||||
|
||||
SeriesService seriesService = new SeriesService(series);
|
||||
SeriesServiceBasic seriesServiceBasic=new SeriesServiceBasic(series);
|
||||
|
||||
SeriesService seriesService = new SeriesService(seriesServiceBasic);
|
||||
|
||||
seriesResponseSpec.setSr(seriesService);
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error creating series for service accounting: "+e.getLocalizedMessage());
|
||||
logger.error("Error creating series for service accounting chart basic: "+e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new AccountingManagerServiceException("Error creating series for service accounting: "+e.getLocalizedMessage());
|
||||
throw new AccountingManagerServiceException("Error creating series for service accounting chart basic: "+e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
}
|
|
@ -6,6 +6,7 @@ import java.util.List;
|
|||
import org.gcube.accounting.analytics.Info;
|
||||
import org.gcube.accounting.datamodel.aggregation.AggregatedStorageUsageRecord;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesStorage;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.storage.SeriesStorageBasic;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.storage.SeriesStorageData;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.AccountingManagerServiceException;
|
||||
import org.json.JSONObject;
|
||||
|
@ -13,18 +14,18 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Series Response 4 Storage
|
||||
* Series Response 4 Storage Basic
|
||||
*
|
||||
* @author "Giancarlo Panichi" email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class SeriesResponse4Storage extends SeriesResponseBuilder {
|
||||
public class SeriesResponse4StorageBasic extends SeriesResponseBuilder {
|
||||
protected static Logger logger = LoggerFactory
|
||||
.getLogger(SeriesResponse4Storage.class);
|
||||
.getLogger(SeriesResponse4StorageBasic.class);
|
||||
private List<Info> infos;
|
||||
|
||||
public SeriesResponse4Storage(List<Info> infos) {
|
||||
public SeriesResponse4StorageBasic(List<Info> infos) {
|
||||
this.infos = infos;
|
||||
}
|
||||
|
||||
|
@ -45,14 +46,15 @@ public class SeriesResponse4Storage extends SeriesResponseBuilder {
|
|||
series.add(new SeriesStorageData(info.getCalendar().getTime(), dataVolume, operationCount));
|
||||
|
||||
}
|
||||
|
||||
SeriesStorage seriesStorage = new SeriesStorage(series);
|
||||
|
||||
|
||||
SeriesStorageBasic seriesStorageBasic=new SeriesStorageBasic(series);
|
||||
SeriesStorage seriesStorage = new SeriesStorage(seriesStorageBasic);
|
||||
|
||||
seriesResponseSpec.setSr(seriesStorage);
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error creating series for storage accounting: "+e.getLocalizedMessage());
|
||||
logger.error("Error creating series for storage accounting basic chart: "+e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new AccountingManagerServiceException("Error creating series for storage accounting: "+e.getLocalizedMessage());
|
||||
throw new AccountingManagerServiceException("Error creating series for storage accounting basic chart: "+e.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.server.amservice.response;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.accounting.analytics.Info;
|
||||
import org.gcube.accounting.datamodel.aggregation.AggregatedStorageUsageRecord;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.FilterValue;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesStorage;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.storage.SeriesStorageData;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.storage.SeriesStorageDataTop;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.storage.SeriesStorageTop;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.AccountingManagerServiceException;
|
||||
import org.json.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Series Response 4 Storage Top
|
||||
*
|
||||
* @author "Giancarlo Panichi" email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class SeriesResponse4StorageTop extends SeriesResponseBuilder {
|
||||
protected static Logger logger = LoggerFactory
|
||||
.getLogger(SeriesResponse4StorageTop.class);
|
||||
private List<Info> infos;
|
||||
|
||||
public SeriesResponse4StorageTop(List<Info> infos) {
|
||||
this.infos = infos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildSeriesResponse() throws AccountingManagerServiceException {
|
||||
try {
|
||||
if(infos.size()<=0){
|
||||
logger.error("Error creating series for storage accounting: No data available!");
|
||||
throw new AccountingManagerServiceException("No data available!");
|
||||
}
|
||||
|
||||
ArrayList<SeriesStorageData> series=new ArrayList<SeriesStorageData>();
|
||||
for (Info info : infos) {
|
||||
JSONObject jso = info.getValue();
|
||||
Long dataVolume = jso.getLong(AggregatedStorageUsageRecord.DATA_VOLUME);
|
||||
Long operationCount = jso
|
||||
.getLong(AggregatedStorageUsageRecord.OPERATION_COUNT);
|
||||
series.add(new SeriesStorageData(info.getCalendar().getTime(), dataVolume, operationCount));
|
||||
|
||||
}
|
||||
|
||||
ArrayList<SeriesStorageDataTop> seriesStorageDataTopList=new ArrayList<>();
|
||||
SeriesStorageDataTop seriesStorageDataTop=new SeriesStorageDataTop(new FilterValue("giancarlo.panichi"), series);
|
||||
seriesStorageDataTopList.add(seriesStorageDataTop);
|
||||
SeriesStorageTop seriesStorageTop=new SeriesStorageTop(seriesStorageDataTopList);
|
||||
SeriesStorage seriesStorage = new SeriesStorage(seriesStorageTop);
|
||||
|
||||
seriesResponseSpec.setSr(seriesStorage);
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error creating series for storage accounting top chart: "+e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new AccountingManagerServiceException("Error creating series for storage accounting basic chart: "+e.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.server.amservice.response;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.accounting.analytics.Info;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesResponse;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.AccountingManagerServiceException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Series Response 4 Task Basic
|
||||
*
|
||||
* @author "Giancarlo Panichi" email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class SeriesResponse4TaskBasic extends SeriesResponseBuilder {
|
||||
protected static Logger logger = LoggerFactory
|
||||
.getLogger(SeriesResponse4TaskBasic.class);
|
||||
private List<Info> infos;
|
||||
|
||||
public SeriesResponse4TaskBasic(List<Info> infos) {
|
||||
this.infos=infos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildSeriesResponse() throws AccountingManagerServiceException {
|
||||
if(infos.size()<=0){
|
||||
logger.error("Error creating series for task accounting: No data available!");
|
||||
throw new AccountingManagerServiceException("No data available!");
|
||||
}
|
||||
|
||||
//SeriesTaskBasic seriesTaskBasic=new SeriesTaskBasic(series);
|
||||
//SeriesTask seriesTask = new SeriesTask(seriesTaskBasic);
|
||||
|
||||
SeriesResponse seriesResponse = new SeriesResponse();
|
||||
|
||||
seriesResponseSpec.setSr(seriesResponse);
|
||||
|
||||
}
|
||||
}
|
|
@ -9,18 +9,18 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Series Response 4 Task
|
||||
* Series Response 4 Task Basic
|
||||
*
|
||||
* @author "Giancarlo Panichi" email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class SeriesResponse4Task extends SeriesResponseBuilder {
|
||||
public class SeriesResponse4TaskTop extends SeriesResponseBuilder {
|
||||
protected static Logger logger = LoggerFactory
|
||||
.getLogger(SeriesResponse4Task.class);
|
||||
.getLogger(SeriesResponse4TaskTop.class);
|
||||
private List<Info> infos;
|
||||
|
||||
public SeriesResponse4Task(List<Info> infos) {
|
||||
public SeriesResponse4TaskTop(List<Info> infos) {
|
||||
this.infos=infos;
|
||||
}
|
||||
|
||||
|
@ -31,6 +31,9 @@ public class SeriesResponse4Task extends SeriesResponseBuilder {
|
|||
throw new AccountingManagerServiceException("No data available!");
|
||||
}
|
||||
|
||||
//SeriesTaskBasic seriesTaskBasic=new SeriesTaskBasic(series);
|
||||
//SeriesTask seriesTask = new SeriesTask(seriesTaskBasic);
|
||||
|
||||
SeriesResponse seriesResponse = new SeriesResponse();
|
||||
|
||||
seriesResponseSpec.setSr(seriesResponse);
|
|
@ -5,24 +5,31 @@ import java.util.Date;
|
|||
|
||||
/**
|
||||
*
|
||||
* @author giancarlo
|
||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
* @author giancarlo email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class SeriesJobData implements Serializable {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 2082599366859724992L;
|
||||
private Date date;
|
||||
private Long operationCount;
|
||||
|
||||
public SeriesJobData(){
|
||||
private Long duration;
|
||||
private Long maxInvocationTime;
|
||||
private Long minInvocationTime;
|
||||
|
||||
public SeriesJobData() {
|
||||
super();
|
||||
}
|
||||
|
||||
public SeriesJobData(Date date, Long operationCount) {
|
||||
public SeriesJobData(Date date, Long operationCount, Long duration,
|
||||
Long maxInvocationTime, Long minInvocationTime) {
|
||||
super();
|
||||
this.date = date;
|
||||
this.operationCount = operationCount;
|
||||
this.duration = duration;
|
||||
this.maxInvocationTime = maxInvocationTime;
|
||||
this.minInvocationTime = minInvocationTime;
|
||||
}
|
||||
|
||||
public Date getDate() {
|
||||
|
@ -41,13 +48,36 @@ public class SeriesJobData implements Serializable {
|
|||
this.operationCount = operationCount;
|
||||
}
|
||||
|
||||
public Long getDuration() {
|
||||
return duration;
|
||||
}
|
||||
|
||||
public void setDuration(Long duration) {
|
||||
this.duration = duration;
|
||||
}
|
||||
|
||||
public Long getMaxInvocationTime() {
|
||||
return maxInvocationTime;
|
||||
}
|
||||
|
||||
public void setMaxInvocationTime(Long maxInvocationTime) {
|
||||
this.maxInvocationTime = maxInvocationTime;
|
||||
}
|
||||
|
||||
public Long getMinInvocationTime() {
|
||||
return minInvocationTime;
|
||||
}
|
||||
|
||||
public void setMinInvocationTime(Long minInvocationTime) {
|
||||
this.minInvocationTime = minInvocationTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesJobData [date=" + date + ", operationCount="
|
||||
+ operationCount + "]";
|
||||
+ operationCount + ", duration=" + duration
|
||||
+ ", maxInvocationTime=" + maxInvocationTime
|
||||
+ ", minInvocationTime=" + minInvocationTime + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.job;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
||||
|
||||
/**
|
||||
|
@ -11,31 +13,30 @@ import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
|||
public class SeriesJobTop extends SeriesJobDefinition {
|
||||
|
||||
private static final long serialVersionUID = -2350334263342186590L;
|
||||
private SeriesJobDataTop seriesJobDataTop;
|
||||
private ArrayList<SeriesJobDataTop> seriesJobDataTopList;
|
||||
|
||||
public SeriesJobTop() {
|
||||
super();
|
||||
this.chartType = ChartType.Top;
|
||||
}
|
||||
|
||||
public SeriesJobTop(SeriesJobDataTop seriesJobDataTop) {
|
||||
public SeriesJobTop(ArrayList<SeriesJobDataTop> seriesJobDataTopList) {
|
||||
super();
|
||||
this.seriesJobDataTop = seriesJobDataTop;
|
||||
this.chartType = ChartType.Top;
|
||||
this.seriesJobDataTopList = seriesJobDataTopList;
|
||||
}
|
||||
|
||||
public SeriesJobDataTop getSeriesJobDataTop() {
|
||||
return seriesJobDataTop;
|
||||
public ArrayList<SeriesJobDataTop> getSeriesJobDataTopList() {
|
||||
return seriesJobDataTopList;
|
||||
}
|
||||
|
||||
public void setSeriesJobDataTop(
|
||||
SeriesJobDataTop seriesJobDataTop) {
|
||||
this.seriesJobDataTop = seriesJobDataTop;
|
||||
public void setSeriesJobDataTopList(ArrayList<SeriesJobDataTop> seriesJobDataTopList) {
|
||||
this.seriesJobDataTopList = seriesJobDataTopList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesJobTop [seriesJobDataTop=" + seriesJobDataTop
|
||||
+ "]";
|
||||
return "SeriesJobTop [seriesJobDataTopList=" + seriesJobDataTopList + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.portlet;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
||||
|
||||
/**
|
||||
|
@ -11,31 +13,33 @@ import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
|||
public class SeriesPortletTop extends SeriesPortletDefinition {
|
||||
|
||||
private static final long serialVersionUID = -2350334263342186590L;
|
||||
private SeriesPortletDataTop seriesPortletDataTop;
|
||||
private ArrayList<SeriesPortletDataTop> seriesPortletDataTopList;
|
||||
|
||||
public SeriesPortletTop() {
|
||||
super();
|
||||
this.chartType = ChartType.Top;
|
||||
}
|
||||
|
||||
public SeriesPortletTop(SeriesPortletDataTop seriesPortletDataTop) {
|
||||
public SeriesPortletTop(
|
||||
ArrayList<SeriesPortletDataTop> seriesPortletDataTopList) {
|
||||
super();
|
||||
this.seriesPortletDataTop = seriesPortletDataTop;
|
||||
this.chartType = ChartType.Top;
|
||||
this.seriesPortletDataTopList = seriesPortletDataTopList;
|
||||
}
|
||||
|
||||
public SeriesPortletDataTop getSeriesPortletDataTop() {
|
||||
return seriesPortletDataTop;
|
||||
public ArrayList<SeriesPortletDataTop> getSeriesPortletDataTopList() {
|
||||
return seriesPortletDataTopList;
|
||||
}
|
||||
|
||||
public void setSeriesPortletDataTop(
|
||||
SeriesPortletDataTop seriesPortletDataTop) {
|
||||
this.seriesPortletDataTop = seriesPortletDataTop;
|
||||
public void setSeriesPortletDataTopList(
|
||||
ArrayList<SeriesPortletDataTop> seriesPortletDataTopList) {
|
||||
this.seriesPortletDataTopList = seriesPortletDataTopList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesPortletTop [seriesPortletDataTop=" + seriesPortletDataTop
|
||||
+ "]";
|
||||
return "SeriesPortletTop [seriesPortletDataTopList="
|
||||
+ seriesPortletDataTopList + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
||||
|
||||
/**
|
||||
|
@ -11,30 +13,31 @@ import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
|||
public class SeriesServiceTop extends SeriesServiceDefinition {
|
||||
|
||||
private static final long serialVersionUID = -2350334263342186590L;
|
||||
private SeriesServiceDataTop seriesServiceDataTop;
|
||||
private ArrayList<SeriesServiceDataTop> seriesServiceDataTopList;
|
||||
|
||||
public SeriesServiceTop() {
|
||||
super();
|
||||
this.chartType = ChartType.Top;
|
||||
}
|
||||
|
||||
public SeriesServiceTop(SeriesServiceDataTop seriesServiceDataTop) {
|
||||
public SeriesServiceTop(ArrayList<SeriesServiceDataTop> seriesServiceDataTopList) {
|
||||
super();
|
||||
this.seriesServiceDataTop = seriesServiceDataTop;
|
||||
this.chartType = ChartType.Top;
|
||||
this.seriesServiceDataTopList = seriesServiceDataTopList;
|
||||
}
|
||||
|
||||
public SeriesServiceDataTop getSeriesServiceDataTop() {
|
||||
return seriesServiceDataTop;
|
||||
public ArrayList<SeriesServiceDataTop> getSeriesServiceDataTopList() {
|
||||
return seriesServiceDataTopList;
|
||||
}
|
||||
|
||||
public void setSeriesServiceDataTop(
|
||||
SeriesServiceDataTop seriesServiceDataTop) {
|
||||
this.seriesServiceDataTop = seriesServiceDataTop;
|
||||
public void setSeriesServiceDataTopList(
|
||||
ArrayList<SeriesServiceDataTop> seriesServiceDataTopList) {
|
||||
this.seriesServiceDataTopList = seriesServiceDataTopList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesServiceTop [seriesServiceDataTop=" + seriesServiceDataTop
|
||||
return "SeriesServiceTop [seriesServiceDataTopList=" + seriesServiceDataTopList
|
||||
+ "]";
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.storage;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
||||
|
||||
/**
|
||||
|
@ -11,31 +13,35 @@ import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
|||
public class SeriesStorageTop extends SeriesStorageDefinition {
|
||||
|
||||
private static final long serialVersionUID = -5477545972037227361L;
|
||||
private SeriesStorageDataTop seriesStorageDataTop;
|
||||
private ArrayList<SeriesStorageDataTop> seriesStorageDataTopList;
|
||||
|
||||
public SeriesStorageTop() {
|
||||
super();
|
||||
this.chartType = ChartType.Top;
|
||||
}
|
||||
|
||||
public SeriesStorageTop(SeriesStorageDataTop seriesStorageDataTop) {
|
||||
public SeriesStorageTop(
|
||||
ArrayList<SeriesStorageDataTop> seriesStorageDataTopList) {
|
||||
super();
|
||||
this.seriesStorageDataTop = seriesStorageDataTop;
|
||||
this.chartType = ChartType.Top;
|
||||
this.seriesStorageDataTopList = seriesStorageDataTopList;
|
||||
}
|
||||
|
||||
public SeriesStorageDataTop getSeriesStorageDataTop() {
|
||||
return seriesStorageDataTop;
|
||||
public ArrayList<SeriesStorageDataTop> getSeriesStorageDataTopList() {
|
||||
return seriesStorageDataTopList;
|
||||
}
|
||||
|
||||
public void setSeriesStorageDataTop(
|
||||
SeriesStorageDataTop seriesStorageDataTop) {
|
||||
this.seriesStorageDataTop = seriesStorageDataTop;
|
||||
public void setSeriesStorageDataTopList(
|
||||
ArrayList<SeriesStorageDataTop> seriesStorageDataTopList) {
|
||||
this.seriesStorageDataTopList = seriesStorageDataTopList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesStorageTop [seriesStorageDataTop=" + seriesStorageDataTop
|
||||
+ "]";
|
||||
return "SeriesStorageTop [seriesStorageDataTopList="
|
||||
+ seriesStorageDataTopList + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.task;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
||||
|
||||
/**
|
||||
|
@ -11,29 +13,32 @@ import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
|||
public class SeriesTaskTop extends SeriesTaskDefinition {
|
||||
|
||||
private static final long serialVersionUID = 6805210072384752359L;
|
||||
private SeriesTaskDataTop seriesTaskDataTop;
|
||||
private ArrayList<SeriesTaskDataTop> seriesTaskDataTopList;
|
||||
|
||||
public SeriesTaskTop() {
|
||||
super();
|
||||
this.chartType = ChartType.Top;
|
||||
}
|
||||
|
||||
public SeriesTaskTop(SeriesTaskDataTop seriesTaskDataTop) {
|
||||
public SeriesTaskTop(ArrayList<SeriesTaskDataTop> seriesTaskDataTopList) {
|
||||
super();
|
||||
this.seriesTaskDataTop = seriesTaskDataTop;
|
||||
this.chartType = ChartType.Top;
|
||||
this.seriesTaskDataTopList = seriesTaskDataTopList;
|
||||
}
|
||||
|
||||
public SeriesTaskDataTop getSeriesTaskDataTop() {
|
||||
return seriesTaskDataTop;
|
||||
public ArrayList<SeriesTaskDataTop> getSeriesTaskDataTopList() {
|
||||
return seriesTaskDataTopList;
|
||||
}
|
||||
|
||||
public void setSeriesTaskDataTop(SeriesTaskDataTop seriesTaskDataTop) {
|
||||
this.seriesTaskDataTop = seriesTaskDataTop;
|
||||
public void setSeriesTaskDataTopList(
|
||||
ArrayList<SeriesTaskDataTop> seriesTaskDataTopList) {
|
||||
this.seriesTaskDataTopList = seriesTaskDataTopList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesTaskTop [seriesTaskDataTop=" + seriesTaskDataTop + "]";
|
||||
return "SeriesTaskTop [seriesTaskDataTopList=" + seriesTaskDataTopList
|
||||
+ "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.admin.accountingmanager.shared.exception;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author "Giancarlo Panichi"
|
||||
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class AccountingManagerStorageChartDrawException extends AccountingManagerChartDrawException {
|
||||
|
||||
|
||||
private static final long serialVersionUID = -8737011216478988776L;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public AccountingManagerStorageChartDrawException() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param message
|
||||
*/
|
||||
public AccountingManagerStorageChartDrawException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
|
||||
public AccountingManagerStorageChartDrawException(String message,Throwable t) {
|
||||
super(message,t);
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue