Examples of MultivaluedMapImpl


Examples of com.sun.jersey.core.util.MultivaluedMapImpl

    public void updateWorkflowNodeStatus(WorkflowInstanceNode workflowNode,
                                         WorkflowExecutionStatus.State executionStatus) {
        webResource = getProvenanceRegistryBaseResource().path(
                ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_WORKFLOWNODE_STATUS);
        MultivaluedMap formParams = new MultivaluedMapImpl();
        formParams.add("workflowInstanceId",
                workflowNode.getWorkflowInstance().getWorkflowExecutionId());
        formParams.add("nodeId", workflowNode.getNodeId());
        formParams.add("executionStatus", executionStatus.name());
        builder = BasicAuthHeaderUtil.getBuilder(
                webResource, null, userName, null, cookie, gateway);

        ClientResponse response = builder.accept(
                MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
View Full Code Here

Examples of com.sun.jersey.core.util.MultivaluedMapImpl

    }

    public NodeExecutionStatus getWorkflowNodeStatus(WorkflowInstanceNode workflowNode) {
        webResource = getProvenanceRegistryBaseResource().path(
                ResourcePathConstants.ProvenanceResourcePathConstants.GET_WORKFLOWNODE_STATUS);
        MultivaluedMap queryParams = new MultivaluedMapImpl();
        queryParams.add("workflowInstanceId", workflowNode.getWorkflowInstance().getWorkflowExecutionId());
        queryParams.add("nodeId", workflowNode.getNodeId());
        builder = BasicAuthHeaderUtil.getBuilder(
                webResource, queryParams, userName, null, cookie, gateway);

        ClientResponse response = builder.accept(
                MediaType.APPLICATION_JSON).get(ClientResponse.class);
View Full Code Here

Examples of com.sun.jersey.core.util.MultivaluedMapImpl

  @Test
  public void testCreateNewTodoWithEmail() {
    final String EMAIL = "john@example.com";

    MultivaluedMap<String, String> arguments = new MultivaluedMapImpl();
    arguments.add("email", EMAIL);

    ClientResponse response = client().resource("/todos")
        .type(MediaType.APPLICATION_FORM_URLENCODED)
        .post(ClientResponse.class, arguments);
    assertThat(response.getStatus()).isEqualTo(Response.Status.CREATED.getStatusCode());
View Full Code Here

Examples of com.sun.jersey.core.util.MultivaluedMapImpl

            }
        }

        //we also created a route to go with this rule. That needs to be
        //deleted as well.
        for (Route route : providerRouter.getRoutes(new MultivaluedMapImpl())) {
            String routeDstAddr = route.getDstNetworkAddr();
            if (routeDstAddr != null && routeDstAddr.equals(floatingIp)) {
                route.delete();
            }
        }
View Full Code Here

Examples of com.sun.jersey.core.util.MultivaluedMapImpl

                // Set route from router to bridge for this particular IP. Prepare
                // is called in both starting a new VM and restarting a VM, so the
                // NIC may
                boolean routeExists = false;
                for (Route route : providerRouter.getRoutes(new MultivaluedMapImpl())) {
                    String ip4 = route.getDstNetworkAddr();
                    if (ip4 != null && ip4.equals(nic.getIp4Address())) {
                        routeExists = true;
                        break;
                    }
View Full Code Here

Examples of org.apache.clerezza.triaxrs.util.MultivaluedMapImpl

      MediaType mediaType,
      MultivaluedMap<String, String> httpHeaders,
      InputStream entityStream) throws IOException,
      WebApplicationException {

    MultivaluedMap<String, String> map = new MultivaluedMapImpl();
    String string = ProviderUtils.readFromStreamAsString(entityStream, mediaType);
    StringTokenizer tokenizer = new StringTokenizer(string, "&");
    String token;
    while (tokenizer.hasMoreTokens()) {
      token = tokenizer.nextToken();
      int idx = token.indexOf('=');
      if (idx < 0) {
        map.add(URLDecoder.decode(token, "UTF-8"), null);
      } else if (idx > 0) {
        map.add(URLDecoder.decode(token.substring(0, idx), "UTF-8"),
            URLDecoder.decode(token.substring(idx + 1), "UTF-8"));
      }
    }
    return map;
  }
View Full Code Here

Examples of org.apache.wink.common.internal.MultivaluedMapImpl

    @Test
    public void testAccessControlAllowMethodTest() {
        ServletContext context = new MockServletContext();
        context.setAttribute(CorsConstants.CORS_ORIGIN, Collections.singleton("*"));
        MultivaluedMap<String,String> header = new MultivaluedMapImpl();
        header.add("Origin", "https://issues.apache.org/jira/browse/STANBOL-616");
        header.put("Access-Control-Request-Headers", Arrays.asList("Origin", "Content-Type", "Accept"));
        header.add("Access-Control-Request-Method", "PUT");
        HttpHeaders requestHeaders = new MockHttpHeaders(header);

        ResponseBuilder builder = Response.ok("Test");
        CorsHelper.enableCORS(context, builder, requestHeaders, OPTIONS, GET, POST, PUT);
        Response response = builder.build();
View Full Code Here

Examples of org.exoplatform.services.rest.impl.MultivaluedMapImpl

      Map<String, List<String>> headers, byte[] data, ContainerResponseWriter writer, EnvironmentContext env)
      throws Exception
   {

      if (headers == null)
         headers = new MultivaluedMapImpl();

      ByteArrayInputStream in = null;
      if (data != null)
         in = new ByteArrayInputStream(data);
View Full Code Here

Examples of org.exoplatform.services.rest.impl.MultivaluedMapImpl

    * @param decode if true then query parameters will be decoded
    * @return {@link MultivaluedMap} with query parameters
    */
   public static MultivaluedMap<String, String> parseQueryString(String rawQuery, boolean decode)
   {
      MultivaluedMap<String, String> m = new MultivaluedMapImpl();
      if (rawQuery == null || rawQuery.length() == 0)
         return m;

      int p = 0;
      int n = 0;
      while (n < rawQuery.length())
      {
         n = rawQuery.indexOf('&', p);
         if (n == -1)
            n = rawQuery.length();

         String pair = rawQuery.substring(p, n);
         if (pair.length() == 0)
            continue;

         String name;
         String value = ""; // default value
         int eq = pair.indexOf('=');
         if (eq == -1) // no value, default is ""
            name = pair;
         else
         {
            name = pair.substring(0, eq);
            value = pair.substring(eq + 1);
         }

         m.add(decode ? decode(name, QUERY) : name, decode ? decode(value, QUERY) : value);

         p = n + 1;
      }

      return m;
View Full Code Here

Examples of org.exoplatform.services.rest.impl.MultivaluedMapImpl

    */
   public MultivaluedMap<String, String> getProperties()
   {
      if (properties == null)
      {
         properties = new MultivaluedMapImpl();
      }
      return properties;
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.