org.gcube.datatransformation.datatransformationlibrary.datahandlers.impl
Class URIListDataSource

java.lang.Object
  extended by org.gcube.datatransformation.datatransformationlibrary.datahandlers.impl.URIListDataSource

public class URIListDataSource
extends java.lang.Object

Author:
Dimitris Katris, NKUA

This DataSource fetches DataElements from a file containing urls.


Constructor Summary
URIListDataSource()
           
URIListDataSource(java.lang.String input, Parameter[] inputParameters)
           
 
Method Summary
 void close()
           
 DataElement getDataElement(java.lang.String dataElementID)
           
 java.lang.String getNextDataElementID()
           
 boolean hasNext()
           
 void initializeDistributableDataSource(java.lang.String input, Parameter[] inputParameters)
           
 boolean isClosed()
           
static void main(java.lang.String[] args)
          Tests URIListDataSource.
 DataElement next()
           
 ContentType nextContentType()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URIListDataSource

public URIListDataSource(java.lang.String input,
                         Parameter[] inputParameters)
                  throws java.lang.Exception
Parameters:
input - The input value of the DataSource.
inputParameters - The input parameters of the DataSource.
Throws:
java.lang.Exception - If the DataSource could not be initialized.

URIListDataSource

public URIListDataSource()
Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Tests URIListDataSource.

Parameters:
args - nothing
Throws:
java.lang.Exception - If data source could not be initialized.

hasNext

public boolean hasNext()
Returns:
true if the DataSource has more elements.
See Also:
org.gcube.datatransformation.datatransformationlibrary.datahandlers.DataSource#hasNext()

next

public DataElement next()
Returns:
the next element of the DataSource.
See Also:
org.gcube.datatransformation.datatransformationlibrary.datahandlers.DataSource#next()

close

public void close()
See Also:
org.gcube.datatransformation.datatransformationlibrary.datahandlers.DataHandler#close()

isClosed

public boolean isClosed()
Returns:
true if the DataHandler has been closed.
See Also:
org.gcube.datatransformation.datatransformationlibrary.datahandlers.DataHandler#isClosed()

getDataElement

public DataElement getDataElement(java.lang.String dataElementID)
                           throws java.lang.Exception
Parameters:
dataElementID - The id of the DataElement.
Returns:
The DataElement instance.
Throws:
java.lang.Exception - If an error occurred in getting the DataElement.
See Also:
org.gcube.datatransformation.datatransformationlibrary.datahandlers.DistributableDataSource#getDataElement(java.lang.String)

getNextDataElementID

public java.lang.String getNextDataElementID()
                                      throws java.lang.Exception
Returns:
The next data element id.
Throws:
java.lang.Exception - If the DistributableDataSource did not manage to get another data element id.
See Also:
org.gcube.datatransformation.datatransformationlibrary.datahandlers.DistributableDataSource#getNextDataElementID()

initializeDistributableDataSource

public void initializeDistributableDataSource(java.lang.String input,
                                              Parameter[] inputParameters)
                                       throws java.lang.Exception
Parameters:
input - The input of the DistributableDataSource
inputParameters - Any input parameters required by the DistributableDataSource.
Throws:
java.lang.Exception - If the DistributableDataSource could not be initialized.
See Also:
org.gcube.datatransformation.datatransformationlibrary.datahandlers.DistributableDataSource#initializeDistributableDataSource(java.lang.String, org.gcube.datatransformation.datatransformationlibrary.model.Parameter[])

nextContentType

public ContentType nextContentType()