예제 #1
0
        public override void AcceptRequest(RequestContext requestContext, Microsoft.Cis.Services.Nephos.Common.ServiceType serviceType)
        {
            requestContext.ServiceType = serviceType;
            PerRequestStorageManager perRequestStorageManager = new PerRequestStorageManager(TableServiceEntry.SharedStorageManager, requestContext.OperationStatus);
            AuthenticationManager    authenticationManager    = XFETableAuthenticationManager.CreateAuthenticationManager(TableServiceEntry.SharedStorageManager);
            AuthorizationManager     authorizationManager     = NephosAuthorizationManager.CreateAuthorizationManager(TableServiceEntry.SharedStorageManager, false);
            ITableManager            operationStatus          = TableManager.CreateTableManager(authorizationManager, TableServiceEntry.SharedTableDataFactory, TableServiceEntry.SharedStorageManager);

            operationStatus.Initialize();
            operationStatus.OperationStatus = requestContext.OperationStatus;
            IProcessor processor = TableProtocolHead.Create(requestContext, perRequestStorageManager, authenticationManager, operationStatus, TableProtocolHead.HttpProcessorConfigurationDefaultInstance, new TransformExceptionDelegate(SqlExceptionManager.TransformSqlException), null);

            ServiceRequestHandler.DispatchRequest(processor);
        }
예제 #2
0
        public void Initialize(IServiceEntrySink sink)
        {
            if (sink == null)
            {
                throw new ArgumentNullException("sink");
            }
            Logger <IRestProtocolHeadLogger> .Instance.VerboseDebug.Log("[Nephos.Table] { Initialize");

            TableProtocolHead.HttpProcessorConfigurationDefaultInstance = HttpProcessorConfiguration.LoadDefaultHttpProcessorConfiguration(sink, "UriHostSuffixes", null);
            TableServiceEntry.SharedStorageManager   = new DbStorageManager();
            this.authenticationManager               = XFETableAuthenticationManager.CreateAuthenticationManager(TableServiceEntry.SharedStorageManager);
            TableServiceEntry.SharedTableDataFactory = new DbTableDataContextFactory();
            this.tableManager = TableManager.CreateTableManager(NephosAuthorizationManager.CreateAuthorizationManager(TableServiceEntry.SharedStorageManager, false), TableServiceEntry.SharedTableDataFactory, TableServiceEntry.SharedStorageManager);
            sink.RegisterRestHandler(this);
        }