View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.transport.email.config;
8   
9   import org.mule.config.spring.handlers.AbstractMuleNamespaceHandler;
10  import org.mule.config.spring.parsers.MuleDefinitionParserConfiguration;
11  import org.mule.config.spring.parsers.specific.tls.ClientKeyStoreDefinitionParser;
12  import org.mule.config.spring.parsers.specific.tls.TrustStoreDefinitionParser;
13  import org.mule.endpoint.URIBuilder;
14  import org.mule.transport.email.ImapsConnector;
15  
16  /**
17   * Registers a Bean Definition Parser for handling <code><imaps:connector></code> elements.
18   *
19   */
20  public class ImapsNamespaceHandler extends AbstractMuleNamespaceHandler
21  {
22      public void init()
23      {
24          registerStandardTransportEndpoints(ImapsConnector.IMAPS, URIBuilder.USERHOST_ATTRIBUTES);
25  
26          MuleDefinitionParserConfiguration parser = registerConnectorDefinitionParser(ImapsConnector.class);
27          parser.addMapping("defaultProcessMessageAction", EmailNamespaceHandler.DEFAULT_PROCESS_MESSAGE_ACTION);
28  
29          registerBeanDefinitionParser("tls-trust-store", new TrustStoreDefinitionParser());
30          registerBeanDefinitionParser("tls-client", new ClientKeyStoreDefinitionParser());
31      }
32  }