// /user/(.+)/state/?
callRouter(GetUserStateRequest(userId, millis), responder)
- case AdminPingAll() ⇒
+// case AdminPingAllPath() ⇒
+// withAdminCookieHelper { responder ⇒
+// callRouter(PingAllRequest(), responder)
+// }
+
+ case ResourcesPath() ⇒
withAdminCookieHelper { responder ⇒
- callRouter(PingAllRequest(), responder)
+ responder.complete(
+ stringResponse200("%s\n%s\n%s\n" .format(
+ ResourceLocator.ResourceNames.AQUARIUM_PROPERTIES,
+ ResourceLocator.ResourceNames.LOGBACK_XML,
+ ResourceLocator.ResourceNames.POLICY_YAML),
+ TEXT_PLAIN
+ )
+ )
}
- case ResourcesAquariumProperties() ⇒
+ case ResourcesAquariumPropertiesPath() ⇒
withAdminCookieHelper { responder ⇒
resourceInfoResponse(uri, responder, ResourceLocator.Resources.AquariumPropertiesResource, TEXT_PLAIN)
}
- case ResourcesLogbackXML() ⇒
+ case ResourcesLogbackXMLPath() ⇒
withAdminCookieHelper { responder ⇒
resourceInfoResponse(uri, responder, ResourceLocator.Resources.LogbackXMLResource, TEXT_PLAIN)
}
- case ResourcesPolicyYAML() ⇒
+ case ResourcesPolicyYAMLPath() ⇒
withAdminCookieHelper { responder ⇒
resourceInfoResponse(uri, responder, ResourceLocator.Resources.PolicyYAMLResource, TEXT_PLAIN)
}
package service
package rest
+import gr.grnet.aquarium.ResourceLocator
+
/**
* Paths recognized and served by the REST API.
* @author Christos KK Loverdos <loverdos@gmail.com>.
*/
object RESTPaths {
- final val ResourcesLogbackXML = "/resources/logback\\.xml".r
+ final val ResourcesPath = "/resources/?".r
+
+ private def fixREDot(s: String) = s.replaceAll("""\.""", """\\.""")
+ private def toResourcesPath(name: String) = "/resources/%s".format(fixREDot(name)).r
+ private def toEventPath(name: String) = "/%s/([^/]+)/?".format(name).r
- final val ResourcesAquariumProperties = "/resources/aquarium\\.properties".r
+ final val ResourcesAquariumPropertiesPath = toResourcesPath(ResourceLocator.ResourceNames.AQUARIUM_PROPERTIES)
- final val ResourcesPolicyYAML = "/resources/policy\\.yaml".r
+ final val ResourcesLogbackXMLPath = toResourcesPath(ResourceLocator.ResourceNames.LOGBACK_XML)
- final val RolesAgreementsMap = "/resources/roles-agreements\\.map".r
+ final val ResourcesPolicyYAMLPath = toResourcesPath(ResourceLocator.ResourceNames.POLICY_YAML)
- final val ResourceEventPath = "/rcevent/([^/]+)/?".r
+ final val ResourceEventPath = toEventPath("rcevent")
- final val IMEventPath = "/imevent/([^/]+)/?".r
+ final val IMEventPath = toEventPath("imevent")
/**
* Use this URI path to query for the user balance. The parenthesized regular expression part
/**
* Use this administrative URI path to ping all services used by Aquarium.
*/
- final val AdminPingAll = "/admin/ping/all/?".r
+ final val AdminPingAllPath = "/admin/ping/all/?".r
}
\ No newline at end of file