Welcome to mirror list, hosted at ThFree Co, Russian Federation.

SmiContext.cs « Server « SqlServer « Microsoft « System.Data « referencesource « class « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5c500135f66d9a66d26b04be5ac479c24583dbde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//------------------------------------------------------------------------------
// <copyright file="SmiContext.cs" company="Microsoft">
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// </copyright>
// <owner current="true" primary="true">Microsoft</owner>
// <owner current="true" primary="false">Microsoft</owner>
//------------------------------------------------------------------------------

namespace Microsoft.SqlServer.Server {

    using System;
    using System.Data;
    using System.Data.Sql;
    using System.Data.SqlTypes;
    using System.Security.Principal;

    // NOTE: connection, transaction and context pipe operations could be 
    //       encapsulated in their own classes, and should if they get complex 
    //       (transaction is borderline at this point).
    internal abstract class SmiContext {

        internal abstract event EventHandler OutOfScope;

        internal abstract SmiConnection ContextConnection { get; }

        internal abstract long ContextTransactionId { get; }

        internal abstract System.Transactions.Transaction ContextTransaction { get; }

        internal abstract bool HasContextPipe { get; }

        internal abstract WindowsIdentity WindowsIdentity { get; }
        
        internal abstract SmiRecordBuffer CreateRecordBuffer (
            SmiExtendedMetaData[]   columnMetaData,     // Extended metadata because it requires names, udttypename and xmlschemaname ignored
            SmiEventSink            eventSink
        );

        internal abstract SmiRequestExecutor CreateRequestExecutor (
            string                  commandText,
            CommandType             commandType,
            SmiParameterMetaData[]  parameterMetaData,
            SmiEventSink            eventSink
        );

        // 

        internal abstract object GetContextValue ( int key );

        internal abstract void GetTriggerInfo (
            SmiEventSink            eventSink,
            out bool[]              columnsUpdated,
            out TriggerAction       action,
            out SqlXml              eventInstanceData
        );

        internal abstract void SendMessageToPipe( string message, SmiEventSink eventSink );

        internal abstract void SendResultsStartToPipe( SmiRecordBuffer recordBuffer, SmiEventSink eventSink );

        internal abstract void SendResultsRowToPipe( SmiRecordBuffer recordBuffer, SmiEventSink eventSink );

        internal abstract void SendResultsEndToPipe( SmiRecordBuffer recordBuffer, SmiEventSink eventSink );

        internal abstract void SetContextValue ( int key, object value );

        // Scratch LOB storage region
        internal virtual SmiStream GetScratchStream( SmiEventSink sink ) {
            // Adding as of V3

            // Implement body with throw because there are only a couple of ways to get to this code:
            //  1) Client is calling this method even though the server negotiated for V2- and hasn't implemented V3 yet.
            //  2) Server didn't implement V3, but negotiated V3+.
            System.Data.Common.ADP.InternalError( System.Data.Common.ADP.InternalErrorCode.UnimplementedSMIMethod );
            return null;
        }
    }
}