Exemple #1
0
    public static SocketRequest createHttpRequestInstance(RequestType type, BaseRequestParam reqParam)
    {
        SocketRequest req = new SocketRequest(type, swInfo, Convert.ToString(platformId));

        if (reqParam != null && Enum.IsDefined(typeof(RequestType), type))
        {
            RelationShipReqAndResp preDef = PreDefined[type];
            if (preDef != null)
            {
                req.setParameter(SocketRequest.ACTION, preDef.requestAction);
                req.appendPara(reqParam);
            }
            else
            {
                throw new DragonException("Dictionary PreDefined is not defined.");
            }
        }
        else
        {
            throw new DragonException(DragonException.Exception_Message[DragonException.INVALIDATE_ARGUMENT]);
        }
        return(req);
    }
Exemple #2
0
 /*
  * This is for creating Common Http Task
  */
 public virtual void AppendCommonParam(RequestType requestType, BaseRequestParam param)
 {
     this.request           = HttpRequestFactory.createHttpRequestInstance(requestType, param);
     this.relation          = HttpRequestFactory.getRelationShip(requestType);
     this.OutFilter.request = requestType;
 }
Exemple #3
0
 /*
  * This is for creating Common Socket Task
  */
 public void AppendCommonParam(RequestType requestType, BaseRequestParam param)
 {
     this.request  = SocketRequestFactory.createHttpRequestInstance(requestType, param);
     this.relation = SocketRequestFactory.getRelationShip(requestType);
 }