Examples of MultivaluedMap


Examples of javax.ws.rs.core.MultivaluedMap

    public void updateWorkflowNodeType(WorkflowInstanceNode node,
                                       WorkflowNodeType type) {
        webResource = getProvenanceRegistryBaseResource().path(
                ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_WORKFLOWNODETYPE);
        MultivaluedMap formParams = new MultivaluedMapImpl();
        formParams.add("workflowInstanceId", node.getWorkflowInstance().getWorkflowExecutionId());
        formParams.add("nodeId", node.getNodeId());
        formParams.add("nodeType", type.getNodeType().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 javax.ws.rs.core.MultivaluedMap

    public void addWorkflowInstanceNode(String workflowInstance,
                                        String nodeId) {
        webResource = getProvenanceRegistryBaseResource().path(
                ResourcePathConstants.ProvenanceResourcePathConstants.ADD_WORKFLOWINSTANCENODE);
        MultivaluedMap formParams = new MultivaluedMapImpl();
        formParams.add("workflowInstanceId", workflowInstance);
        formParams.add("nodeId", nodeId);
        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 javax.ws.rs.core.MultivaluedMap

      // TODO: punt on redirects, for now.
      // if (httpMethod instanceof GetMethod && request.followRedirects())
      // httpMethod.setFollowRedirects(true);
      // else httpMethod.setFollowRedirects(false);

      MultivaluedMap headers = mockHttpRequest.getHttpHeaders().getRequestHeaders();
      headers.putAll(request.getHeaders());
      if (request.getBody() != null && !request.getFormParameters().isEmpty())
         throw new RuntimeException("You cannot send both form parameters and an entity body");

      for (Map.Entry<String, List<String>> formParam : request.getFormParameters().entrySet())
      {
View Full Code Here

Examples of javax.ws.rs.core.MultivaluedMap

      ByteArrayOutputStream baos = new ByteArrayOutputStream();

      MediaType bodyContentType = request.getBodyContentType();
      request.getHeaders().add(HttpHeaders.CONTENT_TYPE, bodyContentType.toString());
      MultivaluedMap mockHeaders = (MultivaluedMap) mockHttpRequest.getHttpHeaders().getRequestHeaders();
      request.writeRequestBody(mockHeaders, baos);

      mockHttpRequest.content(baos.toByteArray());
      mockHttpRequest.contentType(bodyContentType);
   }
View Full Code Here

Examples of javax.ws.rs.core.MultivaluedMap

         if (connection.getRequestProperty(CONTENT_TYPE) == null)
         {
            String type = request.getBodyContentType().toString();
            connection.addRequestProperty(CONTENT_TYPE, type);
         }
         MultivaluedMap headers = new URLConnectionHeaderWrapper(
                 connection, request.getProviderFactory());
         try
         {
            OutputStream os = connection.getOutputStream();
            request.writeRequestBody(headers, os);
View Full Code Here

Examples of javax.ws.rs.core.MultivaluedMap

    @SuppressWarnings("unchecked")
    @Test
    public void testJAXBMarshallingWithMap() throws WebApplicationException, IOException {
        assertTrue(jaxbProviderWriter.isWriteable(AddNumbers.class, null, null, MediaType.TEXT_XML_TYPE));
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        MultivaluedMap map = new CaseInsensitiveMultivaluedMap<Object>();
        jaxbProviderWriter.writeTo(new AddNumbers(), AddNumbers.class, null, null, MediaType.TEXT_XML_TYPE, map, baos);
        assertEquals(expectedXml, baos.toString());
    }
View Full Code Here

Examples of javax.ws.rs.core.MultivaluedMap

    protected RuleChain getChain(String networkId, String accountUuid,
                               String routerName, RuleChainCode chainCode){
        String chainName = getChainName(networkId, routerName, chainCode);

        MultivaluedMap findChain = new MultivaluedMapImpl();
        findChain.add("tenant_id", accountUuid);

        ResourceCollection<RuleChain> ruleChains = api.getChains(findChain);

        for(RuleChain chain : ruleChains){
            if(chain.getName().equals(chainName)){
View Full Code Here

Examples of javax.ws.rs.core.MultivaluedMap

        return netBridge;
    }

    private Bridge getNetworkBridge(long networkID, String accountUuid){

        MultivaluedMap qNetBridge = new MultivaluedMapImpl();
        String networkUUIDStr = String.valueOf(networkID);
        qNetBridge.add("tenant_id", accountUuid);

        for (Bridge b : this. api.getBridges(qNetBridge)) {
            if(b.getName().equals(networkUUIDStr)){
                return b;
            }
View Full Code Here

Examples of javax.ws.rs.core.MultivaluedMap

        return tenantRouter;
    }

    private Router getGuestNetworkRouter(long id, String accountUuid, boolean isVpc){

        MultivaluedMap qNetRouter = new MultivaluedMapImpl();
        String routerName = getRouterName(isVpc, id);

        qNetRouter.add("tenant_id", accountUuid);

        for (Router router : api.getRouters(qNetRouter)) {
            if(router.getName().equals(routerName)){
                return router;
            }
View Full Code Here

Examples of javax.ws.rs.core.MultivaluedMap

            /*
            * grab the tenant id and the network id from the Broadcast URI.
            * We need to pluck the values out of the String. The string
            * should look like "mido://[tenant_id].[bridge_name]"
            */
            MultivaluedMap qNet = new MultivaluedMapImpl();
            String nicAuthority= nic.getBroadcastUri().getAuthority();
            String tenantId = nicAuthority.split("\\.")[0];
            qNet.add("tenant_id", tenantId);
            String url = nicAuthority.split("\\.")[1];
            String netName = url.split(":")[0];

            MidonetApi api = new MidonetApi(_midoApiLocation);
            api.enableLogging();
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.