Coverage Report - org.mule.config.spring.parsers.specific.SecurityFilterDefinitionParser
 
Classes in this File Line Coverage Branch Coverage Complexity
SecurityFilterDefinitionParser
0%
0/9
N/A
1
 
 1  
 /*
 2  
  * $Id: SecurityFilterDefinitionParser.java 19191 2010-08-25 21:05:23Z tcarlson $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 5  
  *
 6  
  * The software in this package is published under the terms of the CPAL v1.0
 7  
  * license, a copy of which has been included with this distribution in the
 8  
  * LICENSE.txt file.
 9  
  */
 10  
 
 11  
 package org.mule.config.spring.parsers.specific;
 12  
 
 13  
 import org.mule.api.security.EndpointSecurityFilter;
 14  
 import org.mule.config.spring.parsers.AbstractMuleBeanDefinitionParser;
 15  
 import org.mule.config.spring.parsers.delegate.ParentContextDefinitionParser;
 16  
 import org.mule.config.spring.parsers.generic.MuleOrphanDefinitionParser;
 17  
 import org.mule.config.spring.parsers.generic.OrphanDefinitionParser;
 18  
 import org.mule.config.spring.parsers.generic.WrappingChildDefinitionParser;
 19  
 import org.mule.processor.SecurityFilterMessageProcessor;
 20  
 
 21  
 import org.w3c.dom.Element;
 22  
 
 23  
 /**
 24  
  * This allows a security filter to be defined globally, or embedded within an endpoint. The filter is
 25  
  * always wrapped in a SecurityFilterMessageProcessorBuilder instance before being injected into the parent.
 26  
  */
 27  
 public class SecurityFilterDefinitionParser extends ParentContextDefinitionParser  implements WrappingChildDefinitionParser.WrappingController
 28  
 {
 29  
 
 30  
     public static final String SECURITY_FILTER = "filter";
 31  
     public static final String ATTRIBUTE_NAME = AbstractMuleBeanDefinitionParser.ATTRIBUTE_NAME;
 32  
 
 33  
     public SecurityFilterDefinitionParser(Class filter)
 34  
     {
 35  0
         super(MuleOrphanDefinitionParser.ROOT_ELEMENT, new OrphanDefinitionParser(filter, false));
 36  0
         otherwise(
 37  
             new WrappingChildDefinitionParser(
 38  
                 "messageProcessor", filter, EndpointSecurityFilter.class, false, SecurityFilterMessageProcessor.class,
 39  
                 SECURITY_FILTER, SECURITY_FILTER, this));
 40  0
         addIgnored(ATTRIBUTE_NAME);
 41  0
     }
 42  
 
 43  
     public SecurityFilterDefinitionParser()
 44  
     {
 45  0
         super(MuleOrphanDefinitionParser.ROOT_ELEMENT, new OrphanDefinitionParser(false));
 46  0
         otherwise(
 47  
             new WrappingChildDefinitionParser(
 48  
                 "messageProcessor", null, EndpointSecurityFilter.class, true, SecurityFilterMessageProcessor.class,
 49  
                 SECURITY_FILTER, SECURITY_FILTER, this));
 50  0
         addIgnored(ATTRIBUTE_NAME);
 51  0
     }
 52  
 
 53  
     public boolean shouldWrap(Element elm)
 54  
     {
 55  0
         return true;
 56  
     }
 57  
 }