Base class to treat time bounded items uniformly
authorGeorgios Gousios <gousiosg@gmail.com>
Tue, 29 Nov 2011 09:00:21 +0000 (11:00 +0200)
committerGeorgios Gousios <gousiosg@gmail.com>
Tue, 29 Nov 2011 09:00:21 +0000 (11:00 +0200)
logic/src/main/scala/gr/grnet/aquarium/logic/accounting/dsl/DSLAlgorithm.scala
logic/src/main/scala/gr/grnet/aquarium/logic/accounting/dsl/DSLPriceList.scala
logic/src/main/scala/gr/grnet/aquarium/logic/accounting/dsl/DSLTimeBoundedItem.scala [new file with mode: 0644]
logic/src/main/scala/gr/grnet/aquarium/logic/accounting/dsl/DSLUtils.scala

index 6b96603..03ed360 100644 (file)
@@ -46,4 +46,4 @@ case class DSLAlgorithm (
   overrides: Option[DSLAlgorithm],
   algorithms: Map[DSLResource, String],
   effective: DSLTimeFrame
-)
\ No newline at end of file
+) extends DSLTimeBoundedItem(effective)
index 9f3a62b..ad769e8 100644 (file)
@@ -45,4 +45,4 @@ case class DSLPriceList (
   overrides: Option[DSLPriceList],
   prices: Map[DSLResource,  Float],
   effective: DSLTimeFrame
-)
\ No newline at end of file
+) extends DSLTimeBoundedItem(effective)
\ No newline at end of file
diff --git a/logic/src/main/scala/gr/grnet/aquarium/logic/accounting/dsl/DSLTimeBoundedItem.scala b/logic/src/main/scala/gr/grnet/aquarium/logic/accounting/dsl/DSLTimeBoundedItem.scala
new file mode 100644 (file)
index 0000000..07197b8
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2011 GRNET S.A. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *   1. Redistributions of source code must retain the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer.
+ *
+ *   2. Redistributions in binary form must reproduce the above
+ *      copyright notice, this list of conditions and the following
+ *      disclaimer in the documentation and/or other materials
+ *      provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and
+ * documentation are those of the authors and should not be
+ * interpreted as representing official policies, either expressed
+ * or implied, of GRNET S.A.
+ */
+
+package gr.grnet.aquarium.logic.accounting.dsl
+
+/**
+ * A DSL item whose effectivity is constrained by well defined time bounds.
+ *
+ * @author Georgios Gousios <gousiosg@gmail.com>
+ */
+abstract class DSLTimeBoundedItem(effective: DSLTimeFrame)
\ No newline at end of file
index 1b68198..9eae6bc 100644 (file)
@@ -45,6 +45,8 @@ import java.util.{Date, GregorianCalendar, Calendar}
  */
 trait DSLUtils extends DateUtils {
 
+  
+
   /**
    * Get a list of timeslots within which a timeframe is not effective.
    */