Search in sources :

Example 1 with URI

use of java.net.URI in project camel by apache.

the class CometdProducerConsumerInOutInteractiveMain method createRouteBuilder.

private RouteBuilder createRouteBuilder() {
    return new RouteBuilder() {

        public void configure() {
            CometdComponent component = (CometdComponent) context.getComponent("cometds");
            component.setSslPassword(pwd);
            component.setSslKeyPassword(pwd);
            File file = new File("./src/test/resources/jsse/localhost.ks");
            URI keyStoreUrl = file.toURI();
            component.setSslKeystore(keyStoreUrl.getPath());
            from(URI, URIS).setExchangePattern(ExchangePattern.InOut).process(new Processor() {

                public void process(Exchange exchange) throws Exception {
                    Message out = new DefaultMessage();
                    out.setBody("reply: " + exchange.getIn().getBody());
                    exchange.setOut(out);
                }
            });
        }
    };
}
Also used : Exchange(org.apache.camel.Exchange) DefaultMessage(org.apache.camel.impl.DefaultMessage) Processor(org.apache.camel.Processor) RouteBuilder(org.apache.camel.builder.RouteBuilder) Message(org.apache.camel.Message) DefaultMessage(org.apache.camel.impl.DefaultMessage) File(java.io.File) URI(java.net.URI)

Example 2 with URI

use of java.net.URI in project camel by apache.

the class CometdProducerConsumerInteractiveAuthenticatedMain method createRouteBuilder.

private RouteBuilder createRouteBuilder() {
    return new RouteBuilder() {

        public void configure() {
            CometdComponent component = (CometdComponent) context.getComponent("cometds");
            component.setSslPassword(pwd);
            component.setSslKeyPassword(pwd);
            CometdComponent component2 = (CometdComponent) context.getComponent("cometd");
            BayeuxAuthenticator bayeuxAuthenticator = new BayeuxAuthenticator();
            component2.setSecurityPolicy(bayeuxAuthenticator);
            component2.addExtension(bayeuxAuthenticator);
            File file = new File("./src/test/resources/jsse/localhost.ks");
            URI keyStoreUrl = file.toURI();
            component.setSslKeystore(keyStoreUrl.getPath());
            from("stream:in").to(URI).to(URIS);
        }
    };
}
Also used : RouteBuilder(org.apache.camel.builder.RouteBuilder) File(java.io.File) URI(java.net.URI)

Example 3 with URI

use of java.net.URI in project camel by apache.

the class CometdProducerConsumerInteractiveExtensionMain method createRouteBuilder.

private RouteBuilder createRouteBuilder() {
    return new RouteBuilder() {

        public void configure() {
            CometdComponent component = (CometdComponent) context.getComponent("cometds");
            component.setSslPassword(pwd);
            component.setSslKeyPassword(pwd);
            CometdComponent component2 = (CometdComponent) context.getComponent("cometd");
            Censor bayeuxAuthenticator = new Censor();
            component2.addExtension(bayeuxAuthenticator);
            File file = new File("./src/test/resources/jsse/localhost.ks");
            URI keyStoreUrl = file.toURI();
            component.setSslKeystore(keyStoreUrl.getPath());
            from("stream:in").to(URI).to(URIS);
        }
    };
}
Also used : RouteBuilder(org.apache.camel.builder.RouteBuilder) File(java.io.File) URI(java.net.URI)

Example 4 with URI

use of java.net.URI in project camel by apache.

the class CometdProducerConsumerInteractiveMain method createRouteBuilder.

private RouteBuilder createRouteBuilder() {
    return new RouteBuilder() {

        public void configure() {
            CometdComponent component = (CometdComponent) context.getComponent("cometds");
            component.setSslPassword(pwd);
            component.setSslKeyPassword(pwd);
            File file = new File("./src/test/resources/jsse/localhost.ks");
            URI keyStoreUrl = file.toURI();
            component.setSslKeystore(keyStoreUrl.getPath());
            from("stream:in").to(URI).to(URIS);
        }
    };
}
Also used : RouteBuilder(org.apache.camel.builder.RouteBuilder) File(java.io.File) URI(java.net.URI)

Example 5 with URI

use of java.net.URI in project camel by apache.

the class CoAPProducer method getClient.

private synchronized CoapClient getClient(Exchange exchange) {
    if (client == null) {
        URI uri = exchange.getIn().getHeader("coapUri", URI.class);
        if (uri == null) {
            uri = endpoint.getUri();
        }
        client = new CoapClient(uri);
    }
    return client;
}
Also used : URI(java.net.URI) CoapClient(org.eclipse.californium.core.CoapClient)

Aggregations

URI (java.net.URI)5680 Test (org.junit.Test)1852 URISyntaxException (java.net.URISyntaxException)1016 IOException (java.io.IOException)749 File (java.io.File)531 HashMap (java.util.HashMap)458 ArrayList (java.util.ArrayList)452 Test (org.testng.annotations.Test)394 Configuration (org.apache.hadoop.conf.Configuration)321 Path (org.apache.hadoop.fs.Path)267 URL (java.net.URL)266 Map (java.util.Map)262 Response (javax.ws.rs.core.Response)218 List (java.util.List)184 InputStream (java.io.InputStream)154 HashSet (java.util.HashSet)136 FileSystem (org.apache.hadoop.fs.FileSystem)135 RequestContext (com.linkedin.r2.message.RequestContext)129 RestRequestBuilder (com.linkedin.r2.message.rest.RestRequestBuilder)128 RestRequest (com.linkedin.r2.message.rest.RestRequest)112