Coverage Report - org.mule.endpoint.EndpointURIEndpointBuilder
 
Classes in this File Line Coverage Branch Coverage Complexity
EndpointURIEndpointBuilder
0%
0/46
0%
0/4
0
 
 1  
 /*
 2  
  * $Id: EndpointURIEndpointBuilder.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.endpoint;
 12  
 
 13  
 import org.mule.api.MuleContext;
 14  
 import org.mule.api.endpoint.EndpointException;
 15  
 import org.mule.api.endpoint.EndpointURI;
 16  
 import org.mule.api.endpoint.ImmutableEndpoint;
 17  
 import org.mule.api.processor.MessageProcessor;
 18  
 
 19  
 import java.util.Collections;
 20  
 
 21  
 public class EndpointURIEndpointBuilder extends AbstractEndpointBuilder
 22  
 {
 23  
 
 24  
     public EndpointURIEndpointBuilder()
 25  
     {
 26  0
         super();
 27  0
     }
 28  
 
 29  
     /**
 30  
      * Called from Spring
 31  
      * 
 32  
      * @param global The global endpoint "Policy"
 33  
      */
 34  
     public EndpointURIEndpointBuilder(EndpointURIEndpointBuilder global) throws EndpointException
 35  
     {
 36  0
         super();
 37  
         
 38  
         // can't (concisely) use setters where null is a possibility
 39  
         // for consistency, set directly on all fields (this also avoids logic in
 40  
         // getters)
 41  0
         uriBuilder = global.uriBuilder;
 42  0
         connector = global.connector;
 43  0
         name = global.name; // this seems a bit odd, but is tested for in the big
 44  
                             // spring config test case
 45  0
         properties = global.properties;
 46  0
         transactionConfig = global.transactionConfig;
 47  0
         deleteUnacceptedMessages = global.deleteUnacceptedMessages;
 48  0
         synchronous = global.synchronous;
 49  0
         messageExchangePattern = global.messageExchangePattern;
 50  0
         responseTimeout = global.responseTimeout;
 51  0
         encoding = global.encoding;
 52  0
         retryPolicyTemplate = global.retryPolicyTemplate;
 53  0
         messageProcessors = global.messageProcessors;
 54  0
         responseMessageProcessors = global.responseMessageProcessors;
 55  0
         mimeType = global.mimeType;
 56  0
         disableTransportTransformer = global.disableTransportTransformer;
 57  0
         transformers = global.transformers;
 58  0
         responseTransformers = global.responseTransformers;
 59  
 
 60  0
     }
 61  
 
 62  
     public EndpointURIEndpointBuilder(URIBuilder builder)
 63  
     {
 64  0
         super();
 65  0
         this.uriBuilder = builder;
 66  0
         this.muleContext = builder.getMuleContext();
 67  0
     }
 68  
 
 69  
     public EndpointURIEndpointBuilder(String address, MuleContext muleContext)
 70  
     {
 71  0
         this(new URIBuilder(address, muleContext));
 72  0
     }
 73  
 
 74  
     protected EndpointURIEndpointBuilder(EndpointURI endpointURI)
 75  
     {
 76  0
         this(new URIBuilder(endpointURI));
 77  0
     }
 78  
 
 79  
     public EndpointURIEndpointBuilder(ImmutableEndpoint source)
 80  
     {
 81  0
         this(source.getEndpointURI());
 82  0
         setName(source.getName());
 83  0
         setEncoding(source.getEncoding());
 84  0
         setConnector(source.getConnector());
 85  0
         setProperties(source.getProperties());
 86  0
         setTransactionConfig(source.getTransactionConfig());
 87  0
         setDeleteUnacceptedMessages(source.isDeleteUnacceptedMessages());
 88  0
         setInitialState(source.getInitialState());
 89  0
         setResponseTimeout(source.getResponseTimeout());
 90  0
         setRetryPolicyTemplate(source.getRetryPolicyTemplate());
 91  0
         setExchangePattern(source.getExchangePattern());
 92  0
         setMuleContext(source.getMuleContext());
 93  0
         setMessageProcessors(source.getMessageProcessors().isEmpty() ? Collections.<MessageProcessor>emptyList() : source.getMessageProcessors());
 94  0
         setResponseMessageProcessors(source.getResponseMessageProcessors().isEmpty() ? Collections.<MessageProcessor>emptyList() : source.getResponseMessageProcessors());
 95  0
         setDisableTransportTransformer(source.isDisableTransportTransformer());
 96  0
         setMimeType(source.getMimeType());
 97  0
     }
 98  
 }