public HttpActionFuture(IHttpAction action) : base(action.Listener) { _httpAction = action; _httpAction.Listener = Listener; _httpAction.ActionFuture = this; }
public HttpActor(HttpActorType type, QQContext context, IHttpAction action, QQHttpResponse response) { _type = type; _context = context; _action = action; _response = response; }
public IQQActionFuture PushHttpAction(IHttpAction action) { var future = new HttpActionFuture(action); //替换掉原始的QQActionListener Context.PushActor(new HttpActor(HttpActorType.BuildRequest, Context, action)); return(future); }
public QQActionFuture PushHttpAction(IHttpAction action) { QQActionFuture future = new HttpActionFuture(action); //替换掉原始的QQActionListener this.Context.PushActor(new HttpActor(HttpActorType.BUILD_REQUEST, this.Context, action)); return(future); }
public HttpActionFuture(IHttpAction action) : base(action.Listener) { this.httpAction = action; this.httpAction.Listener = this.Listener; this.httpAction.ActionFuture = this; }
public HttpActor(HttpActorType type, QQContext context, IHttpAction action, Exception throwable) { _type = type; _context = context; _action = action; _throwable = throwable; }
public HttpActor(HttpActorType type, QQContext context, IHttpAction action, long current, long total) { _type = type; _context = context; _action = action; _current = current; _total = total; }
public byte[] GetResponse(IHttpAction httpAction) { if (httpAction.Object != null) { var serializer = SerializerRegistry.Get(Request.GetField("Accept")); var datareq = Encoding.UTF8.GetBytes(serializer.Serialize(httpAction.Object, httpAction.Object.GetType())); Response = new Response(ResponseStatus.Get(httpAction.Code), datareq); Response.Fields.Add("Content-Type", serializer.Mime); } else { Response = new Response(ResponseStatus.Get(httpAction.Code), null); } return(CreateByteResponse()); }
public HttpActor(HttpActorType type, IQQContext context, IHttpAction action) { _type = type; _context = context; _action = action; }
private static IHttpAction CreateActionPrivate(IHttpActionContext actionContext, IHttpActionFactory actionFactory, NodeHead requestedNode, string requestedActionName, string requestedApplicationNodePath, string requestedDevice) { IHttpAction action = null; var factory = actionFactory ?? actionContext.GetActionFactory(); var contextNode = requestedNode ?? actionContext.GetRequestedNode(); var actionName = requestedActionName ?? actionContext.RequestedActionName; var appNodePath = requestedApplicationNodePath ?? actionContext.RequestedApplicationNodePath; var portalContext = (PortalContext)actionContext; // ================================================= #1: preconditions action = GetODataAction(factory, portalContext, contextNode); if (action != null) { return(action); } // webdav request? action = GetWebdavAction(factory, portalContext, contextNode); if (action != null) { return(action); } // ----------------------------------------------- forward to start page if context is a Site action = GetSiteStartPageAction(factory, portalContext, contextNode); if (action != null) { return(action); } // ----------------------------------------------- smart url action = GetSmartUrlAction(factory, portalContext, contextNode); if (action != null) { return(action); } // ----------------------------------------------- outer resource action = GetExternalResourceAction(factory, portalContext, contextNode); if (action != null) { return(action); } // ----------------------------------------------- context is external page action = GetExternalPageAction(factory, portalContext, contextNode, actionName, appNodePath); if (action != null) { return(action); } // ----------------------------------------------- context is IHttpHandlerNode if (string.IsNullOrEmpty(actionName)) { action = GetIHttpHandlerAction(factory, portalContext, contextNode, contextNode); if (action != null) { return(action); } } // ----------------------------------------------- default context action action = GetDefaultContextAction(factory, portalContext, contextNode, actionName, appNodePath); if (action != null) { return(action); } // ================================================= #2: FindApplication(node, action); var appNode = FindApplication(contextNode, actionName, appNodePath, actionContext.DeviceName); if (appNode == null) { return(factory.CreateRewriteAction(actionContext, contextNode, null, GetRewritePath(contextNode, portalContext))); } // ----------------------------------------------- AppNode is IHttpHandlerNode action = GetIHttpHandlerAction(factory, portalContext, contextNode, appNode); if (action != null) { return(action); } // ----------------------------------------------- page and site return(factory.CreateRewriteAction(actionContext, contextNode, appNode, GetRewritePath(appNode, portalContext))); }
protected BaseSaveDocumentCollection( IHttpAction action, ICouchConfiguration configuration, ISerializationProvider serializer ) : base( action, configuration, serializer ) { }
public ChangeStreamCommand(IHttpAction action, ICouchConfiguration configuration, ISerializationProvider serializer) : base(action, configuration, serializer) { }
public IQQActionFuture PushHttpAction(IHttpAction action) { var future = new HttpActionFuture(action); //替换掉原始的QQActionListener Context.PushActor(new HttpActor(HttpActorType.BuildRequest, Context, action)); return future; }
public GetFromViewCommand(IHttpAction action, ICouchConfiguration configuration, ISerializationProvider serializer) : base(action, configuration, serializer) { }
public HttpAdaptor(IQQContext context, IHttpAction action) { _context = context; _action = action; }
public HttpActor(HttpActorType type, QQContext context, IHttpAction action) { _type = type; _context = context; _action = action; }
protected static void WireUpCommandMock(IHttpAction commandMock) { var mock = Assimilate.GetAllInstancesOf<IHttpAction>(); Assimilate.Dependencies( x => x.For<IHttpAction>().Use( commandMock ) ); }
public DeleteAttachmentCommand(IHttpAction action, ICouchConfiguration configuration, ISerializationProvider serializer) : base(action, configuration, serializer) { }
private static IHttpAction CreateActionPrivate(IHttpActionContext actionContext, IHttpActionFactory actionFactory, NodeHead requestedNode, string requestedActionName, string requestedApplicationNodePath, string requestedDevice) { IHttpAction action = null; var factory = actionFactory ?? actionContext.GetActionFactory(); var contextNode = requestedNode ?? actionContext.GetRequestedNode(); var actionName = requestedActionName ?? actionContext.RequestedActionName; var appNodePath = requestedApplicationNodePath ?? actionContext.RequestedApplicationNodePath; var portalContext = (PortalContext)actionContext; //================================================= #1: preconditions action = GetFirstRunAction(factory, portalContext, contextNode); if (action != null) { return(action); } // webdav request? action = GetWebdavAction(factory, portalContext, contextNode); if (action != null) { return(action); } /* * //---- Uncomment and recompile to support *.SVC on IIS5.1 * action = (GetIIS5SVCRequestAction(portalContext, httpContext)); * if (action != null) * return action; */ //----------------------------------------------- forward to start page if context is a Site action = GetSiteStartPageAction(factory, portalContext, contextNode); if (action != null) { return(action); } //----------------------------------------------- smart url action = GetSmartUrlAction(factory, portalContext, contextNode); if (action != null) { return(action); } //----------------------------------------------- outer resource action = GetExternalResourceAction(factory, portalContext, contextNode); if (action != null) { return(action); } //----------------------------------------------- context is external page action = GetExternalPageAction(factory, portalContext, contextNode, actionName, appNodePath); if (action != null) { return(action); } //----------------------------------------------- context is IHttpHandlerNode if (string.IsNullOrEmpty(actionName)) { action = GetIHttpHandlerAction(factory, portalContext, contextNode, contextNode); if (action != null) { return(action); } } //----------------------------------------------- default context action action = GetDefaultContextAction(factory, portalContext, contextNode, actionName, appNodePath); if (action != null) { return(action); } //================================================= #2: FindApplication(node, action); var appNode = FindApplication(contextNode, actionName, appNodePath, actionContext.DeviceName); if (appNode == null) { return(factory.CreateRewriteAction(actionContext, contextNode, null, GetRewritePath(contextNode, portalContext))); } portalContext.BackwardCompatibility_SetPageRepositoryPath(appNode.Path); //----------------------------------------------- //TODO: appNode external page check? //----------------------------------------------- AppNode is IHttpHandlerNode action = GetIHttpHandlerAction(factory, portalContext, contextNode, appNode); if (action != null) { return(action); } //----------------------------------------------- page and site return(factory.CreateRewriteAction(actionContext, contextNode, appNode, GetRewritePath(appNode, portalContext))); }
public HttpActor(HttpActorType type, IQQContext context, IHttpAction action, long current, long total) { _type = type; _context = context; _action = action; _current = current; _total = total; }
public HttpActor(HttpActorType type, IQQContext context, IHttpAction action, Exception throwable) { _type = type; _context = context; _action = action; _throwable = throwable; }
protected BaseSaveDocumentCollection(IHttpAction action, ICouchConfiguration configuration, ISerializationProvider serializer) : base(action, configuration, serializer) { }
public HttpActor(HttpActorType type, IQQContext context, IHttpAction action, QQHttpResponse response) { _type = type; _context = context; _action = action; _response = response; }
public HttpAdaptor(QQContext context, IHttpAction action) { this.context = context; this.action = action; }
public SaveDocumentListCommand(IHttpAction action, ICouchConfiguration configuration, ISerializationProvider serializer) : base(action, configuration, serializer) { }
protected static void WireUpCommandMock(IHttpAction commandMock) { var mock = Assimilate.GetAllInstancesOf <IHttpAction>(); Assimilate.Dependencies(x => x.For <IHttpAction>().Use(commandMock)); }
protected BaseCouchCommand(IHttpAction action, ICouchConfiguration configuration, ISerializationProvider serializer) { this.action = action; this.configuration = configuration; this.serializer = serializer; }
public GetAllDocumentsCommand(IHttpAction action, ICouchConfiguration configuration, ISerializationProvider serializer) : base(action, configuration, serializer) { }
public QQActionFuture PushHttpAction(IHttpAction action) { QQActionFuture future = new HttpActionFuture(action); //替换掉原始的QQActionListener this.Context.PushActor(new HttpActor(HttpActorType.BUILD_REQUEST, this.Context, action)); return future; }