/// <summary>
 ///  Update the session context after receiving a request from the client.
 /// </summary>
 /// <param name="currentInterfaceType">Rpc interface type.</param>
 /// <param name="messageReceived">The DRSR request received</param>
 internal void UpdateSessionContextWithMessageReceived(
     DrsrRpcInterfaceType currentInterfaceType,
     DrsrRequestStub messageReceived)
 {
     requestReceived = messageReceived;
     interfaceType   = currentInterfaceType;
 }
Example #2
0
        internal static DrsrRequestStub CreateDrsrRequestStub(DrsrRpcInterfaceType interfaceType, ushort opnum)
        {
            DrsrRequestStub requestStub = null;

            if (interfaceType == DrsrRpcInterfaceType.DRSUAPI)
            {
                switch ((DrsuapiMethodOpnums)opnum)
                {
                case DrsuapiMethodOpnums.DrsBind:
                    requestStub = new DrsBindRequest();
                    break;

                case DrsuapiMethodOpnums.DrsUnbind:
                    requestStub = new DrsUnbindRequest();
                    break;

                case DrsuapiMethodOpnums.DrsReplicaSync:
                    requestStub = new DrsReplicaSyncRequest();
                    break;

                case DrsuapiMethodOpnums.DrsGetNcChanges:
                    requestStub = new DrsGetNcChangesRequest();
                    break;

                case DrsuapiMethodOpnums.DrsUpdateRefs:
                    requestStub = new DrsUpdateRefsRequest();
                    break;

                case DrsuapiMethodOpnums.DrsReplicaAdd:
                    requestStub = new DrsReplicaAddRequest();
                    break;

                case DrsuapiMethodOpnums.DrsReplicaDel:
                    requestStub = new DrsReplicaDelRequest();
                    break;

                case DrsuapiMethodOpnums.DrsReplicaModify:
                    requestStub = new DrsReplicaModifyRequest();
                    break;

                case DrsuapiMethodOpnums.DrsVerifyNames:
                    requestStub = new DrsVerifyNamesRequest();
                    break;

                case DrsuapiMethodOpnums.DrsGetMemberships:
                    requestStub = new DrsGetMembershipsRequest();
                    break;

                case DrsuapiMethodOpnums.DrsInterDomainMove:
                    requestStub = new DrsInterDomainMoveRequest();
                    break;

                case DrsuapiMethodOpnums.DrsGetNt4ChangeLog:
                    requestStub = new DrsGetNt4ChangeLogRequest();
                    break;

                case DrsuapiMethodOpnums.DrsCrackNames:
                    requestStub = new DrsCrackNamesRequest();
                    break;

                case DrsuapiMethodOpnums.DrsWriteSPN:
                    requestStub = new DrsWriteSpnRequest();
                    break;

                case DrsuapiMethodOpnums.DrsRemoveDsServer:
                    requestStub = new DrsRemoveDsServerRequest();
                    break;

                case DrsuapiMethodOpnums.DrsRemoveDsDomain:
                    requestStub = new DrsRemoveDsDomainRequest();
                    break;

                case DrsuapiMethodOpnums.DrsDomainControllerInfo:
                    requestStub = new DrsDomainControllerInfoRequest();
                    break;

                case DrsuapiMethodOpnums.DrsAddEntry:
                    requestStub = new DrsAddEntryRequest();
                    break;

                case DrsuapiMethodOpnums.DrsExecuteKcc:
                    requestStub = new DrsExecuteKccRequest();
                    break;

                case DrsuapiMethodOpnums.DrsGetReplInfo:
                    requestStub = new DrsGetReplInfoRequest();
                    break;

                case DrsuapiMethodOpnums.DrsAddSidHistory:
                    requestStub = new DrsAddSidHistoryRequest();
                    break;

                case DrsuapiMethodOpnums.DrsGetMemberships2:
                    requestStub = new DrsGetMemberships2Request();
                    break;

                case DrsuapiMethodOpnums.DrsReplicaVerifyObjects:
                    requestStub = new DrsReplicaVerifyObjectsRequest();
                    break;

                case DrsuapiMethodOpnums.DrsGetObjectExistence:
                    requestStub = new DrsGetObjectExistenceRequest();
                    break;

                case DrsuapiMethodOpnums.DrsQuerySitesByCost:
                    requestStub = new DrsQuerySitesByCostRequest();
                    break;

                case DrsuapiMethodOpnums.DrsInitDemotion:
                    requestStub = new DrsInitDemotionRequest();
                    break;

                case DrsuapiMethodOpnums.DrsReplicaDemotion:
                    requestStub = new DrsReplicaDemotionRequest();
                    break;

                case DrsuapiMethodOpnums.DrsFinishDemotion:
                    requestStub = new DrsFinishDemotionRequest();
                    break;
                }
            }
            else if (interfaceType == DrsrRpcInterfaceType.DSAOP)
            {
                switch ((DsaopMethodOpnums)opnum)
                {
                case DsaopMethodOpnums.DsaPrepareScript:
                    requestStub = new DsaPrepareScriptRequest();
                    break;

                case DsaopMethodOpnums.DsaExecuteScript:
                    requestStub = new DsaExecuteScriptRequest();
                    break;
                }
            }

            return(requestStub);
        }