Coverage Report - org.mule.transport.http.HttpPollingConnector
 
Classes in this File Line Coverage Branch Coverage Complexity
HttpPollingConnector
0%
0/16
N/A
1
 
 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  
  * The HttpPollingConnectors allows for inbound Http endpoints to be configured with an address which it shall use
 16  
  * to poll for a result. If a result is received it becomes the inbound event for the component.  This connector is
 17  
  * useful for interacting with services that provide pull-only support for obtaining data.  This is typical for many
 18  
  * web-based services.
 19  
  */
 20  
 public class HttpPollingConnector extends HttpConnector
 21  
 {
 22  
     /**
 23  
      * How long to wait in milliseconds between make a new request
 24  
      */
 25  0
     private long pollingFrequency = 1000L;
 26  
 
 27  
     /**
 28  
      * If a zero-length content is returned should the message be discarded
 29  
      */
 30  0
     private boolean discardEmptyContent = true;
 31  
 
 32  
     /**
 33  
      * Should the ETag header get honoured if it is present.
 34  
      */
 35  0
     private boolean checkEtag = true;
 36  
 
 37  
     public HttpPollingConnector(MuleContext context)
 38  
     {
 39  0
         super(context);
 40  0
         serviceOverrides = new Properties();
 41  0
         serviceOverrides.setProperty(MuleProperties.CONNECTOR_MESSAGE_RECEIVER_CLASS, PollingHttpMessageReceiver.class.getName());
 42  0
     }
 43  
 
 44  
     public boolean isDiscardEmptyContent()
 45  
     {
 46  0
         return discardEmptyContent;
 47  
     }
 48  
 
 49  
     public void setDiscardEmptyContent(boolean discardEmptyContent)
 50  
     {
 51  0
         this.discardEmptyContent = discardEmptyContent;
 52  0
     }
 53  
 
 54  
     public long getPollingFrequency()
 55  
     {
 56  0
         return pollingFrequency;
 57  
     }
 58  
 
 59  
     public void setPollingFrequency(long pollingFrequency)
 60  
     {
 61  0
         this.pollingFrequency = pollingFrequency;
 62  0
     }
 63  
 
 64  
     public boolean isCheckEtag()
 65  
     {
 66  0
         return checkEtag;
 67  
     }
 68  
 
 69  
     public void setCheckEtag(boolean checkEtag)
 70  
     {
 71  0
         this.checkEtag = checkEtag;
 72  0
     }
 73  
 }