Updates referencesource to .NET 4.7
[mono-project.git] / mcs / class / referencesource / System.Data / Microsoft / SqlServer / Server / SmiContext.cs
blob5c500135f66d9a66d26b04be5ac479c24583dbde
1 //------------------------------------------------------------------------------
2 // <copyright file="SmiContext.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
4 // </copyright>
5 // <owner current="true" primary="true">Microsoft</owner>
6 // <owner current="true" primary="false">Microsoft</owner>
7 //------------------------------------------------------------------------------
9 namespace Microsoft.SqlServer.Server {
11 using System;
12 using System.Data;
13 using System.Data.Sql;
14 using System.Data.SqlTypes;
15 using System.Security.Principal;
17 // NOTE: connection, transaction and context pipe operations could be
18 // encapsulated in their own classes, and should if they get complex
19 // (transaction is borderline at this point).
20 internal abstract class SmiContext {
22 internal abstract event EventHandler OutOfScope;
24 internal abstract SmiConnection ContextConnection { get; }
26 internal abstract long ContextTransactionId { get; }
28 internal abstract System.Transactions.Transaction ContextTransaction { get; }
30 internal abstract bool HasContextPipe { get; }
32 internal abstract WindowsIdentity WindowsIdentity { get; }
34 internal abstract SmiRecordBuffer CreateRecordBuffer (
35 SmiExtendedMetaData[] columnMetaData, // Extended metadata because it requires names, udttypename and xmlschemaname ignored
36 SmiEventSink eventSink
39 internal abstract SmiRequestExecutor CreateRequestExecutor (
40 string commandText,
41 CommandType commandType,
42 SmiParameterMetaData[] parameterMetaData,
43 SmiEventSink eventSink
46 //
48 internal abstract object GetContextValue ( int key );
50 internal abstract void GetTriggerInfo (
51 SmiEventSink eventSink,
52 out bool[] columnsUpdated,
53 out TriggerAction action,
54 out SqlXml eventInstanceData
57 internal abstract void SendMessageToPipe( string message, SmiEventSink eventSink );
59 internal abstract void SendResultsStartToPipe( SmiRecordBuffer recordBuffer, SmiEventSink eventSink );
61 internal abstract void SendResultsRowToPipe( SmiRecordBuffer recordBuffer, SmiEventSink eventSink );
63 internal abstract void SendResultsEndToPipe( SmiRecordBuffer recordBuffer, SmiEventSink eventSink );
65 internal abstract void SetContextValue ( int key, object value );
67 // Scratch LOB storage region
68 internal virtual SmiStream GetScratchStream( SmiEventSink sink ) {
69 // Adding as of V3
71 // Implement body with throw because there are only a couple of ways to get to this code:
72 // 1) Client is calling this method even though the server negotiated for V2- and hasn't implemented V3 yet.
73 // 2) Server didn't implement V3, but negotiated V3+.
74 System.Data.Common.ADP.InternalError( System.Data.Common.ADP.InternalErrorCode.UnimplementedSMIMethod );
75 return null;