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

java.lang.Object
  extended by org.gcube.datatransformation.datatransformationlibrary.datahandlers.impl.FTPDataSource
All Implemented Interfaces:
org.gcube.datatransformation.datatransformationlibrary.datahandlers.ContentTypeDataSource, org.gcube.datatransformation.datatransformationlibrary.datahandlers.DataHandler, org.gcube.datatransformation.datatransformationlibrary.datahandlers.DataSource, org.gcube.datatransformation.datatransformationlibrary.datahandlers.DistributableDataSource

public class FTPDataSource
extends Object
implements org.gcube.datatransformation.datatransformationlibrary.datahandlers.DataSource, org.gcube.datatransformation.datatransformationlibrary.datahandlers.DistributableDataSource, org.gcube.datatransformation.datatransformationlibrary.datahandlers.ContentTypeDataSource

Author:
Dimitris Katris, NKUA

This DataSource fetches DataElements from an ftp site.


Field Summary
protected static String PARAMETER_DirectoryName
           
protected static String PARAMETER_Password
           
protected static String PARAMETER_Port
           
protected static String PARAMETER_Username
           
 
Constructor Summary
FTPDataSource()
          Instantiates an FTPDataSource object.
FTPDataSource(String input, org.gcube.datatransformation.datatransformationlibrary.model.Parameter[] inputParameters)
           
 
Method Summary
 void close()
           
 org.gcube.datatransformation.datatransformationlibrary.dataelements.DataElement getDataElement(String dataElementID)
           
 String getNextDataElementID()
           
 boolean hasNext()
           
 void initializeDistributableDataSource(String input, org.gcube.datatransformation.datatransformationlibrary.model.Parameter[] inputParameters)
           
 boolean isClosed()
           
static void main(String[] args)
          Tests ftp data source and sink.
 org.gcube.datatransformation.datatransformationlibrary.dataelements.DataElement next()
           
 org.gcube.datatransformation.datatransformationlibrary.model.ContentType nextContentType()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAMETER_DirectoryName

protected static final String PARAMETER_DirectoryName
See Also:
Constant Field Values

PARAMETER_Username

protected static final String PARAMETER_Username
See Also:
Constant Field Values

PARAMETER_Password

protected static final String PARAMETER_Password
See Also:
Constant Field Values

PARAMETER_Port

protected static final String PARAMETER_Port
See Also:
Constant Field Values
Constructor Detail

FTPDataSource

public FTPDataSource(String input,
                     org.gcube.datatransformation.datatransformationlibrary.model.Parameter[] inputParameters)
              throws Exception
Parameters:
input - The input value of the DataSource.
inputParameters - The input parameters of the DataSource.
Throws:
Exception - If a connection could not be established.

FTPDataSource

public FTPDataSource()
Instantiates an FTPDataSource object.

Method Detail

main

public static void main(String[] args)
                 throws Exception
Tests ftp data source and sink.

Parameters:
args - The arguments of the main.
Throws:
Exception - If an error occurred in the test.

hasNext

public boolean hasNext()
Specified by:
hasNext in interface org.gcube.datatransformation.datatransformationlibrary.datahandlers.ContentTypeDataSource
Specified by:
hasNext in interface org.gcube.datatransformation.datatransformationlibrary.datahandlers.DataSource
Specified by:
hasNext in interface org.gcube.datatransformation.datatransformationlibrary.datahandlers.DistributableDataSource
Returns:
true if the DataSource has more elements.
See Also:
DataSource.hasNext()

next

public org.gcube.datatransformation.datatransformationlibrary.dataelements.DataElement next()
Specified by:
next in interface org.gcube.datatransformation.datatransformationlibrary.datahandlers.DataSource
Returns:
the next element of the DataSource.
See Also:
DataSource.next()

close

public void close()
Specified by:
close in interface org.gcube.datatransformation.datatransformationlibrary.datahandlers.DataHandler
See Also:
DataHandler.close()

isClosed

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

getDataElement

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

getNextDataElementID

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

initializeDistributableDataSource

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

nextContentType

public org.gcube.datatransformation.datatransformationlibrary.model.ContentType nextContentType()
Specified by:
nextContentType in interface org.gcube.datatransformation.datatransformationlibrary.datahandlers.ContentTypeDataSource


Copyright © 2012. All Rights Reserved.