예제 #1
0
  public RestRequest cloneRequest(RestRequest request, String name) {
    RestRequestConfig requestConfig =
        (RestRequestConfig) getConfig().addNewRequest().set(request.getConfig());
    requestConfig.setName(name);

    RestRequest newRequest = new RestRequest(this, requestConfig, false);
    requests.add(newRequest);

    // getInterface().fireRequestAdded(newRequest);
    notifyPropertyChanged("childRequests", null, newRequest);
    return newRequest;
  }
예제 #2
0
  public RestRequest addNewRequest(String name) {
    RestRequestConfig requestConfig = getConfig().addNewRequest();
    requestConfig.setName(name);

    RestRequest request = new RestRequest(this, requestConfig, false);
    requests.add(request);
    request.resetPropertyValues();

    /*
     * for (RestParamProperty prop : getDefaultParams()) { if
     * (!request.hasProperty(prop.getName()))
     * request.addProperty(prop.getName()).setValue(prop.getDefaultValue()); }
     */

    String[] endpoints = getInterface().getEndpoints();
    if (endpoints.length > 0) request.setEndpoint(endpoints[0]);

    // getInterface().fireRequestAdded(request);
    notifyPropertyChanged("childRequests", null, request);
    return request;
  }