activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1143044 - /activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/BrokerResource.scala
Date Tue, 05 Jul 2011 13:19:10 GMT
Author: chirino
Date: Tue Jul  5 13:19:10 2011
New Revision: 1143044

URL: http://svn.apache.org/viewvc?rev=1143044&view=rev
Log:
Fixes https://issues.apache.org/jira/browse/APLO-66 : Accessing non-existent resource routes
like /broker/connectors/foobar/action/start.json results in a 204 instead of a 404

Modified:
    activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/BrokerResource.scala

Modified: activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/BrokerResource.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/BrokerResource.scala?rev=1143044&r1=1143043&r2=1143044&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/BrokerResource.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/BrokerResource.scala
Tue Jul  5 13:19:10 2011
@@ -390,7 +390,7 @@ case class BrokerResource() extends Reso
 
   @DELETE @Path("virtual-hosts/{id}/queues/{name:.*}")
   @Produces(Array("application/json", "application/xml","text/xml"))
-  def queue_delete(@PathParam("id") id : String, @PathParam("name") name : String):Unit =
{
+  def queue_delete(@PathParam("id") id : String, @PathParam("name") name : String):Unit =
unwrap_future_result {
     with_virtual_host(id) { host =>
       val router: LocalRouter = host
       val node = router.queue_domain.destination_by_id.get(name).getOrElse(result(NOT_FOUND))
@@ -402,7 +402,7 @@ case class BrokerResource() extends Reso
 
   @POST @Path("virtual-hosts/{id}/queues/{name:.*}/action/delete")
   @Produces(Array("text/html;qs=5"))
-  def post_queue_delete_and_redirect(@PathParam("id") id : String, @PathParam("name") name
: String):Unit = {
+  def post_queue_delete_and_redirect(@PathParam("id") id : String, @PathParam("name") name
: String):Unit = unwrap_future_result {
     queue_delete(id, name)
     result(strip_resolve("../../.."))
   }
@@ -437,7 +437,7 @@ case class BrokerResource() extends Reso
 
   @DELETE @Path("virtual-hosts/{id}/dsubs/{name:.*}")
   @Produces(Array("application/json", "application/xml","text/xml"))
-  def dsub_delete(@PathParam("id") id : String, @PathParam("name") name : String):Unit =
{
+  def dsub_delete(@PathParam("id") id : String, @PathParam("name") name : String):Unit =
unwrap_future_result {
     with_virtual_host(id) { host =>
       val router: LocalRouter = host
       val node = router.topic_domain.durable_subscriptions_by_id.get(name).getOrElse(result(NOT_FOUND))
@@ -449,7 +449,7 @@ case class BrokerResource() extends Reso
 
   @POST @Path("virtual-hosts/{id}/dsubs/{name:.*}/action/delete")
   @Produces(Array("text/html;qs=5"))
-  def post_dsub_delete_and_redirect(@PathParam("id") id : String, @PathParam("name") name
: String):Unit = {
+  def post_dsub_delete_and_redirect(@PathParam("id") id : String, @PathParam("name") name
: String):Unit = unwrap_future_result {
     dsub_delete(id, name)
     result(strip_resolve("../../.."))
   }
@@ -595,7 +595,7 @@ case class BrokerResource() extends Reso
 
   @POST @Path("connectors/{id}/action/stop")
   @Produces(Array("application/json", "application/xml","text/xml"))
-  def post_connector_stop(@PathParam("id") id : String):Unit = {
+  def post_connector_stop(@PathParam("id") id : String):Unit = unwrap_future_result {
     with_connector(id) { connector =>
       admining(connector.broker) {
         connector.stop
@@ -605,14 +605,14 @@ case class BrokerResource() extends Reso
 
   @POST @Path("connectors/{id}/action/stop")
   @Produces(Array("text/html;qs=5"))
-  def post_connector_stop_and_redirect(@PathParam("id") id : String):Unit = {
+  def post_connector_stop_and_redirect(@PathParam("id") id : String):Unit = unwrap_future_result
{
     post_connector_stop(id)
     result(strip_resolve(".."))
   }
 
   @POST @Path("connectors/{id}/action/start")
   @Produces(Array("application/json", "application/xml","text/xml"))
-  def post_connector_start(@PathParam("id") id : String):Unit = {
+  def post_connector_start(@PathParam("id") id : String):Unit = unwrap_future_result {
     with_connector(id) { connector =>
       admining(connector.broker) {
         connector.start
@@ -622,7 +622,7 @@ case class BrokerResource() extends Reso
 
   @POST @Path("connectors/{id}/action/start")
   @Produces(Array("text/html;qs=5"))
-  def post_connector_start_and_redirect(@PathParam("id") id : String):Unit = {
+  def post_connector_start_and_redirect(@PathParam("id") id : String):Unit = unwrap_future_result
{
     post_connector_start(id)
     result(strip_resolve(".."))
   }
@@ -656,7 +656,7 @@ case class BrokerResource() extends Reso
 
   @DELETE @Path("connections/{id}")
   @Produces(Array("application/json", "application/xml","text/xml"))
-  def connection_delete(@PathParam("id") id : Long):Unit = {
+  def connection_delete(@PathParam("id") id : Long):Unit = unwrap_future_result {
     with_connection(id){ connection=>
       admining(connection.connector.broker) {
         connection.stop
@@ -667,14 +667,14 @@ case class BrokerResource() extends Reso
 
   @POST @Path("connections/{id}/action/delete")
   @Produces(Array("text/html;qs=5"))
-  def post_connection_delete_and_redirect(@PathParam("id") id : Long):Unit = {
+  def post_connection_delete_and_redirect(@PathParam("id") id : Long):Unit = unwrap_future_result
{
     connection_delete(id)
     result(strip_resolve("../../.."))
   }
 
   @POST
   @Path("action/shutdown")
-  def command_shutdown:Unit = {
+  def command_shutdown:Unit = unwrap_future_result {
     info("JVM shutdown requested via web interface")
     with_broker { broker =>
       admining(broker) {



Mime
View raw message