diff --git a/src/main/java/org/gcube/accounting/datamodel/aggregation/AggregatedJobUsageRecord.java b/src/main/java/org/gcube/accounting/datamodel/aggregation/AggregatedJobUsageRecord.java index d3421ee..7b6990e 100644 --- a/src/main/java/org/gcube/accounting/datamodel/aggregation/AggregatedJobUsageRecord.java +++ b/src/main/java/org/gcube/accounting/datamodel/aggregation/AggregatedJobUsageRecord.java @@ -93,13 +93,13 @@ public class AggregatedJobUsageRecord extends AbstractJobUsageRecord implements public AggregatedJobUsageRecord aggregate(AggregatedJobUsageRecord record) throws NotAggregatableRecordsExceptions { try { - /* + /* TODO AggregationUtility aggregationUtility = new AggregationUtility(this); aggregationUtility.aggregate(record); - */ - // TODO - }catch(Exception e){ - throw new UnsupportedOperationException(e); + } catch(NotAggregatableRecordsExceptions e){ + throw e; */ + } catch(Exception ex){ + throw new NotAggregatableRecordsExceptions(ex); } //return this; @@ -114,8 +114,10 @@ public class AggregatedJobUsageRecord extends AbstractJobUsageRecord implements throws NotAggregatableRecordsExceptions { try { return aggregate(new AggregatedJobUsageRecord(record)); - } catch (InvalidValueException e) { - throw new NotAggregatableRecordsExceptions(e.getCause()); + } catch(NotAggregatableRecordsExceptions e){ + throw e; + } catch(Exception ex){ + throw new NotAggregatableRecordsExceptions(ex); } } @@ -136,8 +138,10 @@ public class AggregatedJobUsageRecord extends AbstractJobUsageRecord implements public boolean isAggregable(JobUsageRecord record) throws NotAggregatableRecordsExceptions { try { return isAggregable(new AggregatedJobUsageRecord(record)); - } catch (InvalidValueException e) { - throw new NotAggregatableRecordsExceptions(e.getCause()); + } catch(NotAggregatableRecordsExceptions e){ + throw e; + } catch(Exception ex){ + throw new NotAggregatableRecordsExceptions(ex); } } diff --git a/src/main/java/org/gcube/accounting/datamodel/aggregation/AggregatedPortletUsageRecord.java b/src/main/java/org/gcube/accounting/datamodel/aggregation/AggregatedPortletUsageRecord.java index 99b8953..bfbe67d 100644 --- a/src/main/java/org/gcube/accounting/datamodel/aggregation/AggregatedPortletUsageRecord.java +++ b/src/main/java/org/gcube/accounting/datamodel/aggregation/AggregatedPortletUsageRecord.java @@ -95,13 +95,13 @@ public class AggregatedPortletUsageRecord extends AbstractPortletUsageRecord imp AggregatedPortletUsageRecord record) throws NotAggregatableRecordsExceptions { try { - /* + /* TODO AggregationUtility aggregationUtility = new AggregationUtility(this); aggregationUtility.aggregate(record); - */ - // TODO - }catch(Exception e){ - throw new UnsupportedOperationException(e); + } catch(NotAggregatableRecordsExceptions e){ + throw e; */ + } catch(Exception ex){ + throw new NotAggregatableRecordsExceptions(ex); } //return this; diff --git a/src/main/java/org/gcube/accounting/datamodel/aggregation/AggregatedServiceUsageRecord.java b/src/main/java/org/gcube/accounting/datamodel/aggregation/AggregatedServiceUsageRecord.java index a8a3bf5..a76ce2b 100644 --- a/src/main/java/org/gcube/accounting/datamodel/aggregation/AggregatedServiceUsageRecord.java +++ b/src/main/java/org/gcube/accounting/datamodel/aggregation/AggregatedServiceUsageRecord.java @@ -171,8 +171,10 @@ public class AggregatedServiceUsageRecord extends AbstractServiceUsageRecord imp throws NotAggregatableRecordsExceptions { try { return aggregate(new AggregatedServiceUsageRecord(record)); - } catch (InvalidValueException e) { - throw new NotAggregatableRecordsExceptions(e.getCause()); + } catch(NotAggregatableRecordsExceptions e){ + throw e; + } catch(Exception ex){ + throw new NotAggregatableRecordsExceptions(ex); } } @@ -194,8 +196,10 @@ public class AggregatedServiceUsageRecord extends AbstractServiceUsageRecord imp throws NotAggregatableRecordsExceptions { try { return isAggregable(new AggregatedServiceUsageRecord(record)); - } catch (InvalidValueException e) { - throw new NotAggregatableRecordsExceptions(e.getCause()); + } catch(NotAggregatableRecordsExceptions e){ + throw e; + } catch(Exception ex){ + throw new NotAggregatableRecordsExceptions(ex); } } diff --git a/src/main/java/org/gcube/accounting/datamodel/aggregation/AggregatedStorageUsageRecord.java b/src/main/java/org/gcube/accounting/datamodel/aggregation/AggregatedStorageUsageRecord.java index 737c2f5..f10561c 100644 --- a/src/main/java/org/gcube/accounting/datamodel/aggregation/AggregatedStorageUsageRecord.java +++ b/src/main/java/org/gcube/accounting/datamodel/aggregation/AggregatedStorageUsageRecord.java @@ -109,8 +109,10 @@ public class AggregatedStorageUsageRecord extends AbstractStorageUsageRecord imp AggregationUtility aggregationUtility = new AggregationUtility(this); aggregationUtility.aggregate(record); this.setDataVolume(this.getDataVolume() + record.getDataVolume()); - }catch(Exception e){ - throw new UnsupportedOperationException(e); + }catch(NotAggregatableRecordsExceptions e){ + throw e; + } catch(Exception ex){ + throw new NotAggregatableRecordsExceptions(ex); } return this; } @@ -123,8 +125,10 @@ public class AggregatedStorageUsageRecord extends AbstractStorageUsageRecord imp throws NotAggregatableRecordsExceptions { try { return aggregate(new AggregatedStorageUsageRecord(record)); - } catch (InvalidValueException e) { - throw new NotAggregatableRecordsExceptions(e.getCause()); + } catch(NotAggregatableRecordsExceptions e){ + throw e; + } catch(Exception ex){ + throw new NotAggregatableRecordsExceptions(ex); } } @@ -146,8 +150,10 @@ public class AggregatedStorageUsageRecord extends AbstractStorageUsageRecord imp throws NotAggregatableRecordsExceptions { try { return isAggregable(new AggregatedStorageUsageRecord(record)); - } catch (InvalidValueException e) { - throw new NotAggregatableRecordsExceptions(e.getCause()); + } catch(NotAggregatableRecordsExceptions e){ + throw e; + } catch(Exception ex){ + throw new NotAggregatableRecordsExceptions(ex); } } diff --git a/src/main/java/org/gcube/accounting/datamodel/aggregation/AggregatedTaskUsageRecord.java b/src/main/java/org/gcube/accounting/datamodel/aggregation/AggregatedTaskUsageRecord.java index 30c9ddd..ed1a8d2 100644 --- a/src/main/java/org/gcube/accounting/datamodel/aggregation/AggregatedTaskUsageRecord.java +++ b/src/main/java/org/gcube/accounting/datamodel/aggregation/AggregatedTaskUsageRecord.java @@ -94,13 +94,13 @@ public class AggregatedTaskUsageRecord extends AbstractTaskUsageRecord implement public AggregatedTaskUsageRecord aggregate(AggregatedTaskUsageRecord record) throws NotAggregatableRecordsExceptions { try { - /* + /* TODO AggregationUtility aggregationUtility = new AggregationUtility(this); aggregationUtility.aggregate(record); - */ - // TODO - }catch(Exception e){ - throw new UnsupportedOperationException(e); + } catch(NotAggregatableRecordsExceptions e){ + throw e; */ + } catch(Exception ex){ + throw new NotAggregatableRecordsExceptions(ex); } //return this; @@ -115,8 +115,10 @@ public class AggregatedTaskUsageRecord extends AbstractTaskUsageRecord implement throws NotAggregatableRecordsExceptions { try { return aggregate(new AggregatedTaskUsageRecord(record)); - } catch (InvalidValueException e) { - throw new NotAggregatableRecordsExceptions(e.getCause()); + } catch(NotAggregatableRecordsExceptions e){ + throw e; + } catch(Exception ex){ + throw new NotAggregatableRecordsExceptions(ex); } } @@ -136,8 +138,10 @@ public class AggregatedTaskUsageRecord extends AbstractTaskUsageRecord implement public boolean isAggregable(TaskUsageRecord record) throws NotAggregatableRecordsExceptions { try { return isAggregable(new AggregatedTaskUsageRecord(record)); - } catch (InvalidValueException e) { - throw new NotAggregatableRecordsExceptions(e.getCause()); + } catch(NotAggregatableRecordsExceptions e){ + throw e; + } catch(Exception ex){ + throw new NotAggregatableRecordsExceptions(ex); } }