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);
}
});
}
};
}
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);
}
};
}
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);
}
};
}
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);
}
};
}
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;
}
Aggregations