Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MSExchangeConfig implements FactoryBean<ExchangeService> {
- .
- .
- .
- @Override
- public ExchangeService getObject() throws Exception {
- ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP2);
- ExchangeCredentials credentials = new WebCredentials(getUsername(), getPassword());
- service.setCredentials(credentials);
- try {
- service.setUrl(new URI(getUri()));
- } catch (URISyntaxException ex) {
- logger.error("URL problem when connecting to Exchange");
- logger.trace("{}", ex);
- throw new ExchangeServiceNotBuiltException();
- }
- return service;
- }
- @Override
- public Class<ExchangeService> getObjectType() {
- return ExchangeService.class;
- }
- @Override
- public boolean isSingleton() {
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment