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

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

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

Author:
Dimitris Katris, NKUA

This DataSource fetches DataElements from a metadata collection.


Constructor Summary
MCollectionDataSource(String input, org.gcube.datatransformation.datatransformationlibrary.model.Parameter[] inputParameters)
           
 
Method Summary
 void close()
           
protected static String getContent(org.gcube.contentmanagement.gcubemodellibrary.elements.GCubeMetadata metadata, org.gcube.common.core.scope.GCUBEScope scope)
           
 boolean hasNext()
           
 boolean isClosed()
           
 org.gcube.datatransformation.datatransformationlibrary.dataelements.DataElement next()
           
 org.gcube.datatransformation.datatransformationlibrary.model.ContentType nextContentType()
           
 String streamToString(InputStream in)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MCollectionDataSource

public MCollectionDataSource(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. getElementsRS is the only parameter identified.
Throws:
Exception - If the MCollectionDataSource could not be initialized.
Method Detail

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
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()

streamToString

public String streamToString(InputStream in)
                      throws IOException
Throws:
IOException

getContent

protected static String getContent(org.gcube.contentmanagement.gcubemodellibrary.elements.GCubeMetadata metadata,
                                   org.gcube.common.core.scope.GCUBEScope scope)
                            throws Exception
Throws:
Exception

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.