Package com.openshift.internal.client.httpclient.request

Examples of com.openshift.internal.client.httpclient.request.ParameterValueMap


  protected static class Parameters {
       
    private List<Parameter> parameters = new ArrayList<Parameter>();
   
    protected Parameters addCartridge(IEmbeddableCartridge embeddable) {
      ParameterValueMap parameter = createCartridgeParameter(embeddable);
      return add(new Parameter(IOpenShiftJsonConstants.PROPERTY_CARTRIDGE, parameter));
    }
View Full Code Here


        parameters.add(createEnvironmentVariableParameter(environmentVariable.getKey(),environmentVariable.getValue()));
      }
      return parameters;
    }
    private ParameterValueMap createEnvironmentVariableParameter(String name,String value){
            ParameterValueMap parameters = new ParameterValueMap();
      parameters.add(IOpenShiftJsonConstants.PROPERTY_NAME,name)
      .add(IOpenShiftJsonConstants.PROPERTY_VALUE, value);
      return parameters;
    }
View Full Code Here

     * @param cartridge the cartridge that a request parameter shall get created for
     * @return the parameter
     */
    private ParameterValueMap createCartridgeParameter(ICartridge cartridge) {
      if (cartridge.isDownloadable()) {
        return new ParameterValueMap().add(IOpenShiftJsonConstants.PROPERTY_URL, UrlUtils.toString(cartridge.getUrl()));
      } else {
        return new ParameterValueMap().add(IOpenShiftJsonConstants.PROPERTY_NAME, cartridge.getName());
      }
    }
View Full Code Here

          || cartridges.length == 0) {
        return parameters;
      }
     
      for (ICartridge cartridge : cartridges) {
        ParameterValueMap parameter = createCartridgeParameter(cartridge);
        if (parameter != null) {
          parameters.add(parameter);
        }
      }
     
View Full Code Here

  }

  protected String request(HttpMethod httpMethod, URL url, IMediaType requestMediaType, int timeout,
      Parameter... parameters)
      throws SocketTimeoutException, HttpClientException {
    return request(httpMethod, url, requestMediaType, timeout, new ParameterValueMap(parameters));
  }
View Full Code Here

    }
    try {
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      out.write(url.getBytes());
      out.write(IHttpClient.QUESTION_MARK);
      new FormUrlEncodedMediaType().writeTo(new ParameterValueMap(urlParameters), out);
      return out.toString();
    } catch (IOException e) {
      throw new OpenShiftException(e, "Could not add paramters {0} to url {1}", urlParameters, url);
    } catch (EncodingException e) {
      throw new OpenShiftException(e, "Could not add paramters {0} to url {1}", urlParameters, url);
View Full Code Here

  }

  protected String request(HttpMethod httpMethod, URL url, IMediaType requestMediaType, int timeout,
      Parameter... parameters)
      throws SocketTimeoutException, HttpClientException {
    return request(httpMethod, url, requestMediaType, timeout, new ParameterValueMap(parameters));
  }
View Full Code Here

  }

  protected String request(HttpMethod httpMethod, URL url, IMediaType requestMediaType, int timeout,
      Parameter... parameters)
      throws SocketTimeoutException, HttpClientException {
    return request(httpMethod, url, requestMediaType, timeout, new ParameterValueMap(parameters));
  }
View Full Code Here

    if (parameters == null
        || parameters.length == 0) {
      return null;
    }
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    mediaType.writeTo(new ParameterValueMap(parameters), out);
    return out.toString();
  }
View Full Code Here

    }
    try {
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      out.write(url.getBytes());
      out.write(IHttpClient.QUESTION_MARK);
      new FormUrlEncodedMediaType().writeTo(new ParameterValueMap(urlParameters), out);
      return out.toString();
    } catch (IOException e) {
      throw new OpenShiftException(e, "Could not add paramters {0} to url {1}", urlParameters, url);
    } catch (EncodingException e) {
      throw new OpenShiftException(e, "Could not add paramters {0} to url {1}", urlParameters, url);
View Full Code Here

TOP

Related Classes of com.openshift.internal.client.httpclient.request.ParameterValueMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.