Package org.mule.api.endpoint

Examples of org.mule.api.endpoint.ImmutableEndpoint


        assertTrue(resolver.isTopic(endpoint, true));
    }

    public void testEndpointTopicPrefixAndPropertyNoFallback() throws Exception
    {
        ImmutableEndpoint endpoint = muleContext.getEndpointFactory().getInboundEndpoint("ep4");
        assertTrue(resolver.isTopic(endpoint, false));
    }
View Full Code Here


        assertTrue(resolver.isTopic(endpoint, false));
    }

    public void testEndpointTopicUsesEndpointProperties() throws Exception
    {
        ImmutableEndpoint endpoint = muleContext.getEndpointFactory().getInboundEndpoint("ep5");
        assertTrue(resolver.isTopic(endpoint));
    }
View Full Code Here

        assertTrue(resolver.isTopic(endpoint));
    }

    public void testEndpointTopicWithLeadingSlash() throws Exception
    {
        ImmutableEndpoint endpoint = muleContext.getEndpointFactory().getInboundEndpoint("ep6");
        assertTrue(resolver.isTopic(endpoint));
    }
View Full Code Here

        assertTrue(resolver.isTopic(endpoint));
    }

    public void testEndpointTopicWithSlashes() throws Exception
    {
        ImmutableEndpoint endpoint = muleContext.getEndpointFactory().getInboundEndpoint("ep7");
        assertTrue(resolver.isTopic(endpoint));
    }
View Full Code Here

        assertEquals("-1", endpoint.getProperty("queryTimeout"));
    }
   
    public void testEndpointWithXaTransaction() throws Exception
    {
        ImmutableEndpoint endpoint = muleContext.getRegistry().
            lookupEndpointBuilder("endpointWithXaTransaction").buildInboundEndpoint();
        assertNotNull(endpoint);
        assertEquals(XaTransactionFactory.class,
            endpoint.getTransactionConfig().getFactory().getClass());
        assertEquals(MuleTransactionConfig.ACTION_ALWAYS_BEGIN,
            endpoint.getTransactionConfig().getAction());
    }
View Full Code Here

        assertTrue(resolver.isTopic(endpoint));
    }

    public void testEndpointQueueWithSlashes() throws Exception
    {
        ImmutableEndpoint endpoint = muleContext.getEndpointFactory().getInboundEndpoint("ep8");
        assertFalse(resolver.isTopic(endpoint));
    }
View Full Code Here

            .startsWith("Error during login to"));

        SftpClient sftpClient = getSftpClient(muleClient, INBOUND_ENDPOINT_NAME);
        try
        {
            ImmutableEndpoint endpoint = (ImmutableEndpoint) muleClient.getProperty(INBOUND_ENDPOINT_NAME);
            assertTrue("The inbound file should still exist", super.verifyFileExists(sftpClient,
                endpoint.getEndpointURI(), FILE_NAME));
        }
        finally
        {
            sftpClient.disconnect();
        }
View Full Code Here

                sync = false;
            }
       
            // Get the dispatch endpoint
            String uri = msgContext.getStrProp(MessageContext.TRANS_URL);
            ImmutableEndpoint requestEndpoint = (ImmutableEndpoint)call
                .getProperty(MuleProperties.MULE_ENDPOINT_PROPERTY);
           
            OutboundEndpoint endpoint;
       
            // put username and password in URI if they are set on the current event
            if (msgContext.getUsername() != null)
            {
                String[] tempEndpoint = uri.split("//");
                String credentialString = msgContext.getUsername() + ":"
                                          + msgContext.getPassword();
                uri = tempEndpoint[0] + "//" + credentialString + "@" + tempEndpoint[1];
                endpoint = lookupEndpoint(uri);
            }
            else
            {
                endpoint = lookupEndpoint(uri);
            }

            if (requestEndpoint.getConnector() instanceof AxisConnector)
            {
                msgContext.setTypeMappingRegistry(((AxisConnector)requestEndpoint.getConnector())
                    .getAxis().getTypeMappingRegistry());
            }
           
            Map<String, Object> props = new HashMap<String, Object>();
            Object payload;
            int contentLength = 0;
            String contentType = null;
            if (msgContext.getRequestMessage().countAttachments() > 0)
            {
                File temp = File.createTempFile("soap", ".tmp");
                temp.deleteOnExit(); // TODO cleanup files earlier (IOUtils has a
                // file tracker)
                FileOutputStream fos = new FileOutputStream(temp);
                msgContext.getRequestMessage().writeTo(fos);
                fos.close();
                contentLength = (int)temp.length();
                payload = new FileInputStream(temp);
                contentType = "multipart/related";
            }
            else
            {
                ByteArrayOutputStream baos = new ByteArrayOutputStream(8192);
                msgContext.getRequestMessage().writeTo(baos);
                baos.close();
                payload = baos.toByteArray();
            }

            // props.putAll(event.getProperties());
            for (Iterator iterator = msgContext.getPropertyNames(); iterator.hasNext();)
            {
                String name = (String)iterator.next();
                if (!name.equals("call_object") && !name.equals("wsdl.service"))
                {
                    props.put(name, msgContext.getProperty(name));
                }
            }

            // add all custom headers, filter out all mule headers (such as
            // MULE_SESSION) except
            // for MULE_USER header. Filter out other headers like "soapMethods" and
            // MuleProperties.MULE_METHOD_PROPERTY and "soapAction"
            // and also filter out any http related header
            if ((RequestContext.getEvent() != null)
                && (RequestContext.getEvent().getMessage() != null))
            {
                props = AxisCleanAndAddProperties.cleanAndAdd(RequestContext.getEventContext());
            }
           
            // with jms and vm the default SOAPAction will result in the name of the endpoint, which we may not necessarily want. This should be set manually on the endpoint
            String scheme = requestEndpoint.getEndpointURI().getScheme();
            if (!("vm".equalsIgnoreCase(scheme) || "jms".equalsIgnoreCase(scheme)))
            {
                if (call.useSOAPAction())
                {
                    uri = call.getSOAPActionURI();
View Full Code Here

            OutboundRouter r = (OutboundRouter)iterator.next();
            for (MessageProcessor mp : r.getRoutes())
            {
                if (mp instanceof ImmutableEndpoint)
                {
                    ImmutableEndpoint endpoint = (ImmutableEndpoint) mp;
                    endpointsCache.put(endpoint.getEndpointURI().getAddress(), endpoint);
                }
            }
        }
    }
View Full Code Here

            assertEquals("Permission denied", exception.getCause().getMessage());

            verifyInAndOutFiles(muleClient, INBOUND_ENDPOINT_NAME, OUTBOUND_ENDPOINT_NAME, true, false);

            ImmutableEndpoint endpoint = (ImmutableEndpoint) muleClient.getProperty(OUTBOUND_ENDPOINT_NAME);
            assertFalse("The inbound file should not be left in the TEMP-dir", super.verifyFileExists(
                sftpClient, endpoint.getEndpointURI().getPath() + "/" + TEMP_DIR, FILE_NAME));
        }
        finally
        {
            sftpClient.disconnect();
        }
View Full Code Here

TOP

Related Classes of org.mule.api.endpoint.ImmutableEndpoint

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.