void
Adaptation::AccessRule::finalize()
{
+ if (!group()) { // no explicit group
+ debugs(93,7, HERE << "no service group: " << groupId);
+ // try to add a one-service group
+ if (FindService(groupId) != NULL) {
+ ServiceGroup *g = new SingleService(groupId);
+ g->finalize(); // explicit groups were finalized before rules
+ AllGroups().push_back(g);
+ }
+ }
+
if (!group()) {
debugs(93,0, "ERROR: Unknown adaptation service or group name: '" <<
groupId << "'"); // TODO: fail on failures
- }
+ }
}
Adaptation::ServiceGroup *
if (!FindService(id))
debugs(93,0, "ERROR: Unknown adaptation name: " << id);
}
+ debugs(93,7, HERE << "finalized " << kind << ": " << id);
}
/* ServiceSet */
}
#endif
+
+/* SingleService */
+
+Adaptation::SingleService::SingleService(const String &aServiceId):
+ ServiceGroup("single-service group")
+{
+ id = aServiceId;
+ services.push_back(aServiceId);
+}
+
+Adaptation::ServiceGroup::Loop
+Adaptation::SingleService::initialServices()
+{
+ return Loop(services.begin(), services.end()); // there should be only one
+}
+
+
+/* globals */
+
Adaptation::Groups &
Adaptation::AllGroups()
{