}
}
+ /**
+ * Get the policies that are valid between the specified time instances
+ */
def policies(from: Date, to: Date): List[DSLPolicy] = {
- policies.filter {
+ policies.get.filter {
a => a._1.from.before(from) &&
a._1.to.after(to)
- }.values.toList
+ }.valuesIterator.toList
}
-
+
+ /**
+ * Get the policies that are valid throughout the specified
+ * [[gr.grnet.aquarium.logic.accounting.dsl.Timeslot]]
+ */
def policies(t: Timeslot): List[DSLPolicy] = policies(t.from, t.to)
+ /**
+ * Load and parse a policy from file.
+ */
def loadPolicyFromFile(pol: File): DSLPolicy = {
val stream = pol.exists() match {
0L,
ActiveSuspendedSnapshot(true, now),
CreditSnapshot(0, now),
-- AgreementSnapshot("default", now),
++ AgreementSnapshot(Agreement("default", now, now) :: Nil, now),
RolesSnapshot(Nil, now),
PaymentOrdersSnapshot(Nil, now),
OwnedGroupsSnapshot(Nil, now),