de.phleisch.app.itsucks.io
Interface DataRetriever

All Known Subinterfaces:
ResumeUrlDataRetriever, UrlDataRetriever
All Known Implementing Classes:
AbstractUrlDataRetriever, FileRetriever, FilterDataRetriever, HttpFileResumeUrlRetriever, HttpRetriever, SequenceRetriever

public interface DataRetriever

This interface specifies an DataRetriever. DataRetriever are used to provided an extended input stream for the processor chain.

Author:
olli

Field Summary
static java.lang.Integer NOTIFICATION_PROGRESS
          This type of notification will be send if the progress changes.
 
Method Summary
 void abort()
          Aborts the current retrieving.
 void connect()
          Advise the Retriever to connect to the data source.
 void disconnect()
          Disconnect from the data source.
 long getBytesSkipped()
          Returns the skipped bytes.
 long getContentLenght()
          Returns the content length in bytes.
 java.io.InputStream getDataAsInputStream()
          Returns an input stream for the retrieved data.
 Metadata getMetadata()
          Returns the metadata of the data source connection.
 boolean isConnected()
          Returns true if the retriever is connected.
 boolean isDataAvailable()
          Returns true if the data source contains any data to be read.
 void setBytesToSkip(long pBytesToSkip)
          Skip the given bytes (seek) when reading the data source.
 

Field Detail

NOTIFICATION_PROGRESS

static final java.lang.Integer NOTIFICATION_PROGRESS
This type of notification will be send if the progress changes.

Method Detail

connect

void connect()
             throws java.io.IOException
Advise the Retriever to connect to the data source.

Throws:
java.io.IOException

isConnected

boolean isConnected()
                    throws java.io.IOException
Returns true if the retriever is connected.

Throws:
java.io.IOException

isDataAvailable

boolean isDataAvailable()
                        throws java.io.IOException
Returns true if the data source contains any data to be read.

Returns:
Throws:
java.io.IOException

getDataAsInputStream

java.io.InputStream getDataAsInputStream()
                                         throws java.io.IOException
Returns an input stream for the retrieved data.

Returns:
Throws:
java.io.IOException

disconnect

void disconnect()
                throws java.io.IOException
Disconnect from the data source.

Throws:
java.io.IOException

abort

void abort()
Aborts the current retrieving.


getMetadata

Metadata getMetadata()
Returns the metadata of the data source connection.

Returns:

getContentLenght

long getContentLenght()
                      throws java.io.IOException
Returns the content length in bytes.

Returns:
Throws:
java.io.IOException

setBytesToSkip

void setBytesToSkip(long pBytesToSkip)
Skip the given bytes (seek) when reading the data source.

Parameters:
pBytesToSkip -

getBytesSkipped

long getBytesSkipped()
Returns the skipped bytes.

Returns:


Copyright © 2010. All Rights Reserved.