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.http;
8   
9   import org.mule.api.MuleContext;
10  import org.mule.api.config.MuleProperties;
11  
12  import java.util.Properties;
13  
14  /**
15   * <code>HttpsPollingConnector</code> provides Secure http connectivity on top of what is already provided with the
16   * Mule {@link org.mule.transport.http.HttpPollingConnector}.
17   */
18  public class HttpsPollingConnector extends HttpsConnector
19  {
20      /**
21       * How long to wait in milliseconds between make a new request
22       */
23      private long pollingFrequency = 1000L;
24  
25      /**
26       * If a zero-length content is returned should the message be discarded
27       */
28      private boolean discardEmptyContent = true;
29  
30      /**
31       * Should the ETag header get honoured if it is present.
32       */
33      private boolean checkEtag = true;
34  
35      public HttpsPollingConnector(MuleContext context)
36      {
37          super(context);
38          serviceOverrides = new Properties();
39          serviceOverrides.setProperty(MuleProperties.CONNECTOR_MESSAGE_RECEIVER_CLASS, PollingHttpMessageReceiver.class.getName());
40      }
41  
42      public boolean isDiscardEmptyContent()
43      {
44          return discardEmptyContent;
45      }
46  
47      public void setDiscardEmptyContent(boolean discardEmptyContent)
48      {
49          this.discardEmptyContent = discardEmptyContent;
50      }
51  
52      public long getPollingFrequency()
53      {
54          return pollingFrequency;
55      }
56  
57      public void setPollingFrequency(long pollingFrequency)
58      {
59          this.pollingFrequency = pollingFrequency;
60      }
61  
62      public boolean isCheckEtag()
63      {
64          return checkEtag;
65      }
66  
67      public void setCheckEtag(boolean checkEtag)
68      {
69          this.checkEtag = checkEtag;
70      }
71  }