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@124264 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
ee3a27c342
commit
198d8c2147
|
@ -74,7 +74,7 @@ public class AccountingManagerController {
|
|||
|
||||
private void checkSession() {
|
||||
// if you do not need to something when the session expire
|
||||
CheckSession.getInstance().startPolling();
|
||||
//CheckSession.getInstance().startPolling();
|
||||
}
|
||||
|
||||
private void sessionExpiredShow() {
|
||||
|
|
|
@ -15,7 +15,7 @@ import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingFilter;
|
|||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingFilterBasic;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingFilterDefinition;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.AccountingFilterTop;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartTypeDisplayable;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
||||
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;
|
||||
|
@ -96,8 +96,8 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
private GridRowEditing<AccountingFilter> editing;
|
||||
private TextButton addButton;
|
||||
private int seq;
|
||||
private ListStore<ChartTypeDisplayable> storeComboChartType;
|
||||
private ComboBox<ChartTypeDisplayable> comboChartType;
|
||||
private ListStore<ChartType> storeComboChartType;
|
||||
private ComboBox<ChartType> comboChartType;
|
||||
private ListStore<FilterKey> storeComboTopFilterKey;
|
||||
private ComboBox<FilterKey> comboTopFilterKey;
|
||||
private FieldLabel comboTopFilterKeyLabel;
|
||||
|
@ -370,22 +370,22 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
|
||||
// ChartTypeSelection
|
||||
|
||||
storeComboChartType = new ListStore<ChartTypeDisplayable>(
|
||||
new ModelKeyProvider<ChartTypeDisplayable>() {
|
||||
storeComboChartType = new ListStore<ChartType>(
|
||||
new ModelKeyProvider<ChartType>() {
|
||||
|
||||
@Override
|
||||
public String getKey(ChartTypeDisplayable item) {
|
||||
public String getKey(ChartType item) {
|
||||
// TODO Auto-generated method stub
|
||||
return item.name();
|
||||
}
|
||||
|
||||
});
|
||||
storeComboChartType.addAll(ChartTypeDisplayable.asList());
|
||||
storeComboChartType.addAll(ChartType.asList());
|
||||
|
||||
LabelProvider<ChartTypeDisplayable> comboChartTypeLabelProvider = new LabelProvider<ChartTypeDisplayable>() {
|
||||
LabelProvider<ChartType> comboChartTypeLabelProvider = new LabelProvider<ChartType>() {
|
||||
|
||||
@Override
|
||||
public String getLabel(ChartTypeDisplayable item) {
|
||||
public String getLabel(ChartType item) {
|
||||
|
||||
return item.getLabel();
|
||||
}
|
||||
|
@ -398,7 +398,7 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
comboChartType.setEditable(false);
|
||||
comboChartType.setForceSelection(true);
|
||||
// comboFilterValue.setAllowBlank(false);
|
||||
comboChartType.setValue(ChartTypeDisplayable.Basic);
|
||||
comboChartType.setValue(ChartType.Basic);
|
||||
// comboFilterValue.setFinishEditOnEnter(false);
|
||||
// comboFilterValue.setAutoValidate(true);
|
||||
// comboFilterValue.addValidator(new EmptyValidator<String>());
|
||||
|
@ -507,11 +507,11 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
.getAvailableFilterKeys());
|
||||
storeComboTopFilterKey.commitChanges();
|
||||
|
||||
ChartTypeDisplayable chartTypeDisplayable = accountingStateData
|
||||
ChartType chartType = accountingStateData
|
||||
.getSeriesRequest().getAccountingFilterDefinition()
|
||||
.getChartTypeDisplayable();
|
||||
.getChartType();
|
||||
|
||||
switch (chartTypeDisplayable) {
|
||||
switch (chartType) {
|
||||
case Basic:
|
||||
changeActiveFiltersForBasic();
|
||||
break;
|
||||
|
@ -557,7 +557,7 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
store.commitChanges();
|
||||
seq = 0;
|
||||
}
|
||||
comboChartType.setValue(ChartTypeDisplayable.Basic);
|
||||
comboChartType.setValue(ChartType.Basic);
|
||||
comboTopFilterKey.reset();
|
||||
comboTopFilterKeyLabel.setVisible(false);
|
||||
topNumber.reset();
|
||||
|
@ -593,7 +593,7 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
store.clear();
|
||||
store.commitChanges();
|
||||
seq = 0;
|
||||
comboChartType.setValue(ChartTypeDisplayable.Top);
|
||||
comboChartType.setValue(ChartType.Top);
|
||||
comboTopFilterKeyLabel.setVisible(true);
|
||||
topNumberLabel.setVisible(true);
|
||||
forceLayout();
|
||||
|
@ -601,10 +601,10 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
|
||||
public AccountingFilterDefinition getActiveFilters() {
|
||||
try {
|
||||
ChartTypeDisplayable chartTypeDisplayable = comboChartType
|
||||
ChartType chartType = comboChartType
|
||||
.getCurrentValue();
|
||||
|
||||
switch (chartTypeDisplayable) {
|
||||
switch (chartType) {
|
||||
case Basic:
|
||||
return getActiveFiltersForBasic();
|
||||
case Top:
|
||||
|
@ -694,7 +694,7 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
|
||||
if (comboChartType.getCurrentValue() != null
|
||||
&& comboChartType.getCurrentValue().compareTo(
|
||||
ChartTypeDisplayable.Top) == 0) {
|
||||
ChartType.Top) == 0) {
|
||||
if (comboTopFilterKey.getCurrentValue() != null) {
|
||||
removableFilterKeys
|
||||
.add(comboTopFilterKey.getCurrentValue());
|
||||
|
@ -788,7 +788,7 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
|
||||
if (comboChartType.getCurrentValue() != null
|
||||
&& comboChartType.getCurrentValue().compareTo(
|
||||
ChartTypeDisplayable.Top) == 0) {
|
||||
ChartType.Top) == 0) {
|
||||
if (comboTopFilterKey.getCurrentValue() != null) {
|
||||
setFilterKeys.add(comboTopFilterKey.getCurrentValue());
|
||||
}
|
||||
|
@ -831,11 +831,11 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
}
|
||||
|
||||
private void addHandlersForComboChartType(
|
||||
final LabelProvider<ChartTypeDisplayable> labelProvider) {
|
||||
final LabelProvider<ChartType> labelProvider) {
|
||||
comboChartType
|
||||
.addSelectionHandler(new SelectionHandler<ChartTypeDisplayable>() {
|
||||
.addSelectionHandler(new SelectionHandler<ChartType>() {
|
||||
public void onSelection(
|
||||
SelectionEvent<ChartTypeDisplayable> event) {
|
||||
SelectionEvent<ChartType> event) {
|
||||
Log.debug("FilterKey selected: "
|
||||
+ event.getSelectedItem());
|
||||
updateComboChartType(event.getSelectedItem());
|
||||
|
@ -844,8 +844,11 @@ public class ActiveFiltersPanel extends SimpleContainer {
|
|||
});
|
||||
}
|
||||
|
||||
private void updateComboChartType(ChartTypeDisplayable chartTypeDisplayable) {
|
||||
switch (chartTypeDisplayable) {
|
||||
private void updateComboChartType(ChartType chartType) {
|
||||
if(chartType==null){
|
||||
return;
|
||||
}
|
||||
switch (chartType) {
|
||||
case Basic:
|
||||
comboTopFilterKey.reset();
|
||||
comboTopFilterKeyLabel.setVisible(false);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.client.maindata.charts;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChart;
|
||||
import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartBasicPanel;
|
||||
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;
|
||||
|
@ -37,7 +37,7 @@ public class AccountingChart4Service extends AccountingChartBuilder {
|
|||
return;
|
||||
}
|
||||
|
||||
ServiceChart container=new ServiceChart(accountingStateData);
|
||||
ServiceChartBasicPanel container=new ServiceChartBasicPanel(accountingStateData);
|
||||
|
||||
accountingChartPanel=new AccountingChartPanel(container);
|
||||
|
||||
|
|
|
@ -58,12 +58,12 @@ public class AccountingChart4Storage extends AccountingChartBuilder {
|
|||
.getAccountingFilterDefinition() == null
|
||||
|| accountingStateData.getSeriesRequest()
|
||||
.getAccountingFilterDefinition()
|
||||
.getChartTypeDisplayable() == null) {
|
||||
.getChartType() == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
switch (accountingStateData.getSeriesRequest()
|
||||
.getAccountingFilterDefinition().getChartTypeDisplayable()) {
|
||||
.getAccountingFilterDefinition().getChartType()) {
|
||||
|
||||
case Top:
|
||||
return new StorageChartTopPanel(accountingStateData);
|
||||
|
|
|
@ -7,9 +7,9 @@ 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.SeriesJob;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesJobData;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesService;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesServiceData;
|
||||
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;
|
||||
|
@ -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.ServiceChart::options);
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartBasicPanel::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.ServiceChart::options);
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartBasicPanel::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.ServiceChart::options);
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartBasicPanel::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.ServiceChart::options);
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartBasicPanel::options);
|
||||
console.log(chart);
|
||||
chart.exportChart({
|
||||
type : 'image/svg+xml'
|
||||
|
|
|
@ -0,0 +1,620 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service;
|
||||
|
||||
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.ServiceChartMeasure;
|
||||
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.SeriesService;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.service.SeriesServiceBasic;
|
||||
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;
|
||||
import com.github.highcharts4gwt.model.array.api.ArrayNumber;
|
||||
import com.github.highcharts4gwt.model.array.api.ArrayString;
|
||||
import com.github.highcharts4gwt.model.factory.api.HighchartsOptionFactory;
|
||||
import com.github.highcharts4gwt.model.factory.jso.JsoHighchartsOptionFactory;
|
||||
import com.github.highcharts4gwt.model.highcharts.option.api.ChartOptions;
|
||||
import com.github.highcharts4gwt.model.highcharts.option.api.SeriesArea;
|
||||
import com.github.highcharts4gwt.model.highcharts.option.api.SeriesColumn;
|
||||
import com.google.gwt.event.logical.shared.SelectionEvent;
|
||||
import com.google.gwt.event.logical.shared.SelectionHandler;
|
||||
import com.google.gwt.i18n.client.DateTimeFormat;
|
||||
import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat;
|
||||
import com.sencha.gxt.cell.core.client.ButtonCell.ButtonArrowAlign;
|
||||
import com.sencha.gxt.cell.core.client.ButtonCell.IconAlign;
|
||||
import com.sencha.gxt.core.client.util.Margins;
|
||||
import com.sencha.gxt.widget.core.client.button.TextButton;
|
||||
import com.sencha.gxt.widget.core.client.button.ToggleButton;
|
||||
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData;
|
||||
import com.sencha.gxt.widget.core.client.container.MarginData;
|
||||
import com.sencha.gxt.widget.core.client.container.SimpleContainer;
|
||||
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
|
||||
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
|
||||
import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
||||
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
||||
import com.sencha.gxt.widget.core.client.menu.Item;
|
||||
import com.sencha.gxt.widget.core.client.menu.Menu;
|
||||
import com.sencha.gxt.widget.core.client.menu.MenuItem;
|
||||
import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author giancarlo email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class ServiceChartBasicPanel extends SimpleContainer {
|
||||
private DateTimeFormat dtf=DateTimeFormat.getFormat(PredefinedFormat.YEAR_MONTH_DAY);
|
||||
|
||||
private static final String SINGLE_AXIS = "Single Axis";
|
||||
private AccountingStateData accountingStateData;
|
||||
private HighchartsLayoutPanel highchartsLayoutPanel;
|
||||
|
||||
// Replace Menu
|
||||
private MenuItem downloadPNGItem;
|
||||
private MenuItem downloadJPGItem;
|
||||
private MenuItem downloadPDFItem;
|
||||
private MenuItem downloadSVGItem;
|
||||
ChartOptions options;
|
||||
|
||||
public ServiceChartBasicPanel(AccountingStateData accountingStateData) {
|
||||
this.accountingStateData = accountingStateData;
|
||||
forceLayoutOnResize = true;
|
||||
create();
|
||||
|
||||
}
|
||||
|
||||
private void create() {
|
||||
ToolBar toolBar = new ToolBar();
|
||||
toolBar.setSpacing(2);
|
||||
// Download
|
||||
final TextButton downloadButton = new TextButton(DownloadConstants.DOWNLOAD,
|
||||
AccountingManagerResources.INSTANCE
|
||||
.accountingDownload24());
|
||||
// downloadButton.setScale(ButtonScale.MEDIUM);
|
||||
downloadButton.setIconAlign(IconAlign.RIGHT);
|
||||
downloadButton.setArrowAlign(ButtonArrowAlign.RIGHT);
|
||||
downloadButton.setMenu(createDownloadMenu());
|
||||
|
||||
toolBar.add(downloadButton, new BoxLayoutData(new Margins(0)));
|
||||
|
||||
// Single Axis
|
||||
final ToggleButton toggleButton = new ToggleButton(SINGLE_AXIS);
|
||||
toggleButton.setIcon(AccountingManagerResources.INSTANCE
|
||||
.accountingChartVariableAxis24());
|
||||
toggleButton.setIconAlign(IconAlign.RIGHT);
|
||||
toggleButton.setValue(false);
|
||||
|
||||
toggleButton.addSelectHandler(new SelectHandler() {
|
||||
|
||||
@Override
|
||||
public void onSelect(SelectEvent event) {
|
||||
if (toggleButton.getValue()) {
|
||||
createSingleAxisChart();
|
||||
highchartsLayoutPanel.renderChart(options);
|
||||
} else {
|
||||
createMultiAxisChart();
|
||||
highchartsLayoutPanel.renderChart(options);
|
||||
}
|
||||
forceLayout();
|
||||
}
|
||||
});
|
||||
|
||||
toolBar.add(toggleButton, new BoxLayoutData(new Margins(0)));
|
||||
|
||||
//
|
||||
createMultiAxisChart();
|
||||
|
||||
highchartsLayoutPanel = new HighchartsLayoutPanel();
|
||||
highchartsLayoutPanel.renderChart(options);
|
||||
|
||||
//
|
||||
VerticalLayoutContainer vert = new VerticalLayoutContainer();
|
||||
vert.add(toolBar, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
vert.add(highchartsLayoutPanel, new VerticalLayoutData(1, 1,
|
||||
new Margins(0)));
|
||||
|
||||
add(vert, new MarginData(0));
|
||||
|
||||
}
|
||||
|
||||
private Menu createDownloadMenu() {
|
||||
|
||||
Menu menuDownload = new Menu();
|
||||
downloadPNGItem = new MenuItem(DownloadConstants.DOWNLOAD_PNG,
|
||||
AccountingManagerResources.INSTANCE
|
||||
.accountingFilePNG24());
|
||||
downloadPNGItem.setHeight(30);
|
||||
downloadJPGItem = new MenuItem(DownloadConstants.DOWNLOAD_JPG,
|
||||
AccountingManagerResources.INSTANCE
|
||||
.accountingFileJPG24());
|
||||
downloadJPGItem.setHeight(30);
|
||||
downloadPDFItem = new MenuItem(DownloadConstants.DOWNLOAD_PDF,
|
||||
AccountingManagerResources.INSTANCE
|
||||
.accountingFilePDF24());
|
||||
downloadPDFItem.setHeight(30);
|
||||
downloadSVGItem = new MenuItem(DownloadConstants.DOWNLOAD_SVG,
|
||||
AccountingManagerResources.INSTANCE
|
||||
.accountingFileSVG24());
|
||||
downloadSVGItem.setHeight(30);
|
||||
|
||||
|
||||
downloadPNGItem.addSelectionHandler(new SelectionHandler<Item>() {
|
||||
|
||||
@Override
|
||||
public void onSelection(SelectionEvent<Item> event) {
|
||||
String id = highchartsLayoutPanel.getElement().getId();
|
||||
onDownloadPNG(id);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
downloadJPGItem.addSelectionHandler(new SelectionHandler<Item>() {
|
||||
|
||||
@Override
|
||||
public void onSelection(SelectionEvent<Item> event) {
|
||||
String id = highchartsLayoutPanel.getElement().getId();
|
||||
onDownloadJPG(id);
|
||||
}
|
||||
});
|
||||
|
||||
downloadPDFItem.addSelectionHandler(new SelectionHandler<Item>() {
|
||||
|
||||
@Override
|
||||
public void onSelection(SelectionEvent<Item> event) {
|
||||
String id = highchartsLayoutPanel.getElement().getId();
|
||||
onDownloadPDF(id);
|
||||
}
|
||||
});
|
||||
|
||||
downloadSVGItem.addSelectionHandler(new SelectionHandler<Item>() {
|
||||
|
||||
@Override
|
||||
public void onSelection(SelectionEvent<Item> event) {
|
||||
String id = highchartsLayoutPanel.getElement().getId();
|
||||
onDownloadSVG(id);
|
||||
}
|
||||
});
|
||||
|
||||
menuDownload.add(downloadPNGItem);
|
||||
menuDownload.add(downloadJPGItem);
|
||||
menuDownload.add(downloadPDFItem);
|
||||
menuDownload.add(downloadSVGItem);
|
||||
return menuDownload;
|
||||
|
||||
}
|
||||
|
||||
// chart.options.exporting.buttons.contextButton.menuItems[0].onclick();
|
||||
|
||||
public static native void onDownloadPNG(String id) /*-{
|
||||
console.log(id);
|
||||
var chart = $wnd
|
||||
.jQuery('#' + id)
|
||||
.highcharts(
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartBasicPanel::options);
|
||||
console.log(chart);
|
||||
chart.exportChart();
|
||||
|
||||
}-*/;
|
||||
|
||||
public static native void onDownloadJPG(String id) /*-{
|
||||
console.log(id);
|
||||
var chart = $wnd
|
||||
.jQuery('#' + id)
|
||||
.highcharts(
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartBasicPanel::options);
|
||||
console.log(chart);
|
||||
chart.exportChart({
|
||||
type : 'image/jpeg'
|
||||
});
|
||||
|
||||
}-*/;
|
||||
|
||||
public static native void onDownloadPDF(String id) /*-{
|
||||
console.log(id);
|
||||
var chart = $wnd
|
||||
.jQuery('#' + id)
|
||||
.highcharts(
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartBasicPanel::options);
|
||||
console.log(chart);
|
||||
chart.exportChart({
|
||||
type : 'application/pdf'
|
||||
});
|
||||
|
||||
}-*/;
|
||||
|
||||
public static native void onDownloadSVG(String id) /*-{
|
||||
console.log(id);
|
||||
var chart = $wnd
|
||||
.jQuery('#' + id)
|
||||
.highcharts(
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartBasicPanel::options);
|
||||
console.log(chart);
|
||||
chart.exportChart({
|
||||
type : 'image/svg+xml'
|
||||
});
|
||||
|
||||
}-*/;
|
||||
|
||||
private void createMultiAxisChart() {
|
||||
SeriesService seriesService = (SeriesService) accountingStateData
|
||||
.getSeriesResponse();
|
||||
|
||||
if(!(seriesService.getSerieServiceDefinition() instanceof SeriesServiceBasic)){
|
||||
//throw new Exception("Invalid SeriesServiceBasic!");
|
||||
return;
|
||||
}
|
||||
SeriesServiceBasic seriesServiceBasic=(SeriesServiceBasic)seriesService.getSerieServiceDefinition();
|
||||
|
||||
double minRange = ChartTimeMeasure
|
||||
.calculateMinRange(accountingStateData.getSeriesRequest()
|
||||
.getAccountingPeriod());
|
||||
|
||||
double interval = ChartTimeMeasure
|
||||
.calculateInterval(accountingStateData.getSeriesRequest()
|
||||
.getAccountingPeriod());
|
||||
|
||||
Date dateStart=dtf.parse(accountingStateData.getSeriesRequest()
|
||||
.getAccountingPeriod().getStartDate());
|
||||
|
||||
dateStart.setTime(dateStart.getTime()
|
||||
+ ChartTimeMeasure.timeZoneOffset() * ChartTimeMeasure.MINUTE);
|
||||
|
||||
Log.debug("BuildChart DateStart: "
|
||||
+ DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_FULL)
|
||||
.format(dateStart));
|
||||
|
||||
HighchartsOptionFactory highchartsFactory = new JsoHighchartsOptionFactory();
|
||||
options = highchartsFactory.createChartOptions();
|
||||
|
||||
options.navigation().buttonOptions().enabled(false);
|
||||
options.exporting().filename("AccountingService");
|
||||
options.chart().zoomType("xy");
|
||||
|
||||
options.title().text("Accounting Service");
|
||||
|
||||
/*
|
||||
* options.subtitle().text("Click and drag in the plot area to zoom in");
|
||||
*/
|
||||
|
||||
ArrayString colors = options.colors();
|
||||
// colors.setValue(0, "#cc0038");
|
||||
// colors.setValue(1, "#32cd32");
|
||||
|
||||
// xAxis
|
||||
options.xAxis().type("datetime").minRange(minRange);
|
||||
|
||||
// yAxis
|
||||
String multiAxis = "[{" + " \"id\": \""+ServiceChartMeasure.OperationCount.name()+"\","
|
||||
+ " \"labels\": { " + " \"format\": \"{value}\","
|
||||
+ " \"style\": { " + " \"color\": \""
|
||||
+ colors.get(1)
|
||||
+ "\""
|
||||
+ " }"
|
||||
+ " },"
|
||||
+ " \"title\": { "
|
||||
+ " \"text\": \""+ServiceChartMeasure.OperationCount.getLabel()+"\","
|
||||
+ " \"style\": {"
|
||||
+ " \"color\": \""
|
||||
+ colors.get(1)
|
||||
+ "\""
|
||||
+ " }"
|
||||
+ " }"
|
||||
+ "} , {"
|
||||
+ " \"id\": \""+ServiceChartMeasure.Duration.name()+"\", "
|
||||
+ " \"title\": {"
|
||||
+ " \"text\": \""+ServiceChartMeasure.Duration.getLabel()+"\","
|
||||
+ " \"style\": {"
|
||||
+ " \"color\": \""
|
||||
+ colors.get(0)
|
||||
+ "\""
|
||||
+ " }"
|
||||
+ " },"
|
||||
+ " \"labels\": {"
|
||||
+ " \"format\": \"{value} ms\","
|
||||
+ " \"style\": {"
|
||||
+ " \"color\": \""
|
||||
+ colors.get(0)
|
||||
+ "\""
|
||||
+ " }"
|
||||
+ " },"
|
||||
+ " \"opposite\": \"true\""
|
||||
+ ", \"showFirstLabel\": \"false\""
|
||||
+ "} , {"
|
||||
+ " \"id\": \""+ServiceChartMeasure.MaxInvocationTime.name()+"\", "
|
||||
+ " \"title\": {"
|
||||
+ " \"text\": \""+ServiceChartMeasure.MaxInvocationTime.getLabel()+"\","
|
||||
+ " \"style\": {"
|
||||
+ " \"color\": \""
|
||||
+ colors.get(2)
|
||||
+ "\""
|
||||
+ " }"
|
||||
+ " },"
|
||||
+ " \"labels\": {"
|
||||
+ " \"format\": \"{value} ms\","
|
||||
+ " \"style\": {"
|
||||
+ " \"color\": \""
|
||||
+ colors.get(2)
|
||||
+ "\""
|
||||
+ " }"
|
||||
+ " },"
|
||||
+ " \"opposite\": \"true\""
|
||||
+ ", \"showFirstLabel\": \"false\""
|
||||
+ "} , {"
|
||||
+ " \"id\": \""+ServiceChartMeasure.MinInvocationTime.name()+"\", "
|
||||
+ " \"title\": {"
|
||||
+ " \"text\": \""+ServiceChartMeasure.MinInvocationTime.getLabel()+"\","
|
||||
+ " \"style\": {"
|
||||
+ " \"color\": \""
|
||||
+ colors.get(3)
|
||||
+ "\""
|
||||
+ " }"
|
||||
+ " },"
|
||||
+ " \"labels\": {"
|
||||
+ " \"format\": \"{value} ms\","
|
||||
+ " \"style\": {"
|
||||
+ " \"color\": \""
|
||||
+ colors.get(3)
|
||||
+ "\""
|
||||
+ " }"
|
||||
+ " },"
|
||||
+ " \"opposite\": \"true\""
|
||||
+ ", \"showFirstLabel\": \"false\"" + "}]"
|
||||
|
||||
;
|
||||
|
||||
options.setFieldAsJsonObject("yAxis", multiAxis);
|
||||
|
||||
// does not seem to be working
|
||||
String fillcolor = "{" + "\"linearGradient\": {" + "\"x1\": 0,"
|
||||
+ "\"y1\": 0," + "\"x2\": 0," + "\"y2\": 1" + "},"
|
||||
+ "\"stops\": [" + "[" + "0, \"#058DC7\"" + "]," + "["
|
||||
+ "1, \"#FFFFFF\"" + "]" + "]" + "}";
|
||||
|
||||
options.plotOptions().area()
|
||||
.setFieldAsJsonObject("fillColor", fillcolor).marker()
|
||||
.radius(2).lineWidth(1).states().hover().lineWidth(1);
|
||||
|
||||
SeriesColumn seriesOperationCount = highchartsFactory
|
||||
.createSeriesColumn();
|
||||
seriesOperationCount.name(ServiceChartMeasure.OperationCount.getLabel());
|
||||
seriesOperationCount.color(colors.get(1));
|
||||
seriesOperationCount.type("column");
|
||||
|
||||
ArrayNumber dataOperationCount = seriesOperationCount
|
||||
.dataAsArrayNumber();
|
||||
|
||||
seriesOperationCount.pointInterval(interval).pointStart(
|
||||
dateStart.getTime());
|
||||
|
||||
SeriesArea seriesDuration = highchartsFactory.createSeriesArea();
|
||||
seriesDuration.name(ServiceChartMeasure.Duration.getLabel());
|
||||
seriesDuration.color(colors.get(0));
|
||||
seriesDuration.yAxisAsString(ServiceChartMeasure.Duration.name());
|
||||
|
||||
ArrayNumber dataDuration = seriesDuration.dataAsArrayNumber();
|
||||
|
||||
seriesDuration.pointInterval(interval).pointStart(dateStart.getTime());
|
||||
|
||||
SeriesArea seriesMaxInvocationTime = highchartsFactory
|
||||
.createSeriesArea();
|
||||
seriesMaxInvocationTime.name(ServiceChartMeasure.MaxInvocationTime.getLabel());
|
||||
seriesMaxInvocationTime.color(colors.get(2));
|
||||
seriesMaxInvocationTime.yAxisAsString(ServiceChartMeasure.MaxInvocationTime.name());
|
||||
|
||||
ArrayNumber dataMaxInvocationTime = seriesMaxInvocationTime
|
||||
.dataAsArrayNumber();
|
||||
|
||||
seriesMaxInvocationTime.pointInterval(interval).pointStart(
|
||||
dateStart.getTime());
|
||||
|
||||
SeriesArea seriesMinInvocationTime = highchartsFactory
|
||||
.createSeriesArea();
|
||||
seriesMinInvocationTime.name(ServiceChartMeasure.MinInvocationTime.getLabel());
|
||||
seriesMinInvocationTime.color(colors.get(3));
|
||||
seriesMinInvocationTime.yAxisAsString(ServiceChartMeasure.MinInvocationTime.name());
|
||||
|
||||
ArrayNumber dataMinInvocationTime = seriesMinInvocationTime
|
||||
.dataAsArrayNumber();
|
||||
|
||||
seriesMinInvocationTime.pointInterval(interval).pointStart(
|
||||
dateStart.getTime());
|
||||
|
||||
for (SeriesServiceData seriesServiceData : seriesServiceBasic.getSeries()) {
|
||||
dataOperationCount.push(seriesServiceData.getOperationCount());
|
||||
dataDuration.push(seriesServiceData.getDuration());
|
||||
dataMaxInvocationTime
|
||||
.push(seriesServiceData.getMaxInvocationTime());
|
||||
dataMinInvocationTime
|
||||
.push(seriesServiceData.getMinInvocationTime());
|
||||
}
|
||||
|
||||
options.series().addToEnd(seriesOperationCount);
|
||||
options.series().addToEnd(seriesDuration);
|
||||
options.series().addToEnd(seriesMaxInvocationTime);
|
||||
options.series().addToEnd(seriesMinInvocationTime);
|
||||
|
||||
options.chart().showAxes(true);
|
||||
|
||||
options.legend().enabled(true);
|
||||
// options.legend().layout("vertical");
|
||||
// options.legend().align("left");
|
||||
// options.legend().x(120);
|
||||
// options.legend().verticalAlign("top");
|
||||
// options.legend().y(100);
|
||||
// options.legend().floating(true);
|
||||
// options.legend()
|
||||
// .backgroundColor(
|
||||
// "(Highcharts.theme && Highcharts.theme.legendBackgroundColor) || 'white'");
|
||||
return;
|
||||
}
|
||||
|
||||
private void createSingleAxisChart() {
|
||||
SeriesService seriesService = (SeriesService) accountingStateData
|
||||
.getSeriesResponse();
|
||||
|
||||
if(!(seriesService.getSerieServiceDefinition() instanceof SeriesServiceBasic)){
|
||||
//throw new Exception("Invalid SeriesServiceBasic!");
|
||||
return;
|
||||
}
|
||||
SeriesServiceBasic seriesServiceBasic=(SeriesServiceBasic)seriesService.getSerieServiceDefinition();
|
||||
|
||||
double minRange = ChartTimeMeasure
|
||||
.calculateMinRange(accountingStateData.getSeriesRequest()
|
||||
.getAccountingPeriod());
|
||||
|
||||
double interval = ChartTimeMeasure
|
||||
.calculateInterval(accountingStateData.getSeriesRequest()
|
||||
.getAccountingPeriod());
|
||||
|
||||
Date dateStart=dtf.parse(accountingStateData.getSeriesRequest()
|
||||
.getAccountingPeriod().getStartDate());
|
||||
|
||||
dateStart.setTime(dateStart.getTime()
|
||||
+ ChartTimeMeasure.timeZoneOffset() * ChartTimeMeasure.MINUTE);
|
||||
|
||||
Log.debug("BuildChart DateStart: "
|
||||
+ DateTimeFormat.getFormat(PredefinedFormat.DATE_TIME_FULL)
|
||||
.format(dateStart));
|
||||
|
||||
HighchartsOptionFactory highchartsFactory = new JsoHighchartsOptionFactory();
|
||||
options = highchartsFactory.createChartOptions();
|
||||
|
||||
options.navigation().buttonOptions().enabled(false);
|
||||
options.exporting().filename("AccountingService");
|
||||
options.chart().zoomType("xy");
|
||||
|
||||
options.title().text("Accounting Service");
|
||||
|
||||
/*
|
||||
* options.subtitle().text("Click and drag in the plot area to zoom in");
|
||||
*/
|
||||
|
||||
ArrayString colors = options.colors();
|
||||
// colors.setValue(0, "#cc0038");
|
||||
// colors.setValue(1, "#32cd32");
|
||||
|
||||
// xAxis
|
||||
options.xAxis().type("datetime").minRange(minRange);
|
||||
|
||||
// yAxis
|
||||
// options.yAxis().title().text("Exchange rate");
|
||||
// Highcharts.getOptions().colors[0]
|
||||
|
||||
String multiAxis = "[{" + " \"id\": \""+ServiceChartMeasure.OperationCount.name()+"\","
|
||||
+ " \"labels\": { " + " \"format\": \"{value}\","
|
||||
+ " \"style\": { " + " \"color\": \""
|
||||
+ colors.get(1)
|
||||
+ "\""
|
||||
+ " }"
|
||||
+ " },"
|
||||
+ " \"title\": { "
|
||||
+ " \"text\": \""+ServiceChartMeasure.OperationCount.getLabel()+"\","
|
||||
+ " \"style\": {"
|
||||
+ " \"color\": \""
|
||||
+ colors.get(1)
|
||||
+ "\""
|
||||
+ " }"
|
||||
+ " }"
|
||||
+ "} , {"
|
||||
+ " \"id\": \"ServiceData\", "
|
||||
+ " \"linkedTo\": \"0\","
|
||||
+ " \"gridLineWidth\": \"0\","
|
||||
+ " \"title\": {"
|
||||
+ " \"text\": \"\","
|
||||
+ " \"style\": {"
|
||||
+ " \"color\": \""
|
||||
+ colors.get(1)
|
||||
+ "\""
|
||||
+ " }"
|
||||
+ " },"
|
||||
+ " \"labels\": {"
|
||||
+ " \"format\": \"{value} ms\","
|
||||
+ " \"style\": {"
|
||||
+ " \"color\": \""
|
||||
+ colors.get(1)
|
||||
+ "\"" + " }" + " }," + " \"opposite\": \"true\"" + // +
|
||||
// ", \"showFirstLabel\": \"false\""
|
||||
// +
|
||||
"}]";
|
||||
|
||||
options.setFieldAsJsonObject("yAxis", multiAxis);
|
||||
|
||||
// does not seem to be working
|
||||
String fillcolor = "{" + "\"linearGradient\": {" + "\"x1\": 0,"
|
||||
+ "\"y1\": 0," + "\"x2\": 0," + "\"y2\": 1" + "},"
|
||||
+ "\"stops\": [" + "[" + "0, \"#058DC7\"" + "]," + "["
|
||||
+ "1, \"#FFFFFF\"" + "]" + "]" + "}";
|
||||
|
||||
options.plotOptions().area()
|
||||
.setFieldAsJsonObject("fillColor", fillcolor).marker()
|
||||
.radius(2).lineWidth(1).states().hover().lineWidth(1);
|
||||
|
||||
SeriesColumn seriesOperationCount = highchartsFactory
|
||||
.createSeriesColumn();
|
||||
seriesOperationCount.name(ServiceChartMeasure.OperationCount.getLabel());
|
||||
seriesOperationCount.color(colors.get(1));
|
||||
seriesOperationCount.type("column");
|
||||
|
||||
ArrayNumber dataOperationCount = seriesOperationCount
|
||||
.dataAsArrayNumber();
|
||||
|
||||
seriesOperationCount.pointInterval(interval).pointStart(
|
||||
dateStart.getTime());
|
||||
|
||||
SeriesArea seriesDuration = highchartsFactory.createSeriesArea();
|
||||
seriesDuration.name(ServiceChartMeasure.Duration.getLabel());
|
||||
seriesDuration.color(colors.get(0));
|
||||
|
||||
ArrayNumber dataDuration = seriesDuration.dataAsArrayNumber();
|
||||
|
||||
seriesDuration.pointInterval(interval).pointStart(dateStart.getTime());
|
||||
|
||||
SeriesArea seriesMaxInvocationTime = highchartsFactory
|
||||
.createSeriesArea();
|
||||
seriesMaxInvocationTime.name(ServiceChartMeasure.MaxInvocationTime.getLabel());
|
||||
seriesMaxInvocationTime.color(colors.get(2));
|
||||
|
||||
ArrayNumber dataMaxInvocationTime = seriesMaxInvocationTime
|
||||
.dataAsArrayNumber();
|
||||
|
||||
seriesMaxInvocationTime.pointInterval(interval).pointStart(
|
||||
dateStart.getTime());
|
||||
|
||||
SeriesArea seriesMinInvocationTime = highchartsFactory
|
||||
.createSeriesArea();
|
||||
seriesMinInvocationTime.name(ServiceChartMeasure.MinInvocationTime.getLabel());
|
||||
seriesMinInvocationTime.color(colors.get(3));
|
||||
// seriesMinInvocationTime.yAxisAsString("MinInvocationTime");
|
||||
|
||||
ArrayNumber dataMinInvocationTime = seriesMinInvocationTime
|
||||
.dataAsArrayNumber();
|
||||
|
||||
seriesMinInvocationTime.pointInterval(interval).pointStart(
|
||||
dateStart.getTime());
|
||||
|
||||
for (SeriesServiceData seriesServiceData : seriesServiceBasic.getSeries()) {
|
||||
dataOperationCount.push(seriesServiceData.getOperationCount());
|
||||
dataDuration.push(seriesServiceData.getDuration());
|
||||
dataMaxInvocationTime
|
||||
.push(seriesServiceData.getMaxInvocationTime());
|
||||
dataMinInvocationTime
|
||||
.push(seriesServiceData.getMinInvocationTime());
|
||||
}
|
||||
|
||||
options.series().addToEnd(seriesOperationCount);
|
||||
options.series().addToEnd(seriesDuration);
|
||||
options.series().addToEnd(seriesMaxInvocationTime);
|
||||
options.series().addToEnd(seriesMinInvocationTime);
|
||||
|
||||
options.chart().showAxes(true);
|
||||
|
||||
options.legend().enabled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
|
@ -4,10 +4,11 @@ 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.ServiceChartMeasure;
|
||||
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.SeriesService;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesServiceData;
|
||||
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;
|
||||
|
@ -45,10 +46,12 @@ import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
|
|||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class ServiceChart extends SimpleContainer {
|
||||
private DateTimeFormat dtf=DateTimeFormat.getFormat(PredefinedFormat.YEAR_MONTH_DAY);
|
||||
|
||||
public class ServiceChartTopPanel extends SimpleContainer {
|
||||
private static final String TIME_UNIT = "Time Unit";
|
||||
private static final String MEASURE_TYPE = "Measure";
|
||||
private static final String SINGLE_AXIS = "Single Axis";
|
||||
|
||||
private DateTimeFormat dtf=DateTimeFormat.getFormat(PredefinedFormat.YEAR_MONTH_DAY);
|
||||
private AccountingStateData accountingStateData;
|
||||
private HighchartsLayoutPanel highchartsLayoutPanel;
|
||||
|
||||
|
@ -57,9 +60,9 @@ public class ServiceChart extends SimpleContainer {
|
|||
private MenuItem downloadJPGItem;
|
||||
private MenuItem downloadPDFItem;
|
||||
private MenuItem downloadSVGItem;
|
||||
ChartOptions options;
|
||||
private ChartOptions options;
|
||||
|
||||
public ServiceChart(AccountingStateData accountingStateData) {
|
||||
public ServiceChartTopPanel(AccountingStateData accountingStateData) {
|
||||
this.accountingStateData = accountingStateData;
|
||||
forceLayoutOnResize = true;
|
||||
create();
|
||||
|
@ -193,7 +196,7 @@ public class ServiceChart extends SimpleContainer {
|
|||
var chart = $wnd
|
||||
.jQuery('#' + id)
|
||||
.highcharts(
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChart::options);
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartBasicPanel::options);
|
||||
console.log(chart);
|
||||
chart.exportChart();
|
||||
|
||||
|
@ -204,7 +207,7 @@ public class ServiceChart extends SimpleContainer {
|
|||
var chart = $wnd
|
||||
.jQuery('#' + id)
|
||||
.highcharts(
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChart::options);
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartBasicPanel::options);
|
||||
console.log(chart);
|
||||
chart.exportChart({
|
||||
type : 'image/jpeg'
|
||||
|
@ -217,7 +220,7 @@ public class ServiceChart extends SimpleContainer {
|
|||
var chart = $wnd
|
||||
.jQuery('#' + id)
|
||||
.highcharts(
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChart::options);
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartBasicPanel::options);
|
||||
console.log(chart);
|
||||
chart.exportChart({
|
||||
type : 'application/pdf'
|
||||
|
@ -230,7 +233,7 @@ public class ServiceChart extends SimpleContainer {
|
|||
var chart = $wnd
|
||||
.jQuery('#' + id)
|
||||
.highcharts(
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChart::options);
|
||||
this.@org.gcube.portlets.admin.accountingmanager.client.maindata.charts.service.ServiceChartBasicPanel::options);
|
||||
console.log(chart);
|
||||
chart.exportChart({
|
||||
type : 'image/svg+xml'
|
||||
|
@ -281,7 +284,7 @@ public class ServiceChart extends SimpleContainer {
|
|||
options.xAxis().type("datetime").minRange(minRange);
|
||||
|
||||
// yAxis
|
||||
String multiAxis = "[{" + " \"id\": \"OperationCount\","
|
||||
String multiAxis = "[{" + " \"id\": \""+ServiceChartMeasure.OperationCount.name()+"\","
|
||||
+ " \"labels\": { " + " \"format\": \"{value}\","
|
||||
+ " \"style\": { " + " \"color\": \""
|
||||
+ colors.get(1)
|
||||
|
@ -289,7 +292,7 @@ public class ServiceChart extends SimpleContainer {
|
|||
+ " }"
|
||||
+ " },"
|
||||
+ " \"title\": { "
|
||||
+ " \"text\": \"Operation Count\","
|
||||
+ " \"text\": \""+ServiceChartMeasure.OperationCount.getLabel()+"\","
|
||||
+ " \"style\": {"
|
||||
+ " \"color\": \""
|
||||
+ colors.get(1)
|
||||
|
@ -297,9 +300,9 @@ public class ServiceChart extends SimpleContainer {
|
|||
+ " }"
|
||||
+ " }"
|
||||
+ "} , {"
|
||||
+ " \"id\": \"Duration\", "
|
||||
+ " \"id\": \""+ServiceChartMeasure.Duration.name()+"\", "
|
||||
+ " \"title\": {"
|
||||
+ " \"text\": \"Duration\","
|
||||
+ " \"text\": \""+ServiceChartMeasure.Duration.getLabel()+"\","
|
||||
+ " \"style\": {"
|
||||
+ " \"color\": \""
|
||||
+ colors.get(0)
|
||||
|
@ -317,9 +320,9 @@ public class ServiceChart extends SimpleContainer {
|
|||
+ " \"opposite\": \"true\""
|
||||
+ ", \"showFirstLabel\": \"false\""
|
||||
+ "} , {"
|
||||
+ " \"id\": \"MaxInvocationTime\", "
|
||||
+ " \"id\": \""+ServiceChartMeasure.MaxInvocationTime.name()+"\", "
|
||||
+ " \"title\": {"
|
||||
+ " \"text\": \"Max Invocation Time\","
|
||||
+ " \"text\": \""+ServiceChartMeasure.MaxInvocationTime.getLabel()+"\","
|
||||
+ " \"style\": {"
|
||||
+ " \"color\": \""
|
||||
+ colors.get(2)
|
||||
|
@ -337,9 +340,9 @@ public class ServiceChart extends SimpleContainer {
|
|||
+ " \"opposite\": \"true\""
|
||||
+ ", \"showFirstLabel\": \"false\""
|
||||
+ "} , {"
|
||||
+ " \"id\": \"MinInvocationTime\", "
|
||||
+ " \"id\": \""+ServiceChartMeasure.MinInvocationTime.name()+"\", "
|
||||
+ " \"title\": {"
|
||||
+ " \"text\": \"Min Invocation Time\","
|
||||
+ " \"text\": \""+ServiceChartMeasure.MinInvocationTime.getLabel()+"\","
|
||||
+ " \"style\": {"
|
||||
+ " \"color\": \""
|
||||
+ colors.get(3)
|
||||
|
@ -373,7 +376,7 @@ public class ServiceChart extends SimpleContainer {
|
|||
|
||||
SeriesColumn seriesOperationCount = highchartsFactory
|
||||
.createSeriesColumn();
|
||||
seriesOperationCount.name("Operation Count");
|
||||
seriesOperationCount.name(ServiceChartMeasure.OperationCount.getLabel());
|
||||
seriesOperationCount.color(colors.get(1));
|
||||
seriesOperationCount.type("column");
|
||||
|
||||
|
@ -384,9 +387,9 @@ public class ServiceChart extends SimpleContainer {
|
|||
dateStart.getTime());
|
||||
|
||||
SeriesArea seriesDuration = highchartsFactory.createSeriesArea();
|
||||
seriesDuration.name("Duration");
|
||||
seriesDuration.name(ServiceChartMeasure.Duration.getLabel());
|
||||
seriesDuration.color(colors.get(0));
|
||||
seriesDuration.yAxisAsString("Duration");
|
||||
seriesDuration.yAxisAsString(ServiceChartMeasure.Duration.name());
|
||||
|
||||
ArrayNumber dataDuration = seriesDuration.dataAsArrayNumber();
|
||||
|
||||
|
@ -394,9 +397,9 @@ public class ServiceChart extends SimpleContainer {
|
|||
|
||||
SeriesArea seriesMaxInvocationTime = highchartsFactory
|
||||
.createSeriesArea();
|
||||
seriesMaxInvocationTime.name("Max Invocation Time");
|
||||
seriesMaxInvocationTime.name(ServiceChartMeasure.MaxInvocationTime.getLabel());
|
||||
seriesMaxInvocationTime.color(colors.get(2));
|
||||
seriesMaxInvocationTime.yAxisAsString("MaxInvocationTime");
|
||||
seriesMaxInvocationTime.yAxisAsString(ServiceChartMeasure.MaxInvocationTime.name());
|
||||
|
||||
ArrayNumber dataMaxInvocationTime = seriesMaxInvocationTime
|
||||
.dataAsArrayNumber();
|
||||
|
@ -406,9 +409,9 @@ public class ServiceChart extends SimpleContainer {
|
|||
|
||||
SeriesArea seriesMinInvocationTime = highchartsFactory
|
||||
.createSeriesArea();
|
||||
seriesMinInvocationTime.name("Min Invocation Time");
|
||||
seriesMinInvocationTime.name(ServiceChartMeasure.MinInvocationTime.getLabel());
|
||||
seriesMinInvocationTime.color(colors.get(3));
|
||||
seriesMinInvocationTime.yAxisAsString("MinInvocationTime");
|
||||
seriesMinInvocationTime.yAxisAsString(ServiceChartMeasure.MinInvocationTime.name());
|
||||
|
||||
ArrayNumber dataMinInvocationTime = seriesMinInvocationTime
|
||||
.dataAsArrayNumber();
|
||||
|
@ -491,7 +494,7 @@ public class ServiceChart extends SimpleContainer {
|
|||
// options.yAxis().title().text("Exchange rate");
|
||||
// Highcharts.getOptions().colors[0]
|
||||
|
||||
String multiAxis = "[{" + " \"id\": \"OperationCount\","
|
||||
String multiAxis = "[{" + " \"id\": \""+ServiceChartMeasure.OperationCount.name()+"\","
|
||||
+ " \"labels\": { " + " \"format\": \"{value}\","
|
||||
+ " \"style\": { " + " \"color\": \""
|
||||
+ colors.get(1)
|
||||
|
@ -499,7 +502,7 @@ public class ServiceChart extends SimpleContainer {
|
|||
+ " }"
|
||||
+ " },"
|
||||
+ " \"title\": { "
|
||||
+ " \"text\": \"Operation Count\","
|
||||
+ " \"text\": \""+ServiceChartMeasure.OperationCount.getLabel()+"\","
|
||||
+ " \"style\": {"
|
||||
+ " \"color\": \""
|
||||
+ colors.get(1)
|
||||
|
@ -542,7 +545,7 @@ public class ServiceChart extends SimpleContainer {
|
|||
|
||||
SeriesColumn seriesOperationCount = highchartsFactory
|
||||
.createSeriesColumn();
|
||||
seriesOperationCount.name("Operation Count");
|
||||
seriesOperationCount.name(ServiceChartMeasure.OperationCount.getLabel());
|
||||
seriesOperationCount.color(colors.get(1));
|
||||
seriesOperationCount.type("column");
|
||||
|
||||
|
@ -553,7 +556,7 @@ public class ServiceChart extends SimpleContainer {
|
|||
dateStart.getTime());
|
||||
|
||||
SeriesArea seriesDuration = highchartsFactory.createSeriesArea();
|
||||
seriesDuration.name("Duration");
|
||||
seriesDuration.name(ServiceChartMeasure.Duration.getLabel());
|
||||
seriesDuration.color(colors.get(0));
|
||||
|
||||
ArrayNumber dataDuration = seriesDuration.dataAsArrayNumber();
|
||||
|
@ -562,7 +565,7 @@ public class ServiceChart extends SimpleContainer {
|
|||
|
||||
SeriesArea seriesMaxInvocationTime = highchartsFactory
|
||||
.createSeriesArea();
|
||||
seriesMaxInvocationTime.name("Max Invocation Time");
|
||||
seriesMaxInvocationTime.name(ServiceChartMeasure.MaxInvocationTime.getLabel());
|
||||
seriesMaxInvocationTime.color(colors.get(2));
|
||||
|
||||
ArrayNumber dataMaxInvocationTime = seriesMaxInvocationTime
|
||||
|
@ -573,7 +576,7 @@ public class ServiceChart extends SimpleContainer {
|
|||
|
||||
SeriesArea seriesMinInvocationTime = highchartsFactory
|
||||
.createSeriesArea();
|
||||
seriesMinInvocationTime.name("Min Invocation Time");
|
||||
seriesMinInvocationTime.name(ServiceChartMeasure.MinInvocationTime.getLabel());
|
||||
seriesMinInvocationTime.color(colors.get(3));
|
||||
// seriesMinInvocationTime.yAxisAsString("MinInvocationTime");
|
||||
|
|
@ -8,7 +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.SeriesStorageData;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.storage.SeriesStorageData;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.github.highcharts4gwt.client.view.widget.HighchartsLayoutPanel;
|
||||
|
@ -65,7 +65,7 @@ public class StorageChartBasicPanel extends SimpleContainer {
|
|||
private MenuItem GBItem;
|
||||
private MenuItem TBItem;
|
||||
|
||||
ChartOptions options;
|
||||
private ChartOptions options;
|
||||
|
||||
private VerticalLayoutContainer vert;
|
||||
private long unitMeasure = ByteUnitMeasure.getMegaByteDimForStorage();
|
||||
|
|
|
@ -10,7 +10,7 @@ import org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils.S
|
|||
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.SeriesStorageData;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.storage.SeriesStorageData;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.github.highcharts4gwt.client.view.widget.HighchartsLayoutPanel;
|
||||
|
@ -71,7 +71,7 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
private MenuItem GBItem;
|
||||
private MenuItem TBItem;
|
||||
|
||||
ChartOptions options;
|
||||
private ChartOptions options;
|
||||
|
||||
private VerticalLayoutContainer vert;
|
||||
private long unitMeasure = ByteUnitMeasure.getMegaByteDimForStorage();
|
||||
|
@ -401,23 +401,23 @@ public class StorageChartTopPanel extends SimpleContainer {
|
|||
|
||||
ArrayList<SeriesColumn> seriesColumn = new ArrayList<>();
|
||||
for (int i = 1; i < 6; i++) {
|
||||
SeriesColumn seriesOperationCount = highchartsFactory
|
||||
SeriesColumn seriesColumnData = highchartsFactory
|
||||
.createSeriesColumn();
|
||||
seriesOperationCount.name("Operation Count" + i);
|
||||
seriesOperationCount.color(colors.get(i));
|
||||
seriesOperationCount.type("column");
|
||||
seriesColumnData.name("Operation Count" + i);
|
||||
seriesColumnData.color(colors.get(i));
|
||||
seriesColumnData.type("column");
|
||||
|
||||
ArrayNumber dataOperationCount = seriesOperationCount
|
||||
ArrayNumber data = seriesColumnData
|
||||
.dataAsArrayNumber();
|
||||
|
||||
for (SeriesStorageData seriesStorageData : seriesStorage
|
||||
.getSeries()) {
|
||||
dataOperationCount.push(seriesStorageData.getOperationCount());
|
||||
data.push(seriesStorageData.getOperationCount());
|
||||
}
|
||||
|
||||
seriesOperationCount.pointInterval(interval).pointStart(
|
||||
seriesColumnData.pointInterval(interval).pointStart(
|
||||
dateStart.getTime());
|
||||
seriesColumn.add(seriesOperationCount);
|
||||
seriesColumn.add(seriesColumnData);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,65 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.client.maindata.charts.utils;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Service Chart Measure
|
||||
*
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
|
||||
public enum ServiceChartMeasure {
|
||||
|
||||
Duration("Duration"), MaxInvocationTime("Max Invocation Time"), MinInvocationTime(
|
||||
"Min Invocation Time"), OperationCount("Operation Count");
|
||||
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
private ServiceChartMeasure(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 ServiceChartMeasure getFromId(String id) {
|
||||
if (id == null || id.isEmpty())
|
||||
return null;
|
||||
|
||||
for (ServiceChartMeasure columnDataType : values()) {
|
||||
if (columnDataType.id.compareToIgnoreCase(id) == 0) {
|
||||
return columnDataType;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List<ServiceChartMeasure> asList() {
|
||||
List<ServiceChartMeasure> list = Arrays.asList(values());
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,28 +1,21 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.server.amservice;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.accounting.analytics.Info;
|
||||
import org.gcube.accounting.analytics.ResourceRecordQuery;
|
||||
import org.gcube.accounting.datamodel.aggregation.AggregatedJobUsageRecord;
|
||||
import org.gcube.accounting.datamodel.aggregation.AggregatedServiceUsageRecord;
|
||||
import org.gcube.accounting.datamodel.aggregation.AggregatedStorageUsageRecord;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.command.AccountingCommandBasic;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.command.AccountingCommandGetFilterKeys;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.command.AccountingCommandGetFilterValues;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.command.AccountingCommandTop;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.query.AccountingQuery;
|
||||
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.AccountingQueryBasic;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.query.AccountingQueryBuilder;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.query.AccountingQueryDirector;
|
||||
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.SeriesResponseBuilder;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.response.SeriesResponseDirector;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.query.AccountingQueryTop;
|
||||
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;
|
||||
|
@ -40,176 +33,70 @@ import org.slf4j.LoggerFactory;
|
|||
*
|
||||
*/
|
||||
public class AccountingCaller implements AccountingCallerInterface {
|
||||
static Logger logger = LoggerFactory
|
||||
.getLogger(AccountingCaller.class);
|
||||
static Logger logger = LoggerFactory.getLogger(AccountingCaller.class);
|
||||
|
||||
public AccountingCaller() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
public ArrayList<FilterKey> getFilterKeys(AccountingType accountingType)
|
||||
throws AccountingManagerServiceException {
|
||||
try {
|
||||
logger.debug("getFilterKeys(): [AccountingType=" + accountingType
|
||||
+ "]");
|
||||
if (accountingType == null) {
|
||||
return new ArrayList<FilterKey>();
|
||||
}
|
||||
ArrayList<FilterKey> filterKeys = new ArrayList<FilterKey>();
|
||||
List<String> keys;
|
||||
AccountingCommandGetFilterKeys accountingCommand=new AccountingCommandGetFilterKeys(accountingType);
|
||||
return accountingCommand.execute();
|
||||
}
|
||||
|
||||
public ArrayList<FilterValue> getFilterValues(
|
||||
FilterValuesRequest filterValuesRequest)
|
||||
throws AccountingManagerServiceException {
|
||||
AccountingCommandGetFilterValues accountingCommand=new AccountingCommandGetFilterValues(filterValuesRequest);
|
||||
return accountingCommand.execute();
|
||||
|
||||
ResourceRecordQuery rrq = new ResourceRecordQuery();
|
||||
|
||||
switch (accountingType) {
|
||||
case JOB:
|
||||
keys=rrq.getKeys(AggregatedJobUsageRecord.class);
|
||||
break;
|
||||
case PORTLET:
|
||||
// keys=rrq.getKeys(AggregatedPortletUsageRecord.class);
|
||||
return filterKeys;
|
||||
case SERVICE:
|
||||
keys = rrq.getKeys(AggregatedServiceUsageRecord.class);
|
||||
break;
|
||||
case STORAGE:
|
||||
keys = rrq.getKeys(AggregatedStorageUsageRecord.class);
|
||||
break;
|
||||
case TASK:
|
||||
// keys=rrq.getKeys(AggregatedTaskUsageRecord.class);
|
||||
return filterKeys;
|
||||
default:
|
||||
return filterKeys;
|
||||
}
|
||||
for (String key : keys) {
|
||||
if (key != null && !key.isEmpty()) {
|
||||
filterKeys.add(new FilterKey(key));
|
||||
}
|
||||
}
|
||||
logger.debug("List FilterKeys:"+filterKeys);
|
||||
return filterKeys;
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error in getFilterKeys(): " + e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new AccountingManagerServiceException("No keys available!");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public SeriesResponse getSeries(AccountingType accountingType,
|
||||
SeriesRequest seriesRequest)
|
||||
throws AccountingManagerServiceException {
|
||||
try {
|
||||
logger.debug("getSeries(): [AccountingType=" + accountingType
|
||||
+ " , seriesRequest=" + seriesRequest + "]");
|
||||
|
||||
AccountingQueryBuilder queryBuilder = getAccountQueryBuilder(
|
||||
accountingType, seriesRequest);
|
||||
|
||||
AccountingQueryDirector director = new AccountingQueryDirector();
|
||||
director.setAccountingQueryBuilder(queryBuilder);
|
||||
director.constructAccountingQuery();
|
||||
AccountingQuery query = director.getAccountingQuery();
|
||||
|
||||
logger.debug("Query: " + query);
|
||||
|
||||
if (query == null || query.getChartType() == null) {
|
||||
throw new AccountingManagerServiceException(
|
||||
"Error in invocation: Operation not supported");
|
||||
}
|
||||
|
||||
public ArrayList<FilterValue> getFilterValues(FilterValuesRequest filterValuesRequest)
|
||||
throws AccountingManagerServiceException {
|
||||
try {
|
||||
logger.debug("getFilterValue(): [FilterValueRequest="
|
||||
+ filterValuesRequest + "]");
|
||||
if (filterValuesRequest == null
|
||||
|| filterValuesRequest.getAccountingType() == null
|
||||
|| filterValuesRequest.getFilterKey() == null) {
|
||||
return new ArrayList<FilterValue>();
|
||||
}
|
||||
|
||||
ArrayList<FilterValue> filteValues = new ArrayList<FilterValue>();
|
||||
List<String> values;
|
||||
|
||||
ResourceRecordQuery rrq = new ResourceRecordQuery();
|
||||
|
||||
switch (filterValuesRequest.getAccountingType()) {
|
||||
case JOB:
|
||||
values =
|
||||
rrq.getPossibleValuesForKey(AggregatedJobUsageRecord.class,
|
||||
filterValuesRequest.getFilterKey().getKey());
|
||||
return filteValues;
|
||||
case PORTLET:
|
||||
// values = rrq.getPossibleValuesForKey(
|
||||
// AggregatedPortletUsageRecord.class, filterValuesRequest
|
||||
// .getFilterKey().getKey());
|
||||
return filteValues;
|
||||
case SERVICE:
|
||||
values = rrq.getPossibleValuesForKey(
|
||||
AggregatedServiceUsageRecord.class, filterValuesRequest
|
||||
.getFilterKey().getKey());
|
||||
break;
|
||||
case STORAGE:
|
||||
values = rrq.getPossibleValuesForKey(
|
||||
AggregatedStorageUsageRecord.class, filterValuesRequest
|
||||
.getFilterKey().getKey());
|
||||
break;
|
||||
case TASK:
|
||||
// values = rrq.getPossibleValuesForKey(
|
||||
// AggregatedTaskUsageRecord.class, filterValuesRequest
|
||||
// .getFilterKey().getKey());
|
||||
return filteValues;
|
||||
default:
|
||||
return filteValues;
|
||||
}
|
||||
for (String value : values) {
|
||||
if (value != null && !value.isEmpty()) {
|
||||
filteValues.add(new FilterValue(value));
|
||||
}
|
||||
}
|
||||
|
||||
return filteValues;
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error in getFilterValues(): "
|
||||
+ e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new AccountingManagerServiceException("No values available!");
|
||||
|
||||
}
|
||||
switch (query.getChartType()) {
|
||||
case Basic:
|
||||
AccountingQueryBasic accountingQueryBasic = (AccountingQueryBasic) query;
|
||||
AccountingCommandBasic accountingCommandBasic=new AccountingCommandBasic(accountingQueryBasic,accountingType, seriesRequest);
|
||||
return accountingCommandBasic.execute();
|
||||
case Top:
|
||||
AccountingQueryTop accountingQueryTop = (AccountingQueryTop) query;
|
||||
AccountingCommandTop accountingCommandTop=new AccountingCommandTop(accountingQueryTop,accountingType, seriesRequest);
|
||||
return accountingCommandTop.execute();
|
||||
default:
|
||||
throw new AccountingManagerServiceException(
|
||||
"Error in invocation: Operation not supported");
|
||||
|
||||
}
|
||||
|
||||
public SeriesResponse getSeries(AccountingType accountingType, SeriesRequest seriesRequest)
|
||||
throws AccountingManagerServiceException {
|
||||
try {
|
||||
logger.debug("getSeries(): [AccountingType=" + accountingType
|
||||
+ " , seriesRequest=" + seriesRequest + "]");
|
||||
|
||||
ResourceRecordQuery rrq = new ResourceRecordQuery();
|
||||
|
||||
AccountingQueryBuilder queryBuilder = getAccountQueryBuilder(
|
||||
accountingType, seriesRequest);
|
||||
|
||||
AccountingQueryDirector director = new AccountingQueryDirector();
|
||||
director.setAccountingQueryBuilder(queryBuilder);
|
||||
director.constructAccountingQuery();
|
||||
AccountingQuery query = director.getAccountingQuery();
|
||||
|
||||
if (query == null) {
|
||||
throw new AccountingManagerServiceException(
|
||||
"Error in invocation: Operation not supported");
|
||||
}
|
||||
|
||||
logger.debug("Query: " + query);
|
||||
|
||||
List<Info> infos = rrq.getInfo(query.getType(),
|
||||
query.getTemporalConstraint(), query.getFilters(), true);
|
||||
if (infos == null) {
|
||||
throw new AccountingManagerServiceException(
|
||||
"Error retrieving list of info: list is null!");
|
||||
}
|
||||
logger.debug("Retrieved Infos");
|
||||
logger.debug("Infos: " + infos);
|
||||
|
||||
SeriesResponseBuilder seriesResponseBuilder = getSeriesResponseBuilder(
|
||||
accountingType, infos);
|
||||
|
||||
SeriesResponseDirector seriesResponseDirector = new SeriesResponseDirector();
|
||||
seriesResponseDirector
|
||||
.setSeriesResponseBuilder(seriesResponseBuilder);
|
||||
seriesResponseDirector.constructSeriesResponse();
|
||||
SeriesResponse seriesResponse = seriesResponseDirector
|
||||
.getSeriesResponse();
|
||||
|
||||
if (seriesResponse == null) {
|
||||
throw new AccountingManagerServiceException(
|
||||
"Error creating series response!");
|
||||
}
|
||||
logger.debug("SeriesResponse Created: " + seriesResponse);
|
||||
return seriesResponse;
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error in GetSeries(): " + e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new AccountingManagerServiceException("No data available!");
|
||||
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error in GetSeries(): " + e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new AccountingManagerServiceException("No data available!");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private AccountingQueryBuilder getAccountQueryBuilder(
|
||||
|
@ -243,30 +130,6 @@ public class AccountingCaller implements AccountingCallerInterface {
|
|||
}
|
||||
}
|
||||
|
||||
private SeriesResponseBuilder getSeriesResponseBuilder(
|
||||
AccountingType accountingType, List<Info> infos)
|
||||
throws AccountingManagerServiceException {
|
||||
if (accountingType == null) {
|
||||
throw new AccountingManagerServiceException(
|
||||
"Error accounting type is null");
|
||||
}
|
||||
|
||||
switch (accountingType) {
|
||||
case JOB:
|
||||
return new SeriesResponse4Job(infos);
|
||||
case PORTLET:
|
||||
return new SeriesResponse4Portlet(infos);
|
||||
case SERVICE:
|
||||
return new SeriesResponse4Service(infos);
|
||||
case STORAGE:
|
||||
return new SeriesResponse4Storage(infos);
|
||||
case TASK:
|
||||
return new SeriesResponse4Task(infos);
|
||||
default:
|
||||
throw new AccountingManagerServiceException(
|
||||
"Error request type is unknow!");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -5,6 +5,12 @@ 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;
|
||||
|
@ -12,13 +18,13 @@ import org.gcube.portlets.admin.accountingmanager.shared.data.FilterValuesReques
|
|||
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.data.response.SeriesStorage;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesStorageData;
|
||||
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.SeriesStorageDefinition;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.AccountingManagerServiceException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author giancarlo email: <a
|
||||
|
@ -32,121 +38,142 @@ public class AccountingCallerTester implements AccountingCallerInterface {
|
|||
public AccountingCallerTester() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
public ArrayList<FilterKey> getFilterKeys(AccountingType accountingType)
|
||||
throws AccountingManagerServiceException {
|
||||
try {
|
||||
logger.debug("getFilterKeys(): [AccountingType=" + accountingType
|
||||
+ "]");
|
||||
if (accountingType == null) {
|
||||
return new ArrayList<FilterKey>();
|
||||
}
|
||||
ArrayList<FilterKey> filterKeys = new ArrayList<FilterKey>();
|
||||
FilterKey key=new FilterKey("ConsumerId");
|
||||
FilterKey key1=new FilterKey("ClassName");
|
||||
|
||||
filterKeys.add(key);
|
||||
filterKeys.add(key1);
|
||||
|
||||
logger.debug("List FilterKeys:"+filterKeys);
|
||||
return filterKeys;
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error in getFilterKeys(): " + e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new AccountingManagerServiceException("No keys available!");
|
||||
|
||||
try {
|
||||
logger.debug("getFilterKeys(): [AccountingType=" + accountingType
|
||||
+ "]");
|
||||
if (accountingType == null) {
|
||||
return new ArrayList<FilterKey>();
|
||||
}
|
||||
ArrayList<FilterKey> filterKeys = new ArrayList<FilterKey>();
|
||||
FilterKey key = new FilterKey("ConsumerId");
|
||||
FilterKey key1 = new FilterKey("ClassName");
|
||||
|
||||
filterKeys.add(key);
|
||||
filterKeys.add(key1);
|
||||
|
||||
logger.debug("List FilterKeys:" + filterKeys);
|
||||
return filterKeys;
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error in getFilterKeys(): " + e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new AccountingManagerServiceException("No keys available!");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public ArrayList<FilterValue> getFilterValues(
|
||||
FilterValuesRequest filterValuesRequest)
|
||||
throws AccountingManagerServiceException {
|
||||
try {
|
||||
logger.debug("getFilterValue(): [FilterValueRequest="
|
||||
+ filterValuesRequest + "]");
|
||||
if (filterValuesRequest == null
|
||||
|| filterValuesRequest.getAccountingType() == null
|
||||
|| filterValuesRequest.getFilterKey() == null) {
|
||||
return new ArrayList<FilterValue>();
|
||||
}
|
||||
|
||||
ArrayList<FilterValue> filteValues = new ArrayList<FilterValue>();
|
||||
List<String> values;
|
||||
|
||||
String[] vals = { "giancarlo.panichi", "gianpaolo.coro" };
|
||||
|
||||
switch (filterValuesRequest.getAccountingType()) {
|
||||
case JOB:
|
||||
values = Arrays.asList(vals);
|
||||
case PORTLET:
|
||||
values = Arrays.asList(vals);
|
||||
case SERVICE:
|
||||
values = Arrays.asList(vals);
|
||||
case STORAGE:
|
||||
values = Arrays.asList(vals);
|
||||
case TASK:
|
||||
values = Arrays.asList(vals);
|
||||
default:
|
||||
values = Arrays.asList(vals);
|
||||
}
|
||||
for (String value : values) {
|
||||
if (value != null && !value.isEmpty()) {
|
||||
filteValues.add(new FilterValue(value));
|
||||
}
|
||||
}
|
||||
|
||||
public ArrayList<FilterValue> getFilterValues(FilterValuesRequest filterValuesRequest)
|
||||
throws AccountingManagerServiceException {
|
||||
try {
|
||||
logger.debug("getFilterValue(): [FilterValueRequest="
|
||||
+ filterValuesRequest + "]");
|
||||
if (filterValuesRequest == null
|
||||
|| filterValuesRequest.getAccountingType() == null
|
||||
|| filterValuesRequest.getFilterKey() == null) {
|
||||
return new ArrayList<FilterValue>();
|
||||
}
|
||||
|
||||
ArrayList<FilterValue> filteValues = new ArrayList<FilterValue>();
|
||||
List<String> values;
|
||||
|
||||
String[] vals={"giancarlo.panichi","gianpaolo.coro"};
|
||||
|
||||
switch (filterValuesRequest.getAccountingType()) {
|
||||
case JOB:
|
||||
values = Arrays.asList(vals);
|
||||
case PORTLET:
|
||||
values = Arrays.asList(vals);
|
||||
case SERVICE:
|
||||
values = Arrays.asList(vals);
|
||||
case STORAGE:
|
||||
values = Arrays.asList(vals);
|
||||
case TASK:
|
||||
values = Arrays.asList(vals);
|
||||
default:
|
||||
values = Arrays.asList(vals);
|
||||
}
|
||||
for (String value : values) {
|
||||
if (value != null && !value.isEmpty()) {
|
||||
filteValues.add(new FilterValue(value));
|
||||
}
|
||||
}
|
||||
|
||||
return filteValues;
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error in getFilterValues(): "
|
||||
+ e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new AccountingManagerServiceException("No values available!");
|
||||
|
||||
}
|
||||
}
|
||||
return filteValues;
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error in getFilterValues(): "
|
||||
+ e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new AccountingManagerServiceException("No values available!");
|
||||
|
||||
public SeriesResponse getSeries(AccountingType accountingType, SeriesRequest seriesRequest)
|
||||
}
|
||||
}
|
||||
|
||||
public SeriesResponse getSeries(AccountingType accountingType,
|
||||
SeriesRequest seriesRequest)
|
||||
throws AccountingManagerServiceException {
|
||||
try {
|
||||
logger.debug("getSeries(): [AccountingType=" + accountingType
|
||||
+ " , seriesRequest=" + seriesRequest + "]");
|
||||
SeriesResponse seriesResponse=null;
|
||||
switch(accountingType){
|
||||
case JOB:
|
||||
break;
|
||||
case PORTLET:
|
||||
break;
|
||||
case SERVICE:
|
||||
break;
|
||||
case STORAGE:
|
||||
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());
|
||||
try {
|
||||
logger.debug("getSeries(): [AccountingType=" + accountingType
|
||||
+ " , seriesRequest=" + seriesRequest + "]");
|
||||
SeriesResponse seriesResponse = null;
|
||||
switch (accountingType) {
|
||||
case JOB:
|
||||
break;
|
||||
case PORTLET:
|
||||
break;
|
||||
case SERVICE:
|
||||
break;
|
||||
case STORAGE:
|
||||
SeriesStorageDefinition serieStorageDefinition=null;
|
||||
if (seriesRequest.getAccountingFilterDefinition()
|
||||
.getChartType() != null) {
|
||||
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);
|
||||
|
||||
|
||||
}
|
||||
seriesResponse=new SeriesStorage(seriesStorageData);
|
||||
serieStorageDefinition=new SeriesStorageBasic(seriesStorageData);
|
||||
break;
|
||||
case TASK:
|
||||
case Top:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (seriesResponse == null) {
|
||||
throw new AccountingManagerServiceException(
|
||||
"Error creating series response!");
|
||||
}
|
||||
logger.debug("SeriesResponse Created: " + seriesResponse);
|
||||
return seriesResponse;
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error in GetSeries(): " + e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new AccountingManagerServiceException("No data available!");
|
||||
|
||||
}
|
||||
|
||||
seriesResponse = new SeriesStorage(serieStorageDefinition);
|
||||
|
||||
break;
|
||||
case TASK:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (seriesResponse == null) {
|
||||
throw new AccountingManagerServiceException(
|
||||
"Error creating series response!");
|
||||
}
|
||||
logger.debug("SeriesResponse Created: " + seriesResponse);
|
||||
return seriesResponse;
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error in GetSeries(): " + e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new AccountingManagerServiceException("No data available!");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.server.amservice.command;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.AccountingManagerServiceException;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public interface AccountingCommand<T> {
|
||||
|
||||
T execute() throws AccountingManagerServiceException;
|
||||
|
||||
}
|
|
@ -0,0 +1,107 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.server.amservice.command;
|
||||
|
||||
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.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;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class AccountingCommandBasic implements AccountingCommand<SeriesResponse> {
|
||||
private static final Logger logger = LoggerFactory.getLogger(AccountingCommandBasic.class);
|
||||
|
||||
private AccountingQueryBasic accountingQueryBasic;
|
||||
private AccountingType accountingType;
|
||||
private SeriesRequest seriesRequest;
|
||||
|
||||
public AccountingCommandBasic(AccountingQueryBasic accountingQueryBasic, AccountingType accountingType, SeriesRequest seriesRequest){
|
||||
this.accountingQueryBasic=accountingQueryBasic;
|
||||
this.accountingType=accountingType;
|
||||
this.seriesRequest=seriesRequest;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public SeriesResponse execute() throws AccountingManagerServiceException {
|
||||
try {
|
||||
ResourceRecordQuery rrq = new ResourceRecordQuery();
|
||||
|
||||
List<Info> infos = rrq.getInfo(accountingQueryBasic.getType(),
|
||||
accountingQueryBasic.getTemporalConstraint(), accountingQueryBasic.getFilters(), true);
|
||||
if (infos == null) {
|
||||
throw new AccountingManagerServiceException(
|
||||
"Error retrieving list of info: list is null!");
|
||||
}
|
||||
logger.debug("Retrieved Infos");
|
||||
logger.debug("Infos: " + infos);
|
||||
|
||||
SeriesResponseBuilder seriesResponseBuilder = getSeriesResponseBuilder(
|
||||
accountingType, infos);
|
||||
|
||||
SeriesResponseDirector seriesResponseDirector = new SeriesResponseDirector();
|
||||
seriesResponseDirector
|
||||
.setSeriesResponseBuilder(seriesResponseBuilder);
|
||||
seriesResponseDirector.constructSeriesResponse();
|
||||
SeriesResponse seriesResponse = seriesResponseDirector
|
||||
.getSeriesResponse();
|
||||
|
||||
if (seriesResponse == null) {
|
||||
throw new AccountingManagerServiceException(
|
||||
"Error creating series response!");
|
||||
}
|
||||
logger.debug("SeriesResponse Created: " + seriesResponse);
|
||||
return seriesResponse;
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error in AccountingCommandBasic(): " + e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new AccountingManagerServiceException("No data available!");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private SeriesResponseBuilder getSeriesResponseBuilder(
|
||||
AccountingType accountingType, List<Info> infos)
|
||||
throws AccountingManagerServiceException {
|
||||
if (accountingType == null) {
|
||||
throw new AccountingManagerServiceException(
|
||||
"Error accounting type is null");
|
||||
}
|
||||
|
||||
switch (accountingType) {
|
||||
case JOB:
|
||||
return new SeriesResponse4Job(infos);
|
||||
case PORTLET:
|
||||
return new SeriesResponse4Portlet(infos);
|
||||
case SERVICE:
|
||||
return new SeriesResponse4Service(infos);
|
||||
case STORAGE:
|
||||
return new SeriesResponse4Storage(infos);
|
||||
case TASK:
|
||||
return new SeriesResponse4Task(infos);
|
||||
default:
|
||||
throw new AccountingManagerServiceException(
|
||||
"Error request type is unknow!");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.server.amservice.command;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.accounting.analytics.ResourceRecordQuery;
|
||||
import org.gcube.accounting.datamodel.aggregation.AggregatedJobUsageRecord;
|
||||
import org.gcube.accounting.datamodel.aggregation.AggregatedServiceUsageRecord;
|
||||
import org.gcube.accounting.datamodel.aggregation.AggregatedStorageUsageRecord;
|
||||
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.exception.AccountingManagerServiceException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class AccountingCommandGetFilterKeys implements AccountingCommand<ArrayList<FilterKey>> {
|
||||
private static final Logger logger = LoggerFactory.getLogger(AccountingCommandGetFilterKeys.class);
|
||||
|
||||
private AccountingType accountingType;
|
||||
|
||||
public AccountingCommandGetFilterKeys(AccountingType accountingType){
|
||||
this.accountingType=accountingType;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ArrayList<FilterKey> execute() throws AccountingManagerServiceException {
|
||||
try {
|
||||
logger.debug("getFilterKeys(): [AccountingType=" + accountingType
|
||||
+ "]");
|
||||
if (accountingType == null) {
|
||||
return new ArrayList<FilterKey>();
|
||||
}
|
||||
ArrayList<FilterKey> filterKeys = new ArrayList<FilterKey>();
|
||||
List<String> keys;
|
||||
|
||||
ResourceRecordQuery rrq = new ResourceRecordQuery();
|
||||
|
||||
switch (accountingType) {
|
||||
case JOB:
|
||||
keys = rrq.getKeys(AggregatedJobUsageRecord.class);
|
||||
break;
|
||||
case PORTLET:
|
||||
// keys=rrq.getKeys(AggregatedPortletUsageRecord.class);
|
||||
return filterKeys;
|
||||
case SERVICE:
|
||||
keys = rrq.getKeys(AggregatedServiceUsageRecord.class);
|
||||
break;
|
||||
case STORAGE:
|
||||
keys = rrq.getKeys(AggregatedStorageUsageRecord.class);
|
||||
break;
|
||||
case TASK:
|
||||
// keys=rrq.getKeys(AggregatedTaskUsageRecord.class);
|
||||
return filterKeys;
|
||||
default:
|
||||
return filterKeys;
|
||||
}
|
||||
for (String key : keys) {
|
||||
if (key != null && !key.isEmpty()) {
|
||||
filterKeys.add(new FilterKey(key));
|
||||
}
|
||||
}
|
||||
logger.debug("List FilterKeys:" + filterKeys);
|
||||
return filterKeys;
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error in AccountingCommandGetFilterKeys(): " + e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new AccountingManagerServiceException("No keys available!");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,94 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.server.amservice.command;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.accounting.analytics.ResourceRecordQuery;
|
||||
import org.gcube.accounting.datamodel.aggregation.AggregatedJobUsageRecord;
|
||||
import org.gcube.accounting.datamodel.aggregation.AggregatedServiceUsageRecord;
|
||||
import org.gcube.accounting.datamodel.aggregation.AggregatedStorageUsageRecord;
|
||||
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.exception.AccountingManagerServiceException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class AccountingCommandGetFilterValues implements AccountingCommand<ArrayList<FilterValue>> {
|
||||
private static final Logger logger = LoggerFactory.getLogger(AccountingCommandGetFilterValues.class);
|
||||
|
||||
private FilterValuesRequest filterValuesRequest;
|
||||
|
||||
public AccountingCommandGetFilterValues(FilterValuesRequest filterValuesRequest){
|
||||
this.filterValuesRequest=filterValuesRequest;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ArrayList<FilterValue> execute() throws AccountingManagerServiceException {
|
||||
try {
|
||||
logger.debug("getFilterValue(): [FilterValueRequest="
|
||||
+ filterValuesRequest + "]");
|
||||
if (filterValuesRequest == null
|
||||
|| filterValuesRequest.getAccountingType() == null
|
||||
|| filterValuesRequest.getFilterKey() == null) {
|
||||
return new ArrayList<FilterValue>();
|
||||
}
|
||||
|
||||
ArrayList<FilterValue> filteValues = new ArrayList<FilterValue>();
|
||||
List<String> values;
|
||||
|
||||
ResourceRecordQuery rrq = new ResourceRecordQuery();
|
||||
|
||||
switch (filterValuesRequest.getAccountingType()) {
|
||||
case JOB:
|
||||
values = rrq.getPossibleValuesForKey(
|
||||
AggregatedJobUsageRecord.class, filterValuesRequest
|
||||
.getFilterKey().getKey());
|
||||
return filteValues;
|
||||
case PORTLET:
|
||||
// values = rrq.getPossibleValuesForKey(
|
||||
// AggregatedPortletUsageRecord.class, filterValuesRequest
|
||||
// .getFilterKey().getKey());
|
||||
return filteValues;
|
||||
case SERVICE:
|
||||
values = rrq.getPossibleValuesForKey(
|
||||
AggregatedServiceUsageRecord.class, filterValuesRequest
|
||||
.getFilterKey().getKey());
|
||||
break;
|
||||
case STORAGE:
|
||||
values = rrq.getPossibleValuesForKey(
|
||||
AggregatedStorageUsageRecord.class, filterValuesRequest
|
||||
.getFilterKey().getKey());
|
||||
break;
|
||||
case TASK:
|
||||
// values = rrq.getPossibleValuesForKey(
|
||||
// AggregatedTaskUsageRecord.class, filterValuesRequest
|
||||
// .getFilterKey().getKey());
|
||||
return filteValues;
|
||||
default:
|
||||
return filteValues;
|
||||
}
|
||||
for (String value : values) {
|
||||
if (value != null && !value.isEmpty()) {
|
||||
filteValues.add(new FilterValue(value));
|
||||
}
|
||||
}
|
||||
|
||||
return filteValues;
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error in AccountingCommandGetFilterValues(): "
|
||||
+ e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new AccountingManagerServiceException("No values available!");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,110 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.server.amservice.command;
|
||||
|
||||
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.SeriesResponseBuilder;
|
||||
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;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class AccountingCommandTop implements AccountingCommand<SeriesResponse> {
|
||||
private static final Logger logger = LoggerFactory.getLogger(AccountingCommandTop.class);
|
||||
|
||||
private AccountingQueryTop accountingQueryTop;
|
||||
private AccountingType accountingType;
|
||||
private SeriesRequest seriesRequest;
|
||||
|
||||
public AccountingCommandTop(AccountingQueryTop accountingQueryTop, AccountingType accountingType, SeriesRequest seriesRequest){
|
||||
this.accountingQueryTop=accountingQueryTop;
|
||||
this.accountingType=accountingType;
|
||||
this.seriesRequest=seriesRequest;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public SeriesResponse execute() throws AccountingManagerServiceException {
|
||||
try {
|
||||
ResourceRecordQuery rrq = new ResourceRecordQuery();
|
||||
|
||||
/*
|
||||
List<Info> infos = rrq.getInfo(accountingQueryBasic.getType(),
|
||||
accountingQueryBasic.getTemporalConstraint(), accountingQueryBasic.getFilters(), true);
|
||||
if (infos == null) {
|
||||
throw new AccountingManagerServiceException(
|
||||
"Error retrieving list of info: list is null!");
|
||||
}
|
||||
logger.debug("Retrieved Infos");
|
||||
logger.debug("Infos: " + infos);
|
||||
*/
|
||||
|
||||
/*SeriesResponseBuilder seriesResponseBuilder = getSeriesResponseBuilder(
|
||||
accountingType, infos);
|
||||
|
||||
SeriesResponseDirector seriesResponseDirector = new SeriesResponseDirector();
|
||||
seriesResponseDirector
|
||||
.setSeriesResponseBuilder(seriesResponseBuilder);
|
||||
seriesResponseDirector.constructSeriesResponse();
|
||||
SeriesResponse seriesResponse = seriesResponseDirector
|
||||
.getSeriesResponse();
|
||||
|
||||
if (seriesResponse == null) {
|
||||
throw new AccountingManagerServiceException(
|
||||
"Error creating series response!");
|
||||
}
|
||||
logger.debug("SeriesResponse Created: " + seriesResponse);
|
||||
return seriesResponse;
|
||||
*/
|
||||
return null;
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error in AccountingCommandTop(): " + e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new AccountingManagerServiceException("No data available!");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private SeriesResponseBuilder getSeriesResponseBuilder(
|
||||
AccountingType accountingType, List<Info> infos)
|
||||
throws AccountingManagerServiceException {
|
||||
if (accountingType == null) {
|
||||
throw new AccountingManagerServiceException(
|
||||
"Error accounting type is null");
|
||||
}
|
||||
|
||||
switch (accountingType) {
|
||||
case JOB:
|
||||
return new SeriesResponse4Job(infos);
|
||||
case PORTLET:
|
||||
return new SeriesResponse4Portlet(infos);
|
||||
case SERVICE:
|
||||
return new SeriesResponse4Service(infos);
|
||||
case STORAGE:
|
||||
return new SeriesResponse4Storage(infos);
|
||||
case TASK:
|
||||
return new SeriesResponse4Task(infos);
|
||||
default:
|
||||
throw new AccountingManagerServiceException(
|
||||
"Error request type is unknow!");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,12 +1,6 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.server.amservice.query;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.accounting.analytics.Filter;
|
||||
import org.gcube.accounting.analytics.TemporalConstraint;
|
||||
import org.gcube.accounting.datamodel.AggregatedUsageRecord;
|
||||
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -14,49 +8,20 @@ import org.gcube.accounting.datamodel.AggregatedUsageRecord;
|
|||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
public class AccountingQuery {
|
||||
private Class<? extends AggregatedUsageRecord> type;
|
||||
private TemporalConstraint temporalConstraint;
|
||||
private ArrayList<Filter> filters;
|
||||
protected ChartType chartType;
|
||||
|
||||
public AccountingQuery() {
|
||||
|
||||
public AccountingQuery(Class<? extends AggregatedUsageRecord> type,
|
||||
TemporalConstraint temporalConstraint, ArrayList<Filter> filters) {
|
||||
super();
|
||||
this.type = type;
|
||||
this.temporalConstraint = temporalConstraint;
|
||||
this.filters = filters;
|
||||
}
|
||||
|
||||
public Class<? extends AggregatedUsageRecord> getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(Class<? extends AggregatedUsageRecord> type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public TemporalConstraint getTemporalConstraint() {
|
||||
return temporalConstraint;
|
||||
}
|
||||
|
||||
public void setTemporalConstraint(TemporalConstraint temporalConstraint) {
|
||||
this.temporalConstraint = temporalConstraint;
|
||||
}
|
||||
|
||||
public ArrayList<Filter> getFilters() {
|
||||
return filters;
|
||||
}
|
||||
|
||||
public void setFilters(ArrayList<Filter> filters) {
|
||||
this.filters = filters;
|
||||
public ChartType getChartType() {
|
||||
return chartType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AccountingQuery [type=" + type + ", temporalConstraint="
|
||||
+ temporalConstraint + ", filters=" + filters + "]";
|
||||
return "AccountingQuery [chartType=" + chartType + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -93,7 +93,7 @@ public class AccountingQuery4Job extends AccountingQueryBuilder {
|
|||
}
|
||||
}
|
||||
|
||||
AccountingQuery invocation = new AccountingQuery(
|
||||
AccountingQueryBasic invocation = new AccountingQueryBasic(
|
||||
AggregatedJobUsageRecord.class, temporalConstraint, filters);
|
||||
|
||||
accountingQuerySpec.setOp(invocation);
|
||||
|
|
|
@ -91,7 +91,7 @@ public class AccountingQuery4Portlet extends AccountingQueryBuilder {
|
|||
filters.add(filter);
|
||||
}
|
||||
}
|
||||
AccountingQuery invocation = new AccountingQuery(
|
||||
AccountingQueryBasic invocation = new AccountingQueryBasic(
|
||||
AggregatedPortletUsageRecord.class, temporalConstraint, filters);
|
||||
|
||||
accountingQuerySpec.setOp(invocation);
|
||||
|
|
|
@ -93,7 +93,7 @@ public class AccountingQuery4Service extends AccountingQueryBuilder {
|
|||
}
|
||||
}
|
||||
|
||||
AccountingQuery invocation = new AccountingQuery(
|
||||
AccountingQueryBasic invocation = new AccountingQueryBasic(
|
||||
AggregatedServiceUsageRecord.class, temporalConstraint, filters);
|
||||
|
||||
accountingQuerySpec.setOp(invocation);
|
||||
|
|
|
@ -91,7 +91,7 @@ public class AccountingQuery4Storage extends AccountingQueryBuilder {
|
|||
}
|
||||
|
||||
|
||||
AccountingQuery invocation = new AccountingQuery(
|
||||
AccountingQueryBasic invocation = new AccountingQueryBasic(
|
||||
AggregatedStorageUsageRecord.class, temporalConstraint, filters);
|
||||
|
||||
accountingQuerySpec.setOp(invocation);
|
||||
|
|
|
@ -94,7 +94,7 @@ public class AccountingQuery4Task extends AccountingQueryBuilder {
|
|||
}
|
||||
|
||||
|
||||
AccountingQuery invocation = new AccountingQuery(
|
||||
AccountingQueryBasic invocation = new AccountingQueryBasic(
|
||||
AggregatedTaskUsageRecord.class, temporalConstraint, filters);
|
||||
|
||||
accountingQuerySpec.setOp(invocation);
|
||||
|
|
|
@ -0,0 +1,65 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.server.amservice.query;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.accounting.analytics.Filter;
|
||||
import org.gcube.accounting.analytics.TemporalConstraint;
|
||||
import org.gcube.accounting.datamodel.AggregatedUsageRecord;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author giancarlo email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
public class AccountingQueryBasic extends AccountingQuery {
|
||||
private Class<? extends AggregatedUsageRecord> type;
|
||||
private TemporalConstraint temporalConstraint;
|
||||
private ArrayList<Filter> filters;
|
||||
|
||||
|
||||
public AccountingQueryBasic(Class<? extends AggregatedUsageRecord> type,
|
||||
TemporalConstraint temporalConstraint, ArrayList<Filter> filters) {
|
||||
super();
|
||||
chartType=ChartType.Basic;
|
||||
this.type = type;
|
||||
this.temporalConstraint = temporalConstraint;
|
||||
this.filters = filters;
|
||||
}
|
||||
|
||||
public Class<? extends AggregatedUsageRecord> getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(Class<? extends AggregatedUsageRecord> type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public TemporalConstraint getTemporalConstraint() {
|
||||
return temporalConstraint;
|
||||
}
|
||||
|
||||
public void setTemporalConstraint(TemporalConstraint temporalConstraint) {
|
||||
this.temporalConstraint = temporalConstraint;
|
||||
}
|
||||
|
||||
public ArrayList<Filter> getFilters() {
|
||||
return filters;
|
||||
}
|
||||
|
||||
public void setFilters(ArrayList<Filter> filters) {
|
||||
this.filters = filters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AccountingQueryBasic [type=" + type + ", temporalConstraint="
|
||||
+ temporalConstraint + ", filters=" + filters + "]";
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,84 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.server.amservice.query;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.accounting.analytics.Filter;
|
||||
import org.gcube.accounting.analytics.TemporalConstraint;
|
||||
import org.gcube.accounting.datamodel.AggregatedUsageRecord;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.FilterKey;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author giancarlo email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
public class AccountingQueryTop extends AccountingQuery {
|
||||
private Class<? extends AggregatedUsageRecord> type;
|
||||
private FilterKey filterKey;
|
||||
private Integer topNumber;
|
||||
private TemporalConstraint temporalConstraint;
|
||||
private ArrayList<Filter> filters;
|
||||
|
||||
public AccountingQueryTop(Class<? extends AggregatedUsageRecord> type,
|
||||
FilterKey filterKey, Integer topNumber,
|
||||
TemporalConstraint temporalConstraint, ArrayList<Filter> filters) {
|
||||
super();
|
||||
chartType = ChartType.Top;
|
||||
this.type = type;
|
||||
this.temporalConstraint = temporalConstraint;
|
||||
this.filters = filters;
|
||||
this.filterKey = filterKey;
|
||||
this.topNumber = topNumber;
|
||||
}
|
||||
|
||||
public Class<? extends AggregatedUsageRecord> getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(Class<? extends AggregatedUsageRecord> type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public TemporalConstraint getTemporalConstraint() {
|
||||
return temporalConstraint;
|
||||
}
|
||||
|
||||
public void setTemporalConstraint(TemporalConstraint temporalConstraint) {
|
||||
this.temporalConstraint = temporalConstraint;
|
||||
}
|
||||
|
||||
public ArrayList<Filter> getFilters() {
|
||||
return filters;
|
||||
}
|
||||
|
||||
public void setFilters(ArrayList<Filter> filters) {
|
||||
this.filters = filters;
|
||||
}
|
||||
|
||||
public FilterKey getFilterKey() {
|
||||
return filterKey;
|
||||
}
|
||||
|
||||
public void setFilterKey(FilterKey filterKey) {
|
||||
this.filterKey = filterKey;
|
||||
}
|
||||
|
||||
public Integer getTopNumber() {
|
||||
return topNumber;
|
||||
}
|
||||
|
||||
public void setTopNumber(Integer topNumber) {
|
||||
this.topNumber = topNumber;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AccountingQueryTop [type=" + type + ", filterKey=" + filterKey
|
||||
+ ", topNumber=" + topNumber + ", temporalConstraint="
|
||||
+ temporalConstraint + ", filters=" + filters + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -6,7 +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.SeriesJobData;
|
||||
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;
|
||||
|
|
|
@ -6,7 +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.SeriesServiceData;
|
||||
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;
|
||||
|
|
|
@ -6,7 +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.SeriesStorageData;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.storage.SeriesStorageData;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.AccountingManagerServiceException;
|
||||
import org.json.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
|
|
|
@ -17,13 +17,13 @@ public class AccountingFilterBasic extends AccountingFilterDefinition implements
|
|||
|
||||
public AccountingFilterBasic() {
|
||||
super();
|
||||
this.chartTypeDisplayable=ChartTypeDisplayable.Basic;
|
||||
this.chartType=ChartType.Basic;
|
||||
filters=null;
|
||||
}
|
||||
|
||||
public AccountingFilterBasic(ArrayList<AccountingFilter> filters) {
|
||||
super();
|
||||
chartTypeDisplayable = ChartTypeDisplayable.Basic;
|
||||
chartType = ChartType.Basic;
|
||||
this.filters = filters;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,20 +9,20 @@ package org.gcube.portlets.admin.accountingmanager.shared.data;
|
|||
*/
|
||||
public class AccountingFilterDefinition {
|
||||
|
||||
protected ChartTypeDisplayable chartTypeDisplayable;
|
||||
protected ChartType chartType;
|
||||
|
||||
public AccountingFilterDefinition() {
|
||||
super();
|
||||
}
|
||||
|
||||
public ChartTypeDisplayable getChartTypeDisplayable() {
|
||||
return chartTypeDisplayable;
|
||||
public ChartType getChartType() {
|
||||
return chartType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AccountingFilterDefinition [chartTypeDisplayable="
|
||||
+ chartTypeDisplayable + "]";
|
||||
return "AccountingFilterDefinition [chartType="
|
||||
+ chartType + "]";
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ public class AccountingFilterTop extends AccountingFilterDefinition implements S
|
|||
|
||||
public AccountingFilterTop() {
|
||||
super();
|
||||
this.chartTypeDisplayable=ChartTypeDisplayable.Top;
|
||||
this.chartType=ChartType.Top;
|
||||
topNumber=5;
|
||||
filterKey=null;
|
||||
filters=null;
|
||||
|
@ -27,7 +27,7 @@ public class AccountingFilterTop extends AccountingFilterDefinition implements S
|
|||
|
||||
public AccountingFilterTop(FilterKey filterKey, ArrayList<AccountingFilter> filters, Integer topNumber) {
|
||||
super();
|
||||
chartTypeDisplayable = ChartTypeDisplayable.Top;
|
||||
chartType = ChartType.Top;
|
||||
this.filterKey = filterKey;
|
||||
this.filters = filters;
|
||||
this.topNumber=topNumber;
|
||||
|
|
|
@ -12,7 +12,7 @@ import java.util.List;
|
|||
*
|
||||
*/
|
||||
|
||||
public enum ChartTypeDisplayable {
|
||||
public enum ChartType {
|
||||
|
||||
Basic("Basic"),Top("Top");
|
||||
|
||||
|
@ -20,7 +20,7 @@ public enum ChartTypeDisplayable {
|
|||
*
|
||||
* @param id
|
||||
*/
|
||||
private ChartTypeDisplayable(final String id) {
|
||||
private ChartType(final String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
@ -44,11 +44,11 @@ public enum ChartTypeDisplayable {
|
|||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public static ChartTypeDisplayable getFromId(String id) {
|
||||
public static ChartType getFromId(String id) {
|
||||
if (id == null || id.isEmpty())
|
||||
return null;
|
||||
|
||||
for (ChartTypeDisplayable columnDataType : values()) {
|
||||
for (ChartType columnDataType : values()) {
|
||||
if (columnDataType.id.compareToIgnoreCase(id) == 0) {
|
||||
return columnDataType;
|
||||
}
|
||||
|
@ -56,8 +56,8 @@ public enum ChartTypeDisplayable {
|
|||
return null;
|
||||
}
|
||||
|
||||
public static List<ChartTypeDisplayable> asList() {
|
||||
List<ChartTypeDisplayable> list = Arrays.asList(values());
|
||||
public static List<ChartType> asList() {
|
||||
List<ChartType> list = Arrays.asList(values());
|
||||
return list;
|
||||
}
|
||||
|
|
@ -1,46 +1,38 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.job.SeriesJobDefinition;
|
||||
|
||||
/**
|
||||
*
|
||||
* @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 SeriesJob extends SeriesResponse {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 8054723198014713937L;
|
||||
|
||||
ArrayList<SeriesJobData> series;
|
||||
|
||||
public SeriesJob(){
|
||||
private SeriesJobDefinition seriesJobDefinition;
|
||||
|
||||
public SeriesJob() {
|
||||
super();
|
||||
}
|
||||
|
||||
public SeriesJob(ArrayList<SeriesJobData> series) {
|
||||
public SeriesJob(SeriesJobDefinition seriesJobDefinition) {
|
||||
super();
|
||||
this.series = series;
|
||||
this.seriesJobDefinition = seriesJobDefinition;
|
||||
}
|
||||
|
||||
public ArrayList<SeriesJobData> getSeries() {
|
||||
return series;
|
||||
public SeriesJobDefinition getSeriesJobDefinition() {
|
||||
return seriesJobDefinition;
|
||||
}
|
||||
|
||||
public void setSeries(ArrayList<SeriesJobData> series) {
|
||||
this.series = series;
|
||||
public void setSeriesJobDefinition(SeriesJobDefinition seriesJobDefinition) {
|
||||
this.seriesJobDefinition = seriesJobDefinition;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesJob [series=" + series + "]";
|
||||
return "SeriesJob [seriesJobDefinition=" + seriesJobDefinition + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.portlet.SeriesPortletDefinition;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -12,28 +12,30 @@ public class SeriesPortlet extends SeriesResponse {
|
|||
|
||||
private static final long serialVersionUID = -1215710427019099089L;
|
||||
|
||||
ArrayList<SeriesPortletData> series;
|
||||
private SeriesPortletDefinition seriesPortletDefinition;
|
||||
|
||||
public SeriesPortlet() {
|
||||
super();
|
||||
}
|
||||
|
||||
public SeriesPortlet(ArrayList<SeriesPortletData> series) {
|
||||
public SeriesPortlet(SeriesPortletDefinition seriesPortletDefinition) {
|
||||
super();
|
||||
this.series = series;
|
||||
this.seriesPortletDefinition = seriesPortletDefinition;
|
||||
}
|
||||
|
||||
public ArrayList<SeriesPortletData> getSeries() {
|
||||
return series;
|
||||
public SeriesPortletDefinition getSeriesPortletDefinition() {
|
||||
return seriesPortletDefinition;
|
||||
}
|
||||
|
||||
public void setSeries(ArrayList<SeriesPortletData> series) {
|
||||
this.series = series;
|
||||
public void setSeriesPortletDefinition(
|
||||
SeriesPortletDefinition seriesPortletDefinition) {
|
||||
this.seriesPortletDefinition = seriesPortletDefinition;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesPortlet [series=" + series + "]";
|
||||
return "SeriesPortlet [seriesPortletDefinition="
|
||||
+ seriesPortletDefinition + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,43 +1,40 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.service.SeriesServiceDefinition;
|
||||
|
||||
/**
|
||||
*
|
||||
* @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 SeriesService extends SeriesResponse {
|
||||
|
||||
|
||||
private static final long serialVersionUID = -1311805875898959881L;
|
||||
ArrayList<SeriesServiceData> series;
|
||||
|
||||
|
||||
public SeriesService(){
|
||||
private SeriesServiceDefinition serieServiceDefinition;
|
||||
|
||||
public SeriesService() {
|
||||
super();
|
||||
}
|
||||
|
||||
public SeriesService(ArrayList<SeriesServiceData> series) {
|
||||
public SeriesService(SeriesServiceDefinition serieServiceDefinition) {
|
||||
super();
|
||||
this.series = series;
|
||||
this.serieServiceDefinition = serieServiceDefinition;
|
||||
}
|
||||
|
||||
public ArrayList<SeriesServiceData> getSeries() {
|
||||
return series;
|
||||
public SeriesServiceDefinition getSerieServiceDefinition() {
|
||||
return serieServiceDefinition;
|
||||
}
|
||||
|
||||
public void setSeries(ArrayList<SeriesServiceData> series) {
|
||||
this.series = series;
|
||||
public void setSerieServiceDefinition(
|
||||
SeriesServiceDefinition serieServiceDefinition) {
|
||||
this.serieServiceDefinition = serieServiceDefinition;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesService [series=" + series + "]";
|
||||
return "SeriesService [serieServiceDefinition="
|
||||
+ serieServiceDefinition + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,43 +1,40 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.storage.SeriesStorageDefinition;
|
||||
|
||||
/**
|
||||
*
|
||||
* @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 SeriesStorage extends SeriesResponse {
|
||||
|
||||
ArrayList<SeriesStorageData> series;
|
||||
|
||||
|
||||
private static final long serialVersionUID = 4519497775591158592L;
|
||||
private SeriesStorageDefinition seriesStorageDefinition;
|
||||
|
||||
public SeriesStorage(){
|
||||
public SeriesStorage() {
|
||||
super();
|
||||
}
|
||||
|
||||
public SeriesStorage(ArrayList<SeriesStorageData> series) {
|
||||
public SeriesStorage(SeriesStorageDefinition seriesStorageDefinition) {
|
||||
super();
|
||||
this.series = series;
|
||||
this.seriesStorageDefinition = seriesStorageDefinition;
|
||||
}
|
||||
|
||||
public ArrayList<SeriesStorageData> getSeries() {
|
||||
return series;
|
||||
public SeriesStorageDefinition getSeriesStorageDefinition() {
|
||||
return seriesStorageDefinition;
|
||||
}
|
||||
|
||||
public void setSeries(ArrayList<SeriesStorageData> series) {
|
||||
this.series = series;
|
||||
public void setSeriesStorageDefinition(
|
||||
SeriesStorageDefinition seriesStorageDefinition) {
|
||||
this.seriesStorageDefinition = seriesStorageDefinition;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesStorage [series=" + series + "]";
|
||||
return "SeriesStorage [seriesStorageDefinition="
|
||||
+ seriesStorageDefinition + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.task.SeriesTaskDefinition;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -12,28 +12,29 @@ public class SeriesTask extends SeriesResponse {
|
|||
|
||||
private static final long serialVersionUID = -1215710427019099089L;
|
||||
|
||||
ArrayList<SeriesTaskData> series;
|
||||
private SeriesTaskDefinition seriesTaskDefinition;
|
||||
|
||||
public SeriesTask() {
|
||||
super();
|
||||
}
|
||||
|
||||
public SeriesTask(ArrayList<SeriesTaskData> series) {
|
||||
public SeriesTask(SeriesTaskDefinition seriesTaskDefinition) {
|
||||
super();
|
||||
this.series = series;
|
||||
this.seriesTaskDefinition = seriesTaskDefinition;
|
||||
}
|
||||
|
||||
public ArrayList<SeriesTaskData> getSeries() {
|
||||
return series;
|
||||
public SeriesTaskDefinition getSeriesTaskDefinition() {
|
||||
return seriesTaskDefinition;
|
||||
}
|
||||
|
||||
public void setSeries(ArrayList<SeriesTaskData> series) {
|
||||
this.series = series;
|
||||
public void setSeriesTaskDefinition(
|
||||
SeriesTaskDefinition seriesTaskDefinition) {
|
||||
this.seriesTaskDefinition = seriesTaskDefinition;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesTask [series=" + series + "]";
|
||||
return "SeriesTask [seriesTaskDefinition=" + seriesTaskDefinition + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.job;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class SeriesJobBasic extends SeriesJobDefinition {
|
||||
|
||||
private static final long serialVersionUID = 6108185252722251397L;
|
||||
private ArrayList<SeriesJobData> series;
|
||||
|
||||
public SeriesJobBasic() {
|
||||
super();
|
||||
chartType = ChartType.Basic;
|
||||
}
|
||||
|
||||
public SeriesJobBasic(ArrayList<SeriesJobData> series) {
|
||||
super();
|
||||
chartType = ChartType.Basic;
|
||||
this.series = series;
|
||||
}
|
||||
|
||||
public ArrayList<SeriesJobData> getSeries() {
|
||||
return series;
|
||||
}
|
||||
|
||||
public void setSeries(ArrayList<SeriesJobData> series) {
|
||||
this.series = series;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesJobBasic [series=" + series + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response;
|
||||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.job;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
|
@ -0,0 +1,53 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.job;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.FilterValue;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class SeriesJobDataTop implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 6043106605633429465L;
|
||||
private FilterValue filterValue;
|
||||
private ArrayList<SeriesJobData> series;
|
||||
|
||||
public SeriesJobDataTop() {
|
||||
super();
|
||||
}
|
||||
|
||||
public SeriesJobDataTop(FilterValue filterValue,
|
||||
ArrayList<SeriesJobData> series) {
|
||||
super();
|
||||
this.filterValue = filterValue;
|
||||
this.series = series;
|
||||
}
|
||||
|
||||
public FilterValue getFilterValue() {
|
||||
return filterValue;
|
||||
}
|
||||
|
||||
public void setFilterValue(FilterValue filterValue) {
|
||||
this.filterValue = filterValue;
|
||||
}
|
||||
|
||||
public ArrayList<SeriesJobData> getSeries() {
|
||||
return series;
|
||||
}
|
||||
|
||||
public void setSeries(ArrayList<SeriesJobData> series) {
|
||||
this.series = series;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesJobDataTop [filterValue=" + filterValue + ", series="
|
||||
+ series + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.job;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class SeriesJobDefinition implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1499342835551822453L;
|
||||
protected ChartType chartType;
|
||||
|
||||
public SeriesJobDefinition() {
|
||||
super();
|
||||
}
|
||||
|
||||
public ChartType getChartType() {
|
||||
return chartType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesJobDefinition [chartType=" + chartType + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.job;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class SeriesJobTop extends SeriesJobDefinition {
|
||||
|
||||
private static final long serialVersionUID = -2350334263342186590L;
|
||||
private SeriesJobDataTop seriesJobDataTop;
|
||||
|
||||
public SeriesJobTop() {
|
||||
super();
|
||||
this.chartType = ChartType.Top;
|
||||
}
|
||||
|
||||
public SeriesJobTop(SeriesJobDataTop seriesJobDataTop) {
|
||||
super();
|
||||
this.seriesJobDataTop = seriesJobDataTop;
|
||||
}
|
||||
|
||||
public SeriesJobDataTop getSeriesJobDataTop() {
|
||||
return seriesJobDataTop;
|
||||
}
|
||||
|
||||
public void setSeriesJobDataTop(
|
||||
SeriesJobDataTop seriesJobDataTop) {
|
||||
this.seriesJobDataTop = seriesJobDataTop;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesJobTop [seriesJobDataTop=" + seriesJobDataTop
|
||||
+ "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.portlet;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class SeriesPortletBasic extends SeriesPortletDefinition {
|
||||
|
||||
private static final long serialVersionUID = 6108185252722251397L;
|
||||
private ArrayList<SeriesPortletData> series;
|
||||
|
||||
public SeriesPortletBasic() {
|
||||
super();
|
||||
chartType = ChartType.Basic;
|
||||
}
|
||||
|
||||
public SeriesPortletBasic(ArrayList<SeriesPortletData> series) {
|
||||
super();
|
||||
chartType = ChartType.Basic;
|
||||
this.series = series;
|
||||
}
|
||||
|
||||
public ArrayList<SeriesPortletData> getSeries() {
|
||||
return series;
|
||||
}
|
||||
|
||||
public void setSeries(ArrayList<SeriesPortletData> series) {
|
||||
this.series = series;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesPortletBasic [series=" + series + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response;
|
||||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.portlet;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
|
@ -0,0 +1,53 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.portlet;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.FilterValue;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class SeriesPortletDataTop implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 6043106605633429465L;
|
||||
private FilterValue filterValue;
|
||||
private ArrayList<SeriesPortletData> series;
|
||||
|
||||
public SeriesPortletDataTop() {
|
||||
super();
|
||||
}
|
||||
|
||||
public SeriesPortletDataTop(FilterValue filterValue,
|
||||
ArrayList<SeriesPortletData> series) {
|
||||
super();
|
||||
this.filterValue = filterValue;
|
||||
this.series = series;
|
||||
}
|
||||
|
||||
public FilterValue getFilterValue() {
|
||||
return filterValue;
|
||||
}
|
||||
|
||||
public void setFilterValue(FilterValue filterValue) {
|
||||
this.filterValue = filterValue;
|
||||
}
|
||||
|
||||
public ArrayList<SeriesPortletData> getSeries() {
|
||||
return series;
|
||||
}
|
||||
|
||||
public void setSeries(ArrayList<SeriesPortletData> series) {
|
||||
this.series = series;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesPortletDataTop [filterValue=" + filterValue + ", series="
|
||||
+ series + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.portlet;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class SeriesPortletDefinition implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1499342835551822453L;
|
||||
protected ChartType chartType;
|
||||
|
||||
public SeriesPortletDefinition() {
|
||||
super();
|
||||
}
|
||||
|
||||
public ChartType getChartType() {
|
||||
return chartType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesPortletDefinition [chartType=" + chartType + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.portlet;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class SeriesPortletTop extends SeriesPortletDefinition {
|
||||
|
||||
private static final long serialVersionUID = -2350334263342186590L;
|
||||
private SeriesPortletDataTop seriesPortletDataTop;
|
||||
|
||||
public SeriesPortletTop() {
|
||||
super();
|
||||
this.chartType = ChartType.Top;
|
||||
}
|
||||
|
||||
public SeriesPortletTop(SeriesPortletDataTop seriesPortletDataTop) {
|
||||
super();
|
||||
this.seriesPortletDataTop = seriesPortletDataTop;
|
||||
}
|
||||
|
||||
public SeriesPortletDataTop getSeriesPortletDataTop() {
|
||||
return seriesPortletDataTop;
|
||||
}
|
||||
|
||||
public void setSeriesPortletDataTop(
|
||||
SeriesPortletDataTop seriesPortletDataTop) {
|
||||
this.seriesPortletDataTop = seriesPortletDataTop;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesPortletTop [seriesPortletDataTop=" + seriesPortletDataTop
|
||||
+ "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class SeriesServiceBasic extends SeriesServiceDefinition {
|
||||
|
||||
private static final long serialVersionUID = 6108185252722251397L;
|
||||
private ArrayList<SeriesServiceData> series;
|
||||
|
||||
public SeriesServiceBasic() {
|
||||
super();
|
||||
chartType = ChartType.Basic;
|
||||
}
|
||||
|
||||
public SeriesServiceBasic(ArrayList<SeriesServiceData> series) {
|
||||
super();
|
||||
chartType = ChartType.Basic;
|
||||
this.series = series;
|
||||
}
|
||||
|
||||
public ArrayList<SeriesServiceData> getSeries() {
|
||||
return series;
|
||||
}
|
||||
|
||||
public void setSeries(ArrayList<SeriesServiceData> series) {
|
||||
this.series = series;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesServiceBasic [series=" + series + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response;
|
||||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.service;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
@ -11,7 +11,7 @@ import java.util.Date;
|
|||
*/
|
||||
public class SeriesServiceData implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -8322187634378176470L;
|
||||
private static final long serialVersionUID = -903768352060298831L;
|
||||
private Date date;
|
||||
private Long operationCount;
|
||||
private Long duration;
|
|
@ -0,0 +1,53 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.service;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.FilterValue;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class SeriesServiceDataTop implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 6043106605633429465L;
|
||||
private FilterValue filterValue;
|
||||
private ArrayList<SeriesServiceData> series;
|
||||
|
||||
public SeriesServiceDataTop() {
|
||||
super();
|
||||
}
|
||||
|
||||
public SeriesServiceDataTop(FilterValue filterValue,
|
||||
ArrayList<SeriesServiceData> series) {
|
||||
super();
|
||||
this.filterValue = filterValue;
|
||||
this.series = series;
|
||||
}
|
||||
|
||||
public FilterValue getFilterValue() {
|
||||
return filterValue;
|
||||
}
|
||||
|
||||
public void setFilterValue(FilterValue filterValue) {
|
||||
this.filterValue = filterValue;
|
||||
}
|
||||
|
||||
public ArrayList<SeriesServiceData> getSeries() {
|
||||
return series;
|
||||
}
|
||||
|
||||
public void setSeries(ArrayList<SeriesServiceData> series) {
|
||||
this.series = series;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesServiceDataTop [filterValue=" + filterValue + ", series="
|
||||
+ series + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.service;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class SeriesServiceDefinition implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1499342835551822453L;
|
||||
protected ChartType chartType;
|
||||
|
||||
public SeriesServiceDefinition() {
|
||||
super();
|
||||
}
|
||||
|
||||
public ChartType getChartType() {
|
||||
return chartType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesServiceDefinition [chartType=" + chartType + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.service;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class SeriesServiceTop extends SeriesServiceDefinition {
|
||||
|
||||
private static final long serialVersionUID = -2350334263342186590L;
|
||||
private SeriesServiceDataTop seriesServiceDataTop;
|
||||
|
||||
public SeriesServiceTop() {
|
||||
super();
|
||||
this.chartType = ChartType.Top;
|
||||
}
|
||||
|
||||
public SeriesServiceTop(SeriesServiceDataTop seriesServiceDataTop) {
|
||||
super();
|
||||
this.seriesServiceDataTop = seriesServiceDataTop;
|
||||
}
|
||||
|
||||
public SeriesServiceDataTop getSeriesServiceDataTop() {
|
||||
return seriesServiceDataTop;
|
||||
}
|
||||
|
||||
public void setSeriesServiceDataTop(
|
||||
SeriesServiceDataTop seriesServiceDataTop) {
|
||||
this.seriesServiceDataTop = seriesServiceDataTop;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesServiceTop [seriesServiceDataTop=" + seriesServiceDataTop
|
||||
+ "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.storage;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class SeriesStorageBasic extends SeriesStorageDefinition {
|
||||
|
||||
private static final long serialVersionUID = -5477545972037227361L;
|
||||
private ArrayList<SeriesStorageData> series;
|
||||
|
||||
public SeriesStorageBasic() {
|
||||
super();
|
||||
chartType = ChartType.Basic;
|
||||
}
|
||||
|
||||
public SeriesStorageBasic(ArrayList<SeriesStorageData> series) {
|
||||
super();
|
||||
chartType = ChartType.Basic;
|
||||
this.series = series;
|
||||
}
|
||||
|
||||
public ArrayList<SeriesStorageData> getSeries() {
|
||||
return series;
|
||||
}
|
||||
|
||||
public void setSeries(ArrayList<SeriesStorageData> series) {
|
||||
this.series = series;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesStorageBasic [series=" + series + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,26 +1,26 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response;
|
||||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.storage;
|
||||
|
||||
import java.io.Serializable;
|
||||
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 SeriesStorageData implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -192149405907077352L;
|
||||
|
||||
|
||||
private Date date;
|
||||
private Long dataVolume;
|
||||
private Long operationCount;
|
||||
|
||||
public SeriesStorageData(){
|
||||
|
||||
public SeriesStorageData() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param date
|
||||
|
@ -63,7 +63,5 @@ public class SeriesStorageData implements Serializable {
|
|||
return "SeriesStorageData [date=" + date + ", dataVolume=" + dataVolume
|
||||
+ ", operationCount=" + operationCount + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.storage;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.FilterValue;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class SeriesStorageDataTop implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -627227653308818605L;
|
||||
private FilterValue filterValue;
|
||||
private ArrayList<SeriesStorageData> series;
|
||||
|
||||
public SeriesStorageDataTop() {
|
||||
super();
|
||||
}
|
||||
|
||||
public SeriesStorageDataTop(FilterValue filterValue,
|
||||
ArrayList<SeriesStorageData> series) {
|
||||
super();
|
||||
this.filterValue = filterValue;
|
||||
this.series = series;
|
||||
}
|
||||
|
||||
public FilterValue getFilterValue() {
|
||||
return filterValue;
|
||||
}
|
||||
|
||||
public void setFilterValue(FilterValue filterValue) {
|
||||
this.filterValue = filterValue;
|
||||
}
|
||||
|
||||
public ArrayList<SeriesStorageData> getSeries() {
|
||||
return series;
|
||||
}
|
||||
|
||||
public void setSeries(ArrayList<SeriesStorageData> series) {
|
||||
this.series = series;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesStorageDataTop [filterValue=" + filterValue + ", series="
|
||||
+ series + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.storage;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class SeriesStorageDefinition implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -838923932433584818L;
|
||||
protected ChartType chartType;
|
||||
|
||||
public SeriesStorageDefinition() {
|
||||
super();
|
||||
}
|
||||
|
||||
public ChartType getChartType() {
|
||||
return chartType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesStorageDefinition [chartType=" + chartType + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.storage;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class SeriesStorageTop extends SeriesStorageDefinition {
|
||||
|
||||
private static final long serialVersionUID = -5477545972037227361L;
|
||||
private SeriesStorageDataTop seriesStorageDataTop;
|
||||
|
||||
public SeriesStorageTop() {
|
||||
super();
|
||||
this.chartType = ChartType.Top;
|
||||
}
|
||||
|
||||
public SeriesStorageTop(SeriesStorageDataTop seriesStorageDataTop) {
|
||||
super();
|
||||
this.seriesStorageDataTop = seriesStorageDataTop;
|
||||
}
|
||||
|
||||
public SeriesStorageDataTop getSeriesStorageDataTop() {
|
||||
return seriesStorageDataTop;
|
||||
}
|
||||
|
||||
public void setSeriesStorageDataTop(
|
||||
SeriesStorageDataTop seriesStorageDataTop) {
|
||||
this.seriesStorageDataTop = seriesStorageDataTop;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesStorageTop [seriesStorageDataTop=" + seriesStorageDataTop
|
||||
+ "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.task;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class SeriesTaskBasic extends SeriesTaskDefinition {
|
||||
|
||||
private static final long serialVersionUID = -5327331420724956813L;
|
||||
private ArrayList<SeriesTaskData> series;
|
||||
|
||||
public SeriesTaskBasic() {
|
||||
super();
|
||||
chartType = ChartType.Basic;
|
||||
}
|
||||
|
||||
public SeriesTaskBasic(ArrayList<SeriesTaskData> series) {
|
||||
super();
|
||||
chartType = ChartType.Basic;
|
||||
this.series = series;
|
||||
}
|
||||
|
||||
public ArrayList<SeriesTaskData> getSeries() {
|
||||
return series;
|
||||
}
|
||||
|
||||
public void setSeries(ArrayList<SeriesTaskData> series) {
|
||||
this.series = series;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesTaskBasic [series=" + series + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response;
|
||||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.task;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
@ -11,7 +11,7 @@ import java.util.Date;
|
|||
*/
|
||||
public class SeriesTaskData implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -4812847957210767836L;
|
||||
private static final long serialVersionUID = -3981690521755233678L;
|
||||
private Date date;
|
||||
private Long operationCount;
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.task;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.FilterValue;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class SeriesTaskDataTop implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 6799983693606904130L;
|
||||
private FilterValue filterValue;
|
||||
private ArrayList<SeriesTaskData> series;
|
||||
|
||||
public SeriesTaskDataTop() {
|
||||
super();
|
||||
}
|
||||
|
||||
public SeriesTaskDataTop(FilterValue filterValue,
|
||||
ArrayList<SeriesTaskData> series) {
|
||||
super();
|
||||
this.filterValue = filterValue;
|
||||
this.series = series;
|
||||
}
|
||||
|
||||
public FilterValue getFilterValue() {
|
||||
return filterValue;
|
||||
}
|
||||
|
||||
public void setFilterValue(FilterValue filterValue) {
|
||||
this.filterValue = filterValue;
|
||||
}
|
||||
|
||||
public ArrayList<SeriesTaskData> getSeries() {
|
||||
return series;
|
||||
}
|
||||
|
||||
public void setSeries(ArrayList<SeriesTaskData> series) {
|
||||
this.series = series;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesTaskDataTop [filterValue=" + filterValue + ", series="
|
||||
+ series + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.task;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class SeriesTaskDefinition implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 3736717661941074912L;
|
||||
protected ChartType chartType;
|
||||
|
||||
public SeriesTaskDefinition() {
|
||||
super();
|
||||
}
|
||||
|
||||
public ChartType getChartType() {
|
||||
return chartType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesTaskDefinition [chartType=" + chartType + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.task;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class SeriesTaskTop extends SeriesTaskDefinition {
|
||||
|
||||
private static final long serialVersionUID = 6805210072384752359L;
|
||||
private SeriesTaskDataTop seriesTaskDataTop;
|
||||
|
||||
public SeriesTaskTop() {
|
||||
super();
|
||||
this.chartType = ChartType.Top;
|
||||
}
|
||||
|
||||
public SeriesTaskTop(SeriesTaskDataTop seriesTaskDataTop) {
|
||||
super();
|
||||
this.seriesTaskDataTop = seriesTaskDataTop;
|
||||
}
|
||||
|
||||
public SeriesTaskDataTop getSeriesTaskDataTop() {
|
||||
return seriesTaskDataTop;
|
||||
}
|
||||
|
||||
public void setSeriesTaskDataTop(SeriesTaskDataTop seriesTaskDataTop) {
|
||||
this.seriesTaskDataTop = seriesTaskDataTop;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesTaskTop [seriesTaskDataTop=" + seriesTaskDataTop + "]";
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue