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 4BA6B10412 for ; Thu, 10 Oct 2013 19:35:17 +0000 (UTC) Received: (qmail 52288 invoked by uid 500); 10 Oct 2013 19:35:16 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 52250 invoked by uid 500); 10 Oct 2013 19:35:16 -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 52069 invoked by uid 99); 10 Oct 2013 19:35:15 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Oct 2013 19:35:15 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id AC5A191483D; Thu, 10 Oct 2013 19:35:14 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: rajdavies@apache.org To: commits@activemq.apache.org Date: Thu, 10 Oct 2013 19:35:16 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [3/3] git commit: Construct a ConsumerId from a String Construct a ConsumerId from a String Project: http://git-wip-us.apache.org/repos/asf/activemq/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/ccb119d8 Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/ccb119d8 Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/ccb119d8 Branch: refs/heads/trunk Commit: ccb119d896620c4c44bc0e341496efc4b519b59f Parents: e90ce1a Author: rajdavies Authored: Thu Oct 10 17:31:23 2013 +0100 Committer: rajdavies Committed: Thu Oct 10 20:30:01 2013 +0100 ---------------------------------------------------------------------- .../java/org/apache/activemq/command/ConsumerId.java | 11 +++++++++++ 1 file changed, 11 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq/blob/ccb119d8/activemq-client/src/main/java/org/apache/activemq/command/ConsumerId.java ---------------------------------------------------------------------- diff --git a/activemq-client/src/main/java/org/apache/activemq/command/ConsumerId.java b/activemq-client/src/main/java/org/apache/activemq/command/ConsumerId.java index e955763..29a42ee 100755 --- a/activemq-client/src/main/java/org/apache/activemq/command/ConsumerId.java +++ b/activemq-client/src/main/java/org/apache/activemq/command/ConsumerId.java @@ -35,6 +35,17 @@ public class ConsumerId implements DataStructure { public ConsumerId() { } + public ConsumerId(String str){ + if (str != null){ + String[] splits = str.split(":"); + if (splits != null && splits.length >= 3){ + this.connectionId = splits[0]; + this.sessionId = Long.parseLong(splits[1]); + this.value = Long.parseLong(splits[2]); + } + } + } + public ConsumerId(SessionId sessionId, long consumerId) { this.connectionId = sessionId.getConnectionId(); this.sessionId = sessionId.getValue();