Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7165764AB for ; Mon, 13 Jun 2011 15:18:38 +0000 (UTC) Received: (qmail 39395 invoked by uid 500); 13 Jun 2011 15:18:38 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 39362 invoked by uid 500); 13 Jun 2011 15:18:38 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 39355 invoked by uid 99); 13 Jun 2011 15:18:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Jun 2011 15:18:38 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Jun 2011 15:18:35 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 10BBB23888DD; Mon, 13 Jun 2011 15:18:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1135136 - in /activemq/activemq-apollo/trunk: apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/ apollo-website/src/documentation/ Date: Mon, 13 Jun 2011 15:18:14 -0000 To: commits@activemq.apache.org From: chirino@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110613151814.10BBB23888DD@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: chirino Date: Mon Jun 13 15:18:13 2011 New Revision: 1135136 URL: http://svn.apache.org/viewvc?rev=1135136&view=rev Log: Documented updates to the tabular REST api access bits. Modified: activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/DataPageDTO.java activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/BrokerResource.scala activemq/activemq-apollo/trunk/apollo-website/src/documentation/management-api.md Modified: activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/DataPageDTO.java URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/DataPageDTO.java?rev=1135136&r1=1135135&r2=1135136&view=diff ============================================================================== --- activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/DataPageDTO.java (original) +++ activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/DataPageDTO.java Mon Jun 13 15:18:13 2011 @@ -37,8 +37,8 @@ public class DataPageDTO { /** */ - @XmlAttribute(name="row_max") - public int row_max; + @XmlAttribute(name="page_size") + public int page_size; /** */ @@ -64,7 +64,7 @@ public class DataPageDTO { DataPageDTO that = (DataPageDTO) o; if (page != that.page) return false; - if (row_max != that.row_max) return false; + if (page_size != that.page_size) return false; if (total_pages != that.total_pages) return false; if (total_rows != that.total_rows) return false; if (headers != null ? !headers.equals(that.headers) : that.headers != null) return false; @@ -76,7 +76,7 @@ public class DataPageDTO { @Override public int hashCode() { int result = page; - result = 31 * result + row_max; + result = 31 * result + page_size; result = 31 * result + total_pages; result = 31 * result + (int) (total_rows ^ (total_rows >>> 32)); result = 31 * result + (headers != null ? headers.hashCode() : 0); 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=1135136&r1=1135135&r2=1135136&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 Mon Jun 13 15:18:13 2011 @@ -310,10 +310,10 @@ case class BrokerResource() extends Reso val rc = new DataPageDTO rc.page = page - rc.row_max = page_size + rc.page_size = page_size def total_pages(x:Int,y:Int) = if(x==0) 1 else { x/y + (if ( x%y == 0 ) 0 else 1) } - rc.total_pages = total_pages(records.length, rc.row_max) + rc.total_pages = total_pages(records.length, rc.page_size) rc.total_rows = records.length rc.headers = headers Modified: activemq/activemq-apollo/trunk/apollo-website/src/documentation/management-api.md URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-website/src/documentation/management-api.md?rev=1135136&r1=1135135&r2=1135136&view=diff ============================================================================== --- activemq/activemq-apollo/trunk/apollo-website/src/documentation/management-api.md (original) +++ activemq/activemq-apollo/trunk/apollo-website/src/documentation/management-api.md Mon Jun 13 15:18:13 2011 @@ -51,63 +51,84 @@ Example: $ curl -u "admin:password" \ 'http://localhost:61680/broker/connections.json' - [ - [ - "*" - ], - { - "id":"4", - "state":"STARTED", - "state_since":1306848325102, - "read_counter":103, - "write_counter":239110628, - "transport":"tcp", - "protocol":"stomp", - "remote_address":"/127.0.0.1:61775", - "protocol_version":"1.0", - "user":"admin", - "waiting_on":"client request", - "subscription_count":1 - }, - { - "id":"5", - "state":"STARTED", - "state_since":1306848325102, - "read_counter":227739229, - "write_counter":113, - "transport":"tcp", - "protocol":"stomp", - "remote_address":"/127.0.0.1:61776", - "protocol_version":"1.0", - "user":"admin", - "waiting_on":"blocked sending to: org.apache.activemq.apollo.broker.Queue$$anon$1@13765e9b", - "subscription_count":0 - } - ] + +Results in a [Data Page](./api/apollo-dto/org/apache/activemq/apollo/dto/DataPageDTO.html) : + +{pygmentize:: js} +{ + "page":0, + "page_size":100, + "total_pages":1, + "total_rows":2, + "headers":[ + "*" + ], + "rows":[ + { + "id":"4", + "state":"STARTED", + "state_since":1306848325102, + "read_counter":103, + "write_counter":239110628, + "transport":"tcp", + "protocol":"stomp", + "remote_address":"/127.0.0.1:61775", + "protocol_version":"1.0", + "user":"admin", + "waiting_on":"client request", + "subscription_count":1 + }, + { + "id":"5", + "state":"STARTED", + "state_since":1306848325102, + "read_counter":227739229, + "write_counter":113, + "transport":"tcp", + "protocol":"stomp", + "remote_address":"/127.0.0.1:61776", + "protocol_version":"1.0", + "user":"admin", + "waiting_on":"blocked sending to: org.apache.activemq.apollo.broker.Queue$$anon$1@13765e9b", + "subscription_count":0 + } + ] +} +{pygmentiz} -The results are an array of records with the first record acting as a header -records describing the fields selected. The `*` field means all the record's -fields were selected. To narrow down the selected fields you can add +The `*` header field means the record was selected. To narrow down the selected fields you can add multiple `f` query parameters to pick the fields you want to retrieve. Example: $ curl -u "admin:password" \ 'http://localhost:61680/broker/connections.json?f=id&f=read_counter' + +Results in : + +{pygmentize:: js} +{ + "page":0, + "page_size":100, + "total_pages":1, + "total_rows":2, + "headers":[ + "id", + "read_counter" + ], + "rows":[ [ - [ - "id", - "read_counter" - ], - [ - "7", - 110733109 - ], - [ - "6", - 103 - ] + "7", + 110733109 + ], + [ + "6", + 103 ] + ] +} +{pygmentiz} + If you want to narrow down the records which get selected, you can set a `q` query parameter to SQL 92 style where clause which uses the record's fields