Skip to content

Commit e64349b

Browse files
committed
Make more non-API classes not public
1 parent 4ab8eec commit e64349b

File tree

6 files changed

+15
-95
lines changed

6 files changed

+15
-95
lines changed

projects/client/RabbitMQ.Client/src/client/impl/Command.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
namespace RabbitMQ.Client.Impl
4949
{
50-
public class Command
50+
class Command
5151
{
5252
// EmptyFrameSize, 8 = 1 + 2 + 4 + 1
5353
// - 1 byte of frame type

projects/client/RabbitMQ.Client/src/client/impl/Frame.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
namespace RabbitMQ.Client.Impl
4949
{
50-
public class HeaderOutboundFrame : OutboundFrame
50+
class HeaderOutboundFrame : OutboundFrame
5151
{
5252
private readonly ContentHeaderBase _header;
5353
private readonly int _bodyLength;
@@ -72,7 +72,7 @@ internal override void WritePayload(NetworkBinaryWriter writer)
7272
}
7373
}
7474

75-
public class BodySegmentOutboundFrame : OutboundFrame
75+
class BodySegmentOutboundFrame : OutboundFrame
7676
{
7777
private readonly byte[] _body;
7878
private readonly int _offset;
@@ -92,7 +92,7 @@ internal override void WritePayload(NetworkBinaryWriter writer)
9292
}
9393
}
9494

95-
public class MethodOutboundFrame : OutboundFrame
95+
class MethodOutboundFrame : OutboundFrame
9696
{
9797
private readonly MethodBase _method;
9898

@@ -119,7 +119,7 @@ internal override void WritePayload(NetworkBinaryWriter writer)
119119
}
120120
}
121121

122-
public class EmptyOutboundFrame : OutboundFrame
122+
class EmptyOutboundFrame : OutboundFrame
123123
{
124124
public EmptyOutboundFrame() : base(FrameType.FrameHeartbeat, 0)
125125
{
@@ -131,7 +131,7 @@ internal override void WritePayload(NetworkBinaryWriter writer)
131131
}
132132
}
133133

134-
public abstract class OutboundFrame : Frame
134+
abstract class OutboundFrame : Frame
135135
{
136136
public OutboundFrame(FrameType type, int channel) : base(type, channel)
137137
{
@@ -148,7 +148,7 @@ internal void WriteTo(NetworkBinaryWriter writer)
148148
internal abstract void WritePayload(NetworkBinaryWriter writer);
149149
}
150150

151-
public class InboundFrame : Frame
151+
class InboundFrame : Frame
152152
{
153153
private InboundFrame(FrameType type, int channel, byte[] payload) : base(type, channel, payload)
154154
{
@@ -242,7 +242,7 @@ internal NetworkBinaryReader GetReader()
242242
}
243243
}
244244

245-
public class Frame
245+
class Frame
246246
{
247247
public Frame(FrameType type, int channel)
248248
{
@@ -292,7 +292,7 @@ public bool IsHeartbeat()
292292
}
293293
}
294294

295-
public enum FrameType : int
295+
enum FrameType : int
296296
{
297297
FrameMethod = 1,
298298
FrameHeader = 2,

projects/client/RabbitMQ.Client/src/client/impl/IFrameHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
namespace RabbitMQ.Client.Impl
4646
{
47-
public interface IFrameHandler
47+
interface IFrameHandler
4848
{
4949
AmqpTcpEndpoint Endpoint { get; }
5050

@@ -75,4 +75,4 @@ public interface IFrameHandler
7575

7676
void WriteFrameSet(IList<OutboundFrame> frames);
7777
}
78-
}
78+
}

projects/client/RabbitMQ.Client/src/client/impl/ISession.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
namespace RabbitMQ.Client.Impl
4545
{
46-
public interface ISession
46+
interface ISession
4747
{
4848
/// <summary>
4949
/// Gets the channel number.

projects/client/RabbitMQ.Client/src/client/impl/UnexpectedFrameException.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,13 @@ namespace RabbitMQ.Client.Impl
4747
/// </summary>
4848
public class UnexpectedFrameException : HardProtocolException
4949
{
50-
public Frame m_frame;
51-
52-
public UnexpectedFrameException(Frame frame)
50+
internal UnexpectedFrameException(Frame frame)
5351
: base("A frame of this type was not expected at this time")
5452
{
55-
m_frame = frame;
53+
Frame = frame;
5654
}
5755

58-
public Frame Frame
59-
{
60-
get { return m_frame; }
61-
}
56+
internal Frame Frame { get; }
6257

6358
public override ushort ReplyCode
6459
{

projects/client/Unit/src/unit/APIApproval.Approve.approved.txt

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -763,93 +763,21 @@ namespace RabbitMQ.Client.Exceptions
763763
}
764764
namespace RabbitMQ.Client.Impl
765765
{
766-
public class BodySegmentOutboundFrame : RabbitMQ.Client.Impl.OutboundFrame
767-
{
768-
public BodySegmentOutboundFrame(int channel, byte[] body, int offset, int count) { }
769-
}
770766
public class ChannelErrorException : RabbitMQ.Client.Impl.HardProtocolException
771767
{
772768
public ChannelErrorException(int channel) { }
773769
public int Channel { get; }
774770
public override ushort ReplyCode { get; }
775771
}
776-
public class Command
777-
{
778-
public byte[] Body { get; }
779-
public static void CheckEmptyFrameSize() { }
780-
}
781-
public class EmptyOutboundFrame : RabbitMQ.Client.Impl.OutboundFrame
782-
{
783-
public EmptyOutboundFrame() { }
784-
}
785-
public class Frame
786-
{
787-
public Frame(RabbitMQ.Client.Impl.FrameType type, int channel) { }
788-
public Frame(RabbitMQ.Client.Impl.FrameType type, int channel, byte[] payload) { }
789-
public int Channel { get; }
790-
public byte[] Payload { get; }
791-
public RabbitMQ.Client.Impl.FrameType Type { get; }
792-
public bool IsBody() { }
793-
public bool IsHeader() { }
794-
public bool IsHeartbeat() { }
795-
public bool IsMethod() { }
796-
public override string ToString() { }
797-
}
798-
public enum FrameType
799-
{
800-
FrameMethod = 1,
801-
FrameHeader = 2,
802-
FrameBody = 3,
803-
FrameHeartbeat = 8,
804-
FrameEnd = 206,
805-
FrameMinSize = 4096,
806-
}
807772
public abstract class HardProtocolException : RabbitMQ.Client.Impl.ProtocolException
808773
{
809774
protected HardProtocolException(string message) { }
810775
}
811-
public class HeaderOutboundFrame : RabbitMQ.Client.Impl.OutboundFrame { }
812-
public interface IFrameHandler
813-
{
814-
RabbitMQ.Client.AmqpTcpEndpoint Endpoint { get; }
815-
System.Net.EndPoint LocalEndPoint { get; }
816-
int LocalPort { get; }
817-
System.TimeSpan ReadTimeout { set; }
818-
System.Net.EndPoint RemoteEndPoint { get; }
819-
int RemotePort { get; }
820-
System.TimeSpan WriteTimeout { set; }
821-
void Close();
822-
RabbitMQ.Client.Impl.InboundFrame ReadFrame();
823-
void SendHeader();
824-
void WriteFrame(RabbitMQ.Client.Impl.OutboundFrame frame);
825-
void WriteFrameSet(System.Collections.Generic.IList<RabbitMQ.Client.Impl.OutboundFrame> frames);
826-
}
827-
public interface ISession
828-
{
829-
int ChannelNumber { get; }
830-
RabbitMQ.Client.ShutdownEventArgs CloseReason { get; }
831-
System.Action<RabbitMQ.Client.Impl.ISession, RabbitMQ.Client.Impl.Command> CommandReceived { get; set; }
832-
RabbitMQ.Client.IConnection Connection { get; }
833-
bool IsOpen { get; }
834-
event System.EventHandler<RabbitMQ.Client.ShutdownEventArgs> SessionShutdown;
835-
void Close(RabbitMQ.Client.ShutdownEventArgs reason);
836-
void Close(RabbitMQ.Client.ShutdownEventArgs reason, bool notify);
837-
void HandleFrame(RabbitMQ.Client.Impl.InboundFrame frame);
838-
void Notify();
839-
void Transmit(RabbitMQ.Client.Impl.Command cmd);
840-
void Transmit(System.Collections.Generic.IList<RabbitMQ.Client.Impl.Command> cmd);
841-
}
842-
public class InboundFrame : RabbitMQ.Client.Impl.Frame { }
843776
public class MalformedFrameException : RabbitMQ.Client.Impl.HardProtocolException
844777
{
845778
public MalformedFrameException(string message) { }
846779
public override ushort ReplyCode { get; }
847780
}
848-
public class MethodOutboundFrame : RabbitMQ.Client.Impl.OutboundFrame { }
849-
public abstract class OutboundFrame : RabbitMQ.Client.Impl.Frame
850-
{
851-
public OutboundFrame(RabbitMQ.Client.Impl.FrameType type, int channel) { }
852-
}
853781
public abstract class ProtocolException : RabbitMQ.Client.Exceptions.RabbitMQClientException
854782
{
855783
protected ProtocolException(string message) { }
@@ -868,9 +796,6 @@ namespace RabbitMQ.Client.Impl
868796
}
869797
public class UnexpectedFrameException : RabbitMQ.Client.Impl.HardProtocolException
870798
{
871-
public RabbitMQ.Client.Impl.Frame m_frame;
872-
public UnexpectedFrameException(RabbitMQ.Client.Impl.Frame frame) { }
873-
public RabbitMQ.Client.Impl.Frame Frame { get; }
874799
public override ushort ReplyCode { get; }
875800
}
876801
public class UnknownClassOrMethodException : RabbitMQ.Client.Impl.HardProtocolException

0 commit comments

Comments
 (0)