this.endpoint = endpoint;
// support to set the delay from JIRA Endpoint
setDelay(endpoint.getDelay());
JerseyJiraRestClientFactory factory;
Registry registry = endpoint.getCamelContext().getRegistry();
Object target = registry.lookupByName("JerseyJiraRestClientFactory");
if (target != null) {
LOG.debug("JerseyJiraRestClientFactory found in registry " + target.getClass().getCanonicalName());
factory = (JerseyJiraRestClientFactory) target;
} else {
factory = new JerseyJiraRestClientFactory();
}
final URI jiraServerUri = URI.create(endpoint.getServerUrl());
client = factory.createWithBasicHttpAuthentication(jiraServerUri, endpoint.getUsername(),
endpoint.getPassword());
}