View Javadoc

1   /*
2    * $Id: EndpointBuilder.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.api.endpoint;
12  
13  import org.mule.MessageExchangePattern;
14  import org.mule.api.MuleContext;
15  import org.mule.api.context.MuleContextAware;
16  import org.mule.api.lifecycle.InitialisationException;
17  import org.mule.api.processor.MessageProcessor;
18  import org.mule.api.retry.RetryPolicyTemplate;
19  import org.mule.api.security.EndpointSecurityFilter;
20  import org.mule.api.transaction.TransactionConfig;
21  import org.mule.api.transformer.Transformer;
22  import org.mule.api.transport.Connector;
23  import org.mule.endpoint.URIBuilder;
24  
25  import java.util.List;
26  import java.util.Map;
27  
28  /**
29   * Constructs endpoints. Transport specific endpoints can easily resolve the Endpoint implementation to be
30   * uses, for generic endpoints we can either resolve the transport from uri string or use a default
31   * implementation.
32   */
33  public interface EndpointBuilder extends MuleContextAware, Cloneable
34  {
35  
36      /**
37       * Constructs inbound endpoints
38       * 
39       * @throws EndpointException
40       * @throws InitialisationException
41       */
42      InboundEndpoint buildInboundEndpoint() throws EndpointException, InitialisationException;
43  
44      /**
45       * Constructs outbound endpoints
46       * 
47       * @throws EndpointException
48       * @throws InitialisationException
49       */
50      OutboundEndpoint buildOutboundEndpoint() throws EndpointException, InitialisationException;
51  
52      void setConnector(Connector connector);
53  
54      /** @deprecated Use addMessageProcessor() */
55      void addTransformer(Transformer transformer);
56  
57      /** @deprecated Use addResponseMessageProcessor() */
58      void addResponseTransformer(Transformer transformer);
59  
60      /** @deprecated Use setMessageProcessors() */
61      void setTransformers(List<Transformer> transformers);
62  
63      /** @deprecated Use setResponseMessageProcessors() */
64      void setResponseTransformers(List<Transformer> responseTransformer);
65  
66      void setName(String name);
67  
68      void setProperty(Object key, Object value);
69      
70      void setProperties(Map<Object, Object> properties);
71  
72      void setTransactionConfig(TransactionConfig transactionConfig);
73  
74      void setDeleteUnacceptedMessages(boolean deleteUnacceptedMessages);
75      
76      void setExchangePattern(MessageExchangePattern mep);
77  
78      void setResponseTimeout(int responseTimeout);
79  
80      void setInitialState(String initialState);
81  
82      void setEncoding(String encoding);
83  
84      void setRegistryId(String registryId);
85  
86      void setMuleContext(MuleContext muleContext);
87  
88      void setRetryPolicyTemplate(RetryPolicyTemplate retryPolicyTemplate);
89  
90      void setMessageProcessors(List <MessageProcessor> messageProcessors);
91  
92      void addMessageProcessor(MessageProcessor messageProcessor);
93  
94      void setResponseMessageProcessors(List <MessageProcessor> responseMessageProcessors);
95  
96      void addResponseMessageProcessor(MessageProcessor responseMessageProcessor);
97  
98      void setDisableTransportTransformer(boolean disableTransportTransformer);
99      
100     void setURIBuilder(URIBuilder URIBuilder);
101 
102     Object clone() throws CloneNotSupportedException;
103 
104 }