Refs #21354: Improve accounting manager portlet by new persistence
Updated portlet behavior
This commit is contained in:
parent
a36fef1aa9
commit
3ffb9f8523
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,24 +0,0 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.client.properties;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.GenresData;
|
||||
|
||||
import com.google.gwt.editor.client.Editor.Path;
|
||||
import com.sencha.gxt.data.shared.LabelProvider;
|
||||
import com.sencha.gxt.data.shared.ModelKeyProvider;
|
||||
import com.sencha.gxt.data.shared.PropertyAccess;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author giancarlo
|
||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public interface GenresDataPropertiesCombo extends
|
||||
PropertyAccess<GenresData> {
|
||||
|
||||
@Path("genre")
|
||||
ModelKeyProvider<GenresData> id();
|
||||
|
||||
LabelProvider<GenresData> label();
|
||||
|
||||
}
|
|
@ -1,126 +0,0 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.server.amservice.command;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.SortedMap;
|
||||
|
||||
import org.gcube.accounting.analytics.Filter;
|
||||
import org.gcube.accounting.analytics.Info;
|
||||
import org.gcube.accounting.analytics.persistence.AccountingPersistenceQuery;
|
||||
import org.gcube.accounting.analytics.persistence.AccountingPersistenceQueryFactory;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.query.AccountingQueryContext;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.response.SeriesResponse4JobContext;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.response.SeriesResponse4PortletContext;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.response.SeriesResponse4ServiceContext;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.response.SeriesResponse4StorageContext;
|
||||
import org.gcube.portlets.admin.accountingmanager.server.amservice.response.SeriesResponse4TaskContext;
|
||||
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.Context;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesResponse;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.ServiceException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class AccountingCommandContext implements AccountingCommand<SeriesResponse> {
|
||||
private static final Logger logger = LoggerFactory
|
||||
.getLogger(AccountingCommandContext.class);
|
||||
|
||||
private AccountingQueryContext accountingQueryContext;
|
||||
private AccountingType accountingType;
|
||||
|
||||
public AccountingCommandContext(AccountingQueryContext accountingQueryContext,
|
||||
AccountingType accountingType) {
|
||||
this.accountingQueryContext = accountingQueryContext;
|
||||
this.accountingType = accountingType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SeriesResponse execute() throws ServiceException {
|
||||
try {
|
||||
AccountingPersistenceQuery apq = AccountingPersistenceQueryFactory
|
||||
.getInstance();
|
||||
|
||||
logger.debug("Query Context: "
|
||||
+ accountingQueryContext.getContext());
|
||||
|
||||
SortedMap<Filter, SortedMap<Calendar, Info>> contextSM;
|
||||
|
||||
Context context=accountingQueryContext.getContext();
|
||||
|
||||
if(context==null){
|
||||
throw new ServiceException(
|
||||
"Error retrieving context param: null!");
|
||||
}
|
||||
|
||||
contextSM= apq.getContextTimeSeries(accountingQueryContext.getType(),
|
||||
accountingQueryContext.getTemporalConstraint(),
|
||||
accountingQueryContext.getFilters(),
|
||||
context.getContexts(),
|
||||
true);
|
||||
|
||||
|
||||
if (contextSM == null) {
|
||||
throw new ServiceException(
|
||||
"Error retrieving info for context: sorted map is null!");
|
||||
}
|
||||
|
||||
logger.debug("ContextSM: " + contextSM);
|
||||
|
||||
SeriesResponseBuilder seriesResponseBuilder = getSeriesResponseBuilder(
|
||||
accountingType, context, contextSM);
|
||||
|
||||
SeriesResponseDirector seriesResponseDirector = new SeriesResponseDirector();
|
||||
seriesResponseDirector
|
||||
.setSeriesResponseBuilder(seriesResponseBuilder);
|
||||
seriesResponseDirector.constructSeriesResponse();
|
||||
SeriesResponse seriesResponse = seriesResponseDirector
|
||||
.getSeriesResponse();
|
||||
|
||||
if (seriesResponse == null) {
|
||||
throw new ServiceException("Error creating series response!");
|
||||
}
|
||||
logger.debug("SeriesResponse Created: " + seriesResponse);
|
||||
return seriesResponse;
|
||||
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error in AccountingCommandTop(): "
|
||||
+ e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new ServiceException("No data available!");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private SeriesResponseBuilder getSeriesResponseBuilder(
|
||||
AccountingType accountingType, Context context,
|
||||
SortedMap<Filter, SortedMap<Calendar, Info>> contextSM)
|
||||
throws ServiceException {
|
||||
if (accountingType == null) {
|
||||
throw new ServiceException("Error accounting type is null");
|
||||
}
|
||||
|
||||
switch (accountingType) {
|
||||
case JOB:
|
||||
return new SeriesResponse4JobContext(context,contextSM);
|
||||
case PORTLET:
|
||||
return new SeriesResponse4PortletContext(context, contextSM);
|
||||
case SERVICE:
|
||||
return new SeriesResponse4ServiceContext(context, contextSM);
|
||||
case STORAGE:
|
||||
return new SeriesResponse4StorageContext(context, contextSM);
|
||||
case TASK:
|
||||
return new SeriesResponse4TaskContext(context, contextSM);
|
||||
default:
|
||||
throw new ServiceException("Error request type is unknow!");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
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.Context;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class AccountingQueryContext extends AccountingQuery {
|
||||
private Class<? extends AggregatedUsageRecord<?, ?>> type;
|
||||
private Context context;
|
||||
private TemporalConstraint temporalConstraint;
|
||||
private ArrayList<Filter> filters;
|
||||
|
||||
public AccountingQueryContext(Class<? extends AggregatedUsageRecord<?, ?>> type, Context context,
|
||||
TemporalConstraint temporalConstraint, ArrayList<Filter> filters) {
|
||||
super();
|
||||
chartType = ChartType.Context;
|
||||
this.type = type;
|
||||
this.temporalConstraint = temporalConstraint;
|
||||
this.filters = filters;
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
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 Context getContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public void setContext(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AccountingQueryContext [type=" + type + ", context=" + context + ", temporalConstraint="
|
||||
+ temporalConstraint + ", filters=" + filters + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,91 +0,0 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.server.amservice.response;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.SortedMap;
|
||||
|
||||
import org.gcube.accounting.analytics.Filter;
|
||||
import org.gcube.accounting.analytics.Info;
|
||||
import org.gcube.accounting.datamodel.aggregation.AggregatedServiceUsageRecord;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.Context;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesJob;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.job.SeriesJobContext;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.job.SeriesJobData;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.job.SeriesJobDataContext;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.ServiceException;
|
||||
import org.json.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Context Series Response 4 Job
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SeriesResponse4JobContext extends SeriesResponseBuilder {
|
||||
protected static Logger logger = LoggerFactory
|
||||
.getLogger(SeriesResponse4JobContext.class);
|
||||
private Context context;
|
||||
private SortedMap<Filter, SortedMap<Calendar, Info>> contextSM;
|
||||
|
||||
public SeriesResponse4JobContext(Context context,
|
||||
SortedMap<Filter, SortedMap<Calendar, Info>> contextSM) {
|
||||
this.context=context;
|
||||
this.contextSM = contextSM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildSeriesResponse() throws ServiceException {
|
||||
try {
|
||||
if (contextSM == null || contextSM.isEmpty()) {
|
||||
logger.error("Error creating series for job accounting: No data available!");
|
||||
throw new ServiceException("No data available!");
|
||||
}
|
||||
|
||||
ArrayList<SeriesJobDataContext> seriesJobDataContextList = new ArrayList<>();
|
||||
|
||||
for (Filter contextValue : contextSM.keySet()) {
|
||||
|
||||
ArrayList<SeriesJobData> series = new ArrayList<>();
|
||||
SortedMap<Calendar, Info> infos = contextSM.get(contextValue);
|
||||
for (Info info : infos.values()) {
|
||||
JSONObject jso = info.getValue();
|
||||
Long duration = jso
|
||||
.getLong(AggregatedServiceUsageRecord.DURATION);
|
||||
Long operationCount = jso
|
||||
.getLong(AggregatedServiceUsageRecord.OPERATION_COUNT);
|
||||
Long maxInvocationTime = jso
|
||||
.getLong(AggregatedServiceUsageRecord.MAX_INVOCATION_TIME);
|
||||
Long minInvocationTime = jso
|
||||
.getLong(AggregatedServiceUsageRecord.MIN_INVOCATION_TIME);
|
||||
|
||||
series.add(new SeriesJobData(info.getCalendar().getTime(),
|
||||
operationCount, duration, maxInvocationTime,
|
||||
minInvocationTime));
|
||||
|
||||
}
|
||||
SeriesJobDataContext seriesJobDataContext = new SeriesJobDataContext(
|
||||
contextValue.getValue(), series);
|
||||
seriesJobDataContextList.add(seriesJobDataContext);
|
||||
|
||||
}
|
||||
|
||||
SeriesJobContext seriesJobContext = new SeriesJobContext(context,
|
||||
seriesJobDataContextList);
|
||||
SeriesJob seriesService = new SeriesJob(seriesJobContext);
|
||||
|
||||
seriesResponseSpec.setSr(seriesService);
|
||||
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error creating series for job accounting context chart: "
|
||||
+ e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new ServiceException(
|
||||
"Error creating series for job accounting context chart: "
|
||||
+ e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,89 +0,0 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.server.amservice.response;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.SortedMap;
|
||||
|
||||
import org.gcube.accounting.analytics.Filter;
|
||||
import org.gcube.accounting.analytics.Info;
|
||||
import org.gcube.accounting.datamodel.aggregation.AggregatedPortletUsageRecord;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.Context;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesPortlet;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.portlet.SeriesPortletContext;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.portlet.SeriesPortletData;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.portlet.SeriesPortletDataContext;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.ServiceException;
|
||||
import org.json.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Context Series Response 4 Portlet
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SeriesResponse4PortletContext extends SeriesResponseBuilder {
|
||||
protected static Logger logger = LoggerFactory
|
||||
.getLogger(SeriesResponse4PortletContext.class);
|
||||
private Context context;
|
||||
private SortedMap<Filter, SortedMap<Calendar, Info>> contextSM;
|
||||
|
||||
public SeriesResponse4PortletContext(Context context,
|
||||
SortedMap<Filter, SortedMap<Calendar, Info>> contextSM) {
|
||||
this.context = context;
|
||||
this.contextSM = contextSM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildSeriesResponse() throws ServiceException {
|
||||
try {
|
||||
if (contextSM == null || contextSM.isEmpty()) {
|
||||
logger.error("Error creating series for portlet accounting: No data available!");
|
||||
throw new ServiceException("No data available!");
|
||||
}
|
||||
|
||||
ArrayList<SeriesPortletDataContext> seriesPortletDataContextList = new ArrayList<>();
|
||||
|
||||
for (Filter contextValue : contextSM.keySet()) {
|
||||
|
||||
ArrayList<SeriesPortletData> series = new ArrayList<>();
|
||||
SortedMap<Calendar, Info> infos = contextSM.get(contextValue);
|
||||
for (Info info : infos.values()) {
|
||||
JSONObject jso = info.getValue();
|
||||
// Long duration =
|
||||
// jso.getLong(AggregatedPortletUsageRecord.DURATION);
|
||||
Long operationCount = jso
|
||||
.getLong(AggregatedPortletUsageRecord.OPERATION_COUNT);
|
||||
// Long maxInvocationTime =
|
||||
// jso.getLong(AggregatedPortletUsageRecord.MAX_INVOCATION_TIME);
|
||||
// Long minInvocationTime =
|
||||
// jso.getLong(AggregatedPortletUsageRecord.MIN_INVOCATION_TIME);
|
||||
|
||||
series.add(new SeriesPortletData(info.getCalendar()
|
||||
.getTime(), operationCount));
|
||||
}
|
||||
SeriesPortletDataContext seriesPortletDataContext = new SeriesPortletDataContext(
|
||||
contextValue.getValue(), series);
|
||||
seriesPortletDataContextList.add(seriesPortletDataContext);
|
||||
|
||||
}
|
||||
|
||||
SeriesPortletContext seriesPortletContext = new SeriesPortletContext(
|
||||
context, seriesPortletDataContextList);
|
||||
SeriesPortlet seriesPortlet = new SeriesPortlet(
|
||||
seriesPortletContext);
|
||||
|
||||
seriesResponseSpec.setSr(seriesPortlet);
|
||||
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error creating series for portlet accounting context chart: "
|
||||
+ e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new ServiceException(
|
||||
"Error creating series for portlet accounting context chart: "
|
||||
+ e.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,92 +0,0 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.server.amservice.response;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.SortedMap;
|
||||
|
||||
import org.gcube.accounting.analytics.Filter;
|
||||
import org.gcube.accounting.analytics.Info;
|
||||
import org.gcube.accounting.datamodel.aggregation.AggregatedServiceUsageRecord;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.Context;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesService;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.service.SeriesServiceContext;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.service.SeriesServiceData;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.service.SeriesServiceDataContext;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.ServiceException;
|
||||
import org.json.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Context Series Response 4 Service
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SeriesResponse4ServiceContext extends SeriesResponseBuilder {
|
||||
protected static Logger logger = LoggerFactory
|
||||
.getLogger(SeriesResponse4ServiceContext.class);
|
||||
private Context context;
|
||||
private SortedMap<Filter, SortedMap<Calendar, Info>> contextSM;
|
||||
|
||||
public SeriesResponse4ServiceContext(Context context,
|
||||
SortedMap<Filter, SortedMap<Calendar, Info>> contextSM) {
|
||||
this.context = context;
|
||||
this.contextSM = contextSM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildSeriesResponse() throws ServiceException {
|
||||
try {
|
||||
if (contextSM == null || contextSM.isEmpty()) {
|
||||
logger.error("Error creating series for service accounting: No data available!");
|
||||
throw new ServiceException("No data available!");
|
||||
}
|
||||
|
||||
ArrayList<SeriesServiceDataContext> seriesServiceDataContextList = new ArrayList<>();
|
||||
|
||||
for (Filter contextValue : contextSM.keySet()) {
|
||||
|
||||
ArrayList<SeriesServiceData> series = new ArrayList<>();
|
||||
SortedMap<Calendar, Info> infos = contextSM.get(contextValue);
|
||||
for (Info info : infos.values()) {
|
||||
JSONObject jso = info.getValue();
|
||||
Long duration = jso
|
||||
.getLong(AggregatedServiceUsageRecord.DURATION);
|
||||
Long operationCount = jso
|
||||
.getLong(AggregatedServiceUsageRecord.OPERATION_COUNT);
|
||||
Long maxInvocationTime = jso
|
||||
.getLong(AggregatedServiceUsageRecord.MAX_INVOCATION_TIME);
|
||||
Long minInvocationTime = jso
|
||||
.getLong(AggregatedServiceUsageRecord.MIN_INVOCATION_TIME);
|
||||
|
||||
series.add(new SeriesServiceData(info.getCalendar()
|
||||
.getTime(), operationCount, duration,
|
||||
maxInvocationTime, minInvocationTime));
|
||||
|
||||
}
|
||||
SeriesServiceDataContext seriesServiceDataContext = new SeriesServiceDataContext(
|
||||
contextValue.getValue(), series);
|
||||
seriesServiceDataContextList.add(seriesServiceDataContext);
|
||||
|
||||
}
|
||||
|
||||
SeriesServiceContext seriesServiceContext = new SeriesServiceContext(context,
|
||||
seriesServiceDataContextList);
|
||||
SeriesService seriesService = new SeriesService(
|
||||
seriesServiceContext);
|
||||
|
||||
seriesResponseSpec.setSr(seriesService);
|
||||
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error creating series for service accounting context chart: "
|
||||
+ e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new ServiceException(
|
||||
"Error creating series for service accounting context chart: "
|
||||
+ e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,85 +0,0 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.server.amservice.response;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.SortedMap;
|
||||
|
||||
import org.gcube.accounting.analytics.Filter;
|
||||
import org.gcube.accounting.analytics.Info;
|
||||
import org.gcube.accounting.datamodel.aggregation.AggregatedStorageUsageRecord;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.Context;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesStorage;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.storage.SeriesStorageContext;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.storage.SeriesStorageData;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.storage.SeriesStorageDataContext;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.ServiceException;
|
||||
import org.json.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Context Series Response 4 Storage
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SeriesResponse4StorageContext extends SeriesResponseBuilder {
|
||||
protected static Logger logger = LoggerFactory
|
||||
.getLogger(SeriesResponse4StorageContext.class);
|
||||
private Context context;
|
||||
private SortedMap<Filter, SortedMap<Calendar, Info>> contextSM;
|
||||
|
||||
public SeriesResponse4StorageContext(Context context,
|
||||
SortedMap<Filter, SortedMap<Calendar, Info>> contextSM) {
|
||||
this.context = context;
|
||||
this.contextSM = contextSM;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildSeriesResponse() throws ServiceException {
|
||||
try {
|
||||
if (contextSM == null || contextSM.isEmpty()) {
|
||||
logger.error("Error creating series for storage accounting: No data available!");
|
||||
throw new ServiceException("No data available!");
|
||||
}
|
||||
|
||||
ArrayList<SeriesStorageDataContext> seriesStorageDataContextList = new ArrayList<>();
|
||||
|
||||
for (Filter contextValue : contextSM.keySet()) {
|
||||
|
||||
ArrayList<SeriesStorageData> series = new ArrayList<>();
|
||||
SortedMap<Calendar, Info> infos = contextSM.get(contextValue);
|
||||
for (Info info : infos.values()) {
|
||||
JSONObject jso = info.getValue();
|
||||
Long dataVolume = jso
|
||||
.getLong(AggregatedStorageUsageRecord.DATA_VOLUME);
|
||||
Long operationCount = jso
|
||||
.getLong(AggregatedStorageUsageRecord.OPERATION_COUNT);
|
||||
series.add(new SeriesStorageData(info.getCalendar()
|
||||
.getTime(), dataVolume, operationCount));
|
||||
|
||||
}
|
||||
SeriesStorageDataContext seriesStorageDataContext = new SeriesStorageDataContext(
|
||||
contextValue.getValue(), series);
|
||||
seriesStorageDataContextList.add(seriesStorageDataContext);
|
||||
|
||||
}
|
||||
|
||||
SeriesStorageContext seriesStorageContext = new SeriesStorageContext(
|
||||
context, seriesStorageDataContextList);
|
||||
SeriesStorage seriesStorage = new SeriesStorage(
|
||||
seriesStorageContext);
|
||||
|
||||
seriesResponseSpec.setSr(seriesStorage);
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error creating series for storage accounting context chart: "
|
||||
+ e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new ServiceException(
|
||||
"Error creating series for storage accounting context chart: "
|
||||
+ e.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,89 +0,0 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.server.amservice.response;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.SortedMap;
|
||||
|
||||
import org.gcube.accounting.analytics.Filter;
|
||||
import org.gcube.accounting.analytics.Info;
|
||||
//import org.gcube.accounting.datamodel.aggregation.AggregatedTaskUsageRecord;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.Context;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.SeriesTask;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.task.SeriesTaskContext;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.task.SeriesTaskData;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.response.task.SeriesTaskDataContext;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.exception.ServiceException;
|
||||
import org.json.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Context Series Response 4 Task
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SeriesResponse4TaskContext extends SeriesResponseBuilder {
|
||||
protected static Logger logger = LoggerFactory
|
||||
.getLogger(SeriesResponse4TaskContext.class);
|
||||
private Context context;
|
||||
private SortedMap<Filter, SortedMap<Calendar, Info>> contextSM;
|
||||
|
||||
public SeriesResponse4TaskContext(Context context,
|
||||
SortedMap<Filter, SortedMap<Calendar, Info>> contextSM) {
|
||||
this.context = context;
|
||||
this.contextSM = contextSM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildSeriesResponse() throws ServiceException {
|
||||
try {
|
||||
if (contextSM == null || contextSM.isEmpty()) {
|
||||
logger.error("Error creating series for task accounting: No data available!");
|
||||
throw new ServiceException("No data available!");
|
||||
}
|
||||
|
||||
ArrayList<SeriesTaskDataContext> seriesTaskDataContextList = new ArrayList<>();
|
||||
|
||||
for (Filter contextValue : contextSM.keySet()) {
|
||||
|
||||
ArrayList<SeriesTaskData> series = new ArrayList<>();
|
||||
SortedMap<Calendar, Info> infos = contextSM.get(contextValue);
|
||||
for (Info info : infos.values()) {
|
||||
@SuppressWarnings("unused")
|
||||
JSONObject jso = info.getValue();
|
||||
// Long duration =
|
||||
// jso.getLong(AggregatedTaskUsageRecord.DURATION);
|
||||
//Long operationCount = jso
|
||||
// .getLong(AggregatedTaskUsageRecord.OPERATION_COUNT);
|
||||
// Long maxInvocationTime =
|
||||
// jso.getLong(AggregatedTaskUsageRecord.MAX_INVOCATION_TIME);
|
||||
// Long minInvocationTime =
|
||||
// jso.getLong(AggregatedTaskUsageRecord.MIN_INVOCATION_TIME);
|
||||
|
||||
//series.add(new SeriesTaskData(info.getCalendar().getTime(),
|
||||
// operationCount));
|
||||
}
|
||||
SeriesTaskDataContext seriesTaskDataContext = new SeriesTaskDataContext(
|
||||
contextValue.getValue(), series);
|
||||
seriesTaskDataContextList.add(seriesTaskDataContext);
|
||||
|
||||
}
|
||||
|
||||
SeriesTaskContext seriesTaskContext = new SeriesTaskContext(
|
||||
context, seriesTaskDataContextList);
|
||||
SeriesTask seriesTask = new SeriesTask(seriesTaskContext);
|
||||
|
||||
seriesResponseSpec.setSr(seriesTask);
|
||||
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error creating series for portlet accounting context chart: "
|
||||
+ e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new ServiceException(
|
||||
"Error creating series for portlet accounting context chart: "
|
||||
+ e.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class AccountingFilterContext extends AccountingFilterDefinition
|
||||
implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -6805006183397381154L;
|
||||
private Context context;
|
||||
private ArrayList<AccountingFilter> filters;
|
||||
|
||||
public AccountingFilterContext() {
|
||||
super();
|
||||
this.chartType = ChartType.Context;
|
||||
context = null;
|
||||
filters = null;
|
||||
|
||||
}
|
||||
|
||||
public AccountingFilterContext(Context context,
|
||||
ArrayList<AccountingFilter> filters) {
|
||||
super();
|
||||
chartType = ChartType.Context;
|
||||
this.context = context;
|
||||
this.filters = filters;
|
||||
|
||||
}
|
||||
|
||||
public Context getContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public void setContext(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public ArrayList<AccountingFilter> getFilters() {
|
||||
return filters;
|
||||
}
|
||||
|
||||
public void setFilters(ArrayList<AccountingFilter> filters) {
|
||||
this.filters = filters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AccountingFilterContext [context=" + context + ", filters="
|
||||
+ filters + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,46 +0,0 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class GenresData implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 719740085818609829L;
|
||||
private String genre;
|
||||
|
||||
public GenresData() {
|
||||
super();
|
||||
}
|
||||
|
||||
public GenresData(String genre) {
|
||||
super();
|
||||
this.genre = genre;
|
||||
}
|
||||
|
||||
public String getGenre() {
|
||||
return genre;
|
||||
}
|
||||
|
||||
public void setGenre(String genre) {
|
||||
this.genre = genre;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return genre;
|
||||
}
|
||||
|
||||
public void setLabel(String genre) {
|
||||
this.genre = genre;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "GenresData [genre=" + genre + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class Genres implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -1704075020370137961L;
|
||||
private ArrayList<String> genresList;
|
||||
|
||||
public Genres() {
|
||||
super();
|
||||
}
|
||||
|
||||
public Genres(ArrayList<String> genresList) {
|
||||
super();
|
||||
this.genresList = genresList;
|
||||
}
|
||||
|
||||
public ArrayList<String> getGenresList() {
|
||||
return genresList;
|
||||
}
|
||||
|
||||
public void setGenresList(ArrayList<String> genresList) {
|
||||
this.genresList = genresList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Genres [genresList=" + genresList + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.job;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.Context;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SeriesJobContext extends SeriesJobDefinition {
|
||||
|
||||
private static final long serialVersionUID = -2350334263342186590L;
|
||||
private Context context;
|
||||
private ArrayList<SeriesJobDataContext> seriesJobDataContextList;
|
||||
|
||||
public SeriesJobContext() {
|
||||
super();
|
||||
this.chartType = ChartType.Context;
|
||||
}
|
||||
|
||||
public SeriesJobContext(Context context,
|
||||
ArrayList<SeriesJobDataContext> seriesJobDataContextList) {
|
||||
super();
|
||||
this.chartType = ChartType.Context;
|
||||
this.context = context;
|
||||
this.seriesJobDataContextList = seriesJobDataContextList;
|
||||
}
|
||||
|
||||
public Context getContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public void setContext(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public ArrayList<SeriesJobDataContext> getSeriesJobDataContextList() {
|
||||
return seriesJobDataContextList;
|
||||
}
|
||||
|
||||
public void setSeriesJobDataContextList(
|
||||
ArrayList<SeriesJobDataContext> seriesJobDataContextList) {
|
||||
this.seriesJobDataContextList = seriesJobDataContextList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesJobContext [context=" + context
|
||||
+ ", seriesJobDataContextList=" + seriesJobDataContextList
|
||||
+ "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.job;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SeriesJobDataContext implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 6043106605633429465L;
|
||||
private String context;
|
||||
private ArrayList<SeriesJobData> series;
|
||||
|
||||
public SeriesJobDataContext() {
|
||||
super();
|
||||
}
|
||||
|
||||
public SeriesJobDataContext(String context, ArrayList<SeriesJobData> series) {
|
||||
super();
|
||||
this.context = context;
|
||||
this.series = series;
|
||||
}
|
||||
|
||||
public String getContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public void setContext(String context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public ArrayList<SeriesJobData> getSeries() {
|
||||
return series;
|
||||
}
|
||||
|
||||
public void setSeries(ArrayList<SeriesJobData> series) {
|
||||
this.series = series;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesJobDataContext [context=" + context + ", series="
|
||||
+ series + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.portlet;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.Context;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SeriesPortletContext extends SeriesPortletDefinition {
|
||||
|
||||
private static final long serialVersionUID = -2350334263342186590L;
|
||||
private Context context;
|
||||
private ArrayList<SeriesPortletDataContext> seriesPortletDataContextList;
|
||||
|
||||
public SeriesPortletContext() {
|
||||
super();
|
||||
this.chartType = ChartType.Context;
|
||||
}
|
||||
|
||||
public SeriesPortletContext(Context context,
|
||||
ArrayList<SeriesPortletDataContext> seriesPortletDataContextList) {
|
||||
super();
|
||||
this.chartType = ChartType.Context;
|
||||
this.context = context;
|
||||
this.seriesPortletDataContextList = seriesPortletDataContextList;
|
||||
}
|
||||
|
||||
public Context getContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public void setContext(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public ArrayList<SeriesPortletDataContext> getSeriesPortletDataContextList() {
|
||||
return seriesPortletDataContextList;
|
||||
}
|
||||
|
||||
public void setSeriesPortletDataContextList(
|
||||
ArrayList<SeriesPortletDataContext> seriesPortletDataContextList) {
|
||||
this.seriesPortletDataContextList = seriesPortletDataContextList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesPortletContext [context=" + context
|
||||
+ ", seriesPortletDataContextList="
|
||||
+ seriesPortletDataContextList + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.portlet;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SeriesPortletDataContext implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 6043106605633429465L;
|
||||
private String context;
|
||||
private ArrayList<SeriesPortletData> series;
|
||||
|
||||
public SeriesPortletDataContext() {
|
||||
super();
|
||||
}
|
||||
|
||||
public SeriesPortletDataContext(String context,
|
||||
ArrayList<SeriesPortletData> series) {
|
||||
super();
|
||||
this.context = context;
|
||||
this.series = series;
|
||||
}
|
||||
|
||||
public String getContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public void setContext(String context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public ArrayList<SeriesPortletData> getSeries() {
|
||||
return series;
|
||||
}
|
||||
|
||||
public void setSeries(ArrayList<SeriesPortletData> series) {
|
||||
this.series = series;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesPortletDataContext [context=" + context + ", series="
|
||||
+ series + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.Context;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SeriesServiceContext extends SeriesServiceDefinition {
|
||||
|
||||
private static final long serialVersionUID = -2350334263342186590L;
|
||||
private Context context;
|
||||
private ArrayList<SeriesServiceDataContext> seriesServiceDataContextList;
|
||||
|
||||
public SeriesServiceContext() {
|
||||
super();
|
||||
this.chartType = ChartType.Context;
|
||||
|
||||
}
|
||||
|
||||
public SeriesServiceContext(Context context,
|
||||
ArrayList<SeriesServiceDataContext> seriesServiceDataContextList) {
|
||||
super();
|
||||
this.chartType = ChartType.Context;
|
||||
this.context = context;
|
||||
this.seriesServiceDataContextList = seriesServiceDataContextList;
|
||||
}
|
||||
|
||||
public Context getContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public void setContext(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public ArrayList<SeriesServiceDataContext> getSeriesServiceDataContextList() {
|
||||
return seriesServiceDataContextList;
|
||||
}
|
||||
|
||||
public void setSeriesServiceDataContextList(
|
||||
ArrayList<SeriesServiceDataContext> seriesServiceDataContextList) {
|
||||
this.seriesServiceDataContextList = seriesServiceDataContextList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesServiceContext [context=" + context
|
||||
+ ", seriesServiceDataContextList="
|
||||
+ seriesServiceDataContextList + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.service;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SeriesServiceDataContext implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 6043106605633429465L;
|
||||
private String context;
|
||||
private ArrayList<SeriesServiceData> series;
|
||||
|
||||
public SeriesServiceDataContext() {
|
||||
super();
|
||||
}
|
||||
|
||||
public SeriesServiceDataContext(String context,
|
||||
ArrayList<SeriesServiceData> series) {
|
||||
super();
|
||||
this.context = context;
|
||||
this.series = series;
|
||||
}
|
||||
|
||||
public String getContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public void setContext(String context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public ArrayList<SeriesServiceData> getSeries() {
|
||||
return series;
|
||||
}
|
||||
|
||||
public void setSeries(ArrayList<SeriesServiceData> series) {
|
||||
this.series = series;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesServiceDataContext [context=" + context + ", series="
|
||||
+ series + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,59 +0,0 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.storage;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.Context;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SeriesStorageContext extends SeriesStorageDefinition {
|
||||
|
||||
private static final long serialVersionUID = -5477545972037227361L;
|
||||
private Context context;
|
||||
private ArrayList<SeriesStorageDataContext> seriesStorageDataContextList;
|
||||
|
||||
public SeriesStorageContext() {
|
||||
super();
|
||||
this.chartType = ChartType.Context;
|
||||
|
||||
}
|
||||
|
||||
public SeriesStorageContext(Context context,
|
||||
ArrayList<SeriesStorageDataContext> seriesStorageDataContextList) {
|
||||
super();
|
||||
this.chartType = ChartType.Context;
|
||||
this.context=context;
|
||||
this.seriesStorageDataContextList = seriesStorageDataContextList;
|
||||
}
|
||||
|
||||
public Context getContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public void setContext(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public ArrayList<SeriesStorageDataContext> getSeriesStorageDataContextList() {
|
||||
return seriesStorageDataContextList;
|
||||
}
|
||||
|
||||
public void setSeriesStorageDataContextList(
|
||||
ArrayList<SeriesStorageDataContext> seriesStorageDataContextList) {
|
||||
this.seriesStorageDataContextList = seriesStorageDataContextList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesStorageContext [context=" + context
|
||||
+ ", seriesStorageDataContextList="
|
||||
+ seriesStorageDataContextList + "]";
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.storage;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SeriesStorageDataContext implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -627227653308818605L;
|
||||
private String context;
|
||||
private ArrayList<SeriesStorageData> series;
|
||||
|
||||
public SeriesStorageDataContext() {
|
||||
super();
|
||||
}
|
||||
|
||||
public SeriesStorageDataContext(String context,
|
||||
ArrayList<SeriesStorageData> series) {
|
||||
super();
|
||||
this.context = context;
|
||||
this.series = series;
|
||||
}
|
||||
|
||||
public String getContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public void setContext(String context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public ArrayList<SeriesStorageData> getSeries() {
|
||||
return series;
|
||||
}
|
||||
|
||||
public void setSeries(ArrayList<SeriesStorageData> series) {
|
||||
this.series = series;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesStorageDataContext [context=" + context + ", series="
|
||||
+ series + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.task;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.ChartType;
|
||||
import org.gcube.portlets.admin.accountingmanager.shared.data.Context;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SeriesTaskContext extends SeriesTaskDefinition {
|
||||
|
||||
private static final long serialVersionUID = 6805210072384752359L;
|
||||
private Context context;
|
||||
private ArrayList<SeriesTaskDataContext> seriesTaskDataContextList;
|
||||
|
||||
public SeriesTaskContext() {
|
||||
super();
|
||||
this.chartType = ChartType.Context;
|
||||
|
||||
}
|
||||
|
||||
public SeriesTaskContext(Context context,
|
||||
ArrayList<SeriesTaskDataContext> seriesTaskDataTopList) {
|
||||
super();
|
||||
this.chartType = ChartType.Context;
|
||||
this.context = context;
|
||||
this.seriesTaskDataContextList = seriesTaskDataTopList;
|
||||
}
|
||||
|
||||
public Context getContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public void setContext(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public ArrayList<SeriesTaskDataContext> getSeriesTaskDataContextList() {
|
||||
return seriesTaskDataContextList;
|
||||
}
|
||||
|
||||
public void setSeriesTaskDataContextList(
|
||||
ArrayList<SeriesTaskDataContext> seriesTaskDataContextList) {
|
||||
this.seriesTaskDataContextList = seriesTaskDataContextList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesTaskContext [context=" + context
|
||||
+ ", seriesTaskDataContextList=" + seriesTaskDataContextList
|
||||
+ "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
package org.gcube.portlets.admin.accountingmanager.shared.data.response.task;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SeriesTaskDataContext implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 6799983693606904130L;
|
||||
private String context;
|
||||
private ArrayList<SeriesTaskData> series;
|
||||
|
||||
public SeriesTaskDataContext() {
|
||||
super();
|
||||
}
|
||||
|
||||
public SeriesTaskDataContext(String context,
|
||||
ArrayList<SeriesTaskData> series) {
|
||||
super();
|
||||
this.context = context;
|
||||
this.series = series;
|
||||
}
|
||||
|
||||
public String getContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public void setContext(String context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public ArrayList<SeriesTaskData> getSeries() {
|
||||
return series;
|
||||
}
|
||||
|
||||
public void setSeries(ArrayList<SeriesTaskData> series) {
|
||||
this.series = series;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SeriesTaskDataContext [context=" + context + ", series="
|
||||
+ series + "]";
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue