Skip to content

Commit 9f21e54

Browse files
Extract BasicGetResult into its own file
1 parent bf66b9d commit 9f21e54

File tree

3 files changed

+103
-58
lines changed

3 files changed

+103
-58
lines changed

projects/client/ApigenBootstrap/RabbitMQ.Client.ApigenBootstrap.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@
6060
<Compile Include="..\RabbitMQ.Client\src\client\api\PublicationAddress.cs">
6161
<Link>src\client\api\PublicationAddress.cs</Link>
6262
</Compile>
63+
<Compile Include="..\RabbitMQ.Client\src\client\api\BasicGetResult.cs">
64+
<Link>src\client\api\BasicGetResult.cs</Link>
65+
</Compile>
6366
<Compile Include="..\RabbitMQ.Client\src\client\api\QueueDeclareOk.cs">
6467
<Link>src\client\api\QueueDeclareOk.cs</Link>
6568
</Compile>
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
// This source code is dual-licensed under the Apache License, version
2+
// 2.0, and the Mozilla Public License, version 1.1.
3+
//
4+
// The APL v2.0:
5+
//
6+
//---------------------------------------------------------------------------
7+
// Copyright (C) 2007-2014 GoPivotal, Inc.
8+
//
9+
// Licensed under the Apache License, Version 2.0 (the "License");
10+
// you may not use this file except in compliance with the License.
11+
// You may obtain a copy of the License at
12+
//
13+
// http://www.apache.org/licenses/LICENSE-2.0
14+
//
15+
// Unless required by applicable law or agreed to in writing, software
16+
// distributed under the License is distributed on an "AS IS" BASIS,
17+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
// See the License for the specific language governing permissions and
19+
// limitations under the License.
20+
//---------------------------------------------------------------------------
21+
//
22+
// The MPL v1.1:
23+
//
24+
//---------------------------------------------------------------------------
25+
// The contents of this file are subject to the Mozilla Public License
26+
// Version 1.1 (the "License"); you may not use this file except in
27+
// compliance with the License. You may obtain a copy of the License
28+
// at http://www.mozilla.org/MPL/
29+
//
30+
// Software distributed under the License is distributed on an "AS IS"
31+
// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
32+
// the License for the specific language governing rights and
33+
// limitations under the License.
34+
//
35+
// The Original Code is RabbitMQ.
36+
//
37+
// The Initial Developer of the Original Code is GoPivotal, Inc.
38+
// Copyright (c) 2007-2014 GoPivotal, Inc. All rights reserved.
39+
//---------------------------------------------------------------------------
40+
41+
namespace RabbitMQ.Client
42+
{
43+
///<summary>Represents Basic.GetOk responses from the server.</summary>
44+
///<remarks>
45+
/// Basic.Get either returns an instance of this class, or null if
46+
/// a Basic.GetEmpty was received.
47+
///</remarks>
48+
public class BasicGetResult
49+
{
50+
private ulong m_deliveryTag;
51+
private bool m_redelivered;
52+
private string m_exchange;
53+
private string m_routingKey;
54+
private uint m_messageCount;
55+
private IBasicProperties m_basicProperties;
56+
private byte[] m_body;
57+
58+
///<summary>Sets the new instance's properties from the
59+
///arguments passed in.</summary>
60+
public BasicGetResult(ulong deliveryTag,
61+
bool redelivered,
62+
string exchange,
63+
string routingKey,
64+
uint messageCount,
65+
IBasicProperties basicProperties,
66+
byte[] body)
67+
{
68+
m_deliveryTag = deliveryTag;
69+
m_redelivered = redelivered;
70+
m_exchange = exchange;
71+
m_routingKey = routingKey;
72+
m_messageCount = messageCount;
73+
m_basicProperties = basicProperties;
74+
m_body = body;
75+
}
76+
77+
///<summary>Retrieve the delivery tag for this message. See also IModel.BasicAck.</summary>
78+
public ulong DeliveryTag { get { return m_deliveryTag; } }
79+
///<summary>Retrieve the redelivered flag for this message.</summary>
80+
public bool Redelivered { get { return m_redelivered; } }
81+
///<summary>Retrieve the exchange this message was published to.</summary>
82+
public string Exchange { get { return m_exchange; } }
83+
///<summary>Retrieve the routing key with which this message was published.</summary>
84+
public string RoutingKey { get { return m_routingKey; } }
85+
86+
///<summary>Retrieve the number of messages pending on the
87+
///queue, excluding the message being delivered.</summary>
88+
///<remarks>
89+
/// Note that this figure is indicative, not reliable, and can
90+
/// change arbitrarily as messages are added to the queue and
91+
/// removed by other clients.
92+
///</remarks>
93+
public uint MessageCount { get { return m_messageCount; } }
94+
95+
///<summary>Retrieves the Basic-class content header properties for this message.</summary>
96+
public IBasicProperties BasicProperties { get { return m_basicProperties; } }
97+
///<summary>Retrieves the body of this message.</summary>
98+
public byte[] Body { get { return m_body; } }
99+
}
100+
}

projects/client/RabbitMQ.Client/src/client/api/IModel.cs

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -535,62 +535,4 @@ BasicGetResult BasicGet(string queue,
535535
[AmqpMethodDoNotImplement(null)]
536536
void Abort(ushort replyCode, string replyText);
537537
}
538-
539-
///<summary>Represents Basic.GetOk responses from the server.</summary>
540-
///<remarks>
541-
/// Basic.Get either returns an instance of this class, or null if
542-
/// a Basic.GetEmpty was received.
543-
///</remarks>
544-
public class BasicGetResult
545-
{
546-
private ulong m_deliveryTag;
547-
private bool m_redelivered;
548-
private string m_exchange;
549-
private string m_routingKey;
550-
private uint m_messageCount;
551-
private IBasicProperties m_basicProperties;
552-
private byte[] m_body;
553-
554-
///<summary>Sets the new instance's properties from the
555-
///arguments passed in.</summary>
556-
public BasicGetResult(ulong deliveryTag,
557-
bool redelivered,
558-
string exchange,
559-
string routingKey,
560-
uint messageCount,
561-
IBasicProperties basicProperties,
562-
byte[] body)
563-
{
564-
m_deliveryTag = deliveryTag;
565-
m_redelivered = redelivered;
566-
m_exchange = exchange;
567-
m_routingKey = routingKey;
568-
m_messageCount = messageCount;
569-
m_basicProperties = basicProperties;
570-
m_body = body;
571-
}
572-
573-
///<summary>Retrieve the delivery tag for this message. See also IModel.BasicAck.</summary>
574-
public ulong DeliveryTag { get { return m_deliveryTag; } }
575-
///<summary>Retrieve the redelivered flag for this message.</summary>
576-
public bool Redelivered { get { return m_redelivered; } }
577-
///<summary>Retrieve the exchange this message was published to.</summary>
578-
public string Exchange { get { return m_exchange; } }
579-
///<summary>Retrieve the routing key with which this message was published.</summary>
580-
public string RoutingKey { get { return m_routingKey; } }
581-
582-
///<summary>Retrieve the number of messages pending on the
583-
///queue, excluding the message being delivered.</summary>
584-
///<remarks>
585-
/// Note that this figure is indicative, not reliable, and can
586-
/// change arbitrarily as messages are added to the queue and
587-
/// removed by other clients.
588-
///</remarks>
589-
public uint MessageCount { get { return m_messageCount; } }
590-
591-
///<summary>Retrieves the Basic-class content header properties for this message.</summary>
592-
public IBasicProperties BasicProperties { get { return m_basicProperties; } }
593-
///<summary>Retrieves the body of this message.</summary>
594-
public byte[] Body { get { return m_body; } }
595-
}
596538
}

0 commit comments

Comments
 (0)