com.senseidb.dataprovider.http
Class HttpStreamDataProvider<D>

java.lang.Object
  extended by proj.zoie.impl.indexing.StreamDataProvider<D>
      extended by com.senseidb.dataprovider.http.HttpStreamDataProvider<D>
All Implemented Interfaces:
HttpDataProviderAdminMBean, proj.zoie.api.DataProvider<D>, proj.zoie.mbean.DataProviderAdminMBean

public abstract class HttpStreamDataProvider<D>
extends proj.zoie.impl.indexing.StreamDataProvider<D>
implements HttpDataProviderAdminMBean


Field Summary
protected  String _baseUrl
           
protected  int _fetchSize
           
protected  String _initialOffset
           
protected  String _offset
           
protected  String _password
           
static String DEFAULT_OFFSET_PARAM
           
static int DEFAULT_RETRYTIME_MS
           
static int DEFAULT_TIMEOUT_MS
           
static String DFEAULT_DATA_PARAM
           
 
Fields inherited from class proj.zoie.impl.indexing.StreamDataProvider
_versionComparator
 
Constructor Summary
HttpStreamDataProvider(Comparator<String> versionComparator, String baseUrl, String pw, int fetchSize, String startingOffset, boolean disableHttps)
           
 
Method Summary
protected abstract  String buildGetString(String offset)
           
 long getHttpGetLatency()
           
 long getResponseParseLatency()
           
 int getRetryTime()
           
 proj.zoie.api.DataConsumer.DataEvent<D> next()
           
protected abstract  Iterator<proj.zoie.api.DataConsumer.DataEvent<D>> parse(InputStream is)
           
 void reset()
           
 void setRetryTime(int retryTime)
           
 void setStartingOffset(String initialOffset)
           
 void start()
           
 void stop()
           
 
Methods inherited from class proj.zoie.impl.indexing.StreamDataProvider
getBatchSize, getDataConsumer, getEventCount, getEventsPerMinute, getMaxEventsPerMinute, getStatus, pause, resume, setBatchSize, setDataConsumer, setMaxEventsPerMinute, syncWithVersion, syncWthVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface proj.zoie.mbean.DataProviderAdminMBean
getBatchSize, getEventCount, getEventsPerMinute, getMaxEventsPerMinute, getStatus, pause, resume, setBatchSize, setMaxEventsPerMinute
 

Field Detail

_baseUrl

protected final String _baseUrl

DEFAULT_TIMEOUT_MS

public static final int DEFAULT_TIMEOUT_MS
See Also:
Constant Field Values

DEFAULT_RETRYTIME_MS

public static final int DEFAULT_RETRYTIME_MS
See Also:
Constant Field Values

DEFAULT_OFFSET_PARAM

public static final String DEFAULT_OFFSET_PARAM
See Also:
Constant Field Values

DFEAULT_DATA_PARAM

public static final String DFEAULT_DATA_PARAM
See Also:
Constant Field Values

_fetchSize

protected final int _fetchSize

_password

protected final String _password

_offset

protected String _offset

_initialOffset

protected String _initialOffset
Constructor Detail

HttpStreamDataProvider

public HttpStreamDataProvider(Comparator<String> versionComparator,
                              String baseUrl,
                              String pw,
                              int fetchSize,
                              String startingOffset,
                              boolean disableHttps)
Method Detail

setRetryTime

public void setRetryTime(int retryTime)
Overrides:
setRetryTime in class proj.zoie.impl.indexing.StreamDataProvider<D>

getRetryTime

public int getRetryTime()
Overrides:
getRetryTime in class proj.zoie.impl.indexing.StreamDataProvider<D>

setStartingOffset

public void setStartingOffset(String initialOffset)
Specified by:
setStartingOffset in class proj.zoie.impl.indexing.StreamDataProvider<D>

buildGetString

protected abstract String buildGetString(String offset)

parse

protected abstract Iterator<proj.zoie.api.DataConsumer.DataEvent<D>> parse(InputStream is)
                                                                    throws Exception
Throws:
Exception

next

public proj.zoie.api.DataConsumer.DataEvent<D> next()
Specified by:
next in class proj.zoie.impl.indexing.StreamDataProvider<D>

reset

public void reset()
Specified by:
reset in class proj.zoie.impl.indexing.StreamDataProvider<D>

getHttpGetLatency

public long getHttpGetLatency()
Specified by:
getHttpGetLatency in interface HttpDataProviderAdminMBean

getResponseParseLatency

public long getResponseParseLatency()
Specified by:
getResponseParseLatency in interface HttpDataProviderAdminMBean

start

public void start()
Specified by:
start in interface proj.zoie.mbean.DataProviderAdminMBean
Overrides:
start in class proj.zoie.impl.indexing.StreamDataProvider<D>

stop

public void stop()
Specified by:
stop in interface proj.zoie.mbean.DataProviderAdminMBean
Overrides:
stop in class proj.zoie.impl.indexing.StreamDataProvider<D>


Copyright © 2010-2012. All Rights Reserved.