org.gcube.datatransformation.datatransformationlibrary.model.graph
Class TransformationsGraphImpl

java.lang.Object
  extended by org.gcube.datatransformation.datatransformationlibrary.model.graph.TransformationsGraphImpl
All Implemented Interfaces:
TransformationsGraph

public class TransformationsGraphImpl
extends Object
implements TransformationsGraph

Author:
Dimitris Katris, NKUA

Transformations� Graph is responsible to find transformationUnit units which can be used in order to perform a transformationUnit for an object, from its content type (source) to a target content type. The transformations� graph consists of nodes which correspond to content types and edges to transformationUnit units.

The selection of the transformationUnit units is based to the following rules. In the beginning the graph searches for transformationUnit units which have exact match of the source and target content types. If no one is available, the graph tries to search for a path in the graph from the source content type to the target content type and thus create a composite transformationUnit unit. If the graph does not manage to find a path, it searches for existing transformationUnit units or paths but for content types which do not have exact match i.e. the media type and the subtype identifier are always taken under consideration but for the parameters the rule is that if the parameters of the content type (source / target) denoted in the transformationUnit unit are contained and their values match with the object�s content type / the target of the transformationUnit respectively, then the transformationUnit unit is supposed to support the transformationUnit even if the source�s object / target content type contains more parameters.


Nested Class Summary
protected static class TransformationsGraphImpl.Consistency
           
 
Constructor Summary
TransformationsGraphImpl(IManager imanager)
          Instantiates a new TransformationsGraphImpl
 
Method Summary
 void destroy()
          Destroys the graph.
 ArrayList<TransformationUnit> findAnyTransformationUnits(ContentType sourceContentType, ContentType targetContentType, boolean createAndPublishCompositeTP)
          Finds Transformation Units from the sourceContentType to the targetContentType.
 ArrayList<TransformationUnit> findApplicableTransformationUnits(ContentType sourceContentType, ContentType targetContentType, boolean createAndPublishCompositeTP)
          Finds applicable Transformation Units from the sourceContentType to the targetContentType.
 ArrayList<ContentType> findAvailableTargetContentTypes(ContentType sourceContentType)
          Finds the available target ContentTypes from the sourceContentType.
protected  void update()
          Updates the TransformationsGraphImpl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransformationsGraphImpl

public TransformationsGraphImpl(IManager imanager)
Instantiates a new TransformationsGraphImpl

Parameters:
imanager - The IManager from which the graph will read information.
Method Detail

destroy

public void destroy()
Description copied from interface: TransformationsGraph
Destroys the graph.

Specified by:
destroy in interface TransformationsGraph
See Also:
TransformationsGraph.destroy()

update

protected void update()
               throws Exception
Updates the TransformationsGraphImpl

Throws:
Exception

findApplicableTransformationUnits

public ArrayList<TransformationUnit> findApplicableTransformationUnits(ContentType sourceContentType,
                                                                       ContentType targetContentType,
                                                                       boolean createAndPublishCompositeTP)
Description copied from interface: TransformationsGraph
Finds applicable Transformation Units from the sourceContentType to the targetContentType.

Specified by:
findApplicableTransformationUnits in interface TransformationsGraph
Parameters:
sourceContentType - The ContentType of the source DataElement.
targetContentType - The ContentType of the target DataElement.
createAndPublishCompositeTP - If true then a new composite TransformationProgram is created and published if no available TransformationProgram exists.
Returns:
The available TransformationUnits.
See Also:
TransformationsGraph.findApplicableTransformationUnits(org.gcube.datatransformation.datatransformationlibrary.model.ContentType, org.gcube.datatransformation.datatransformationlibrary.model.ContentType, boolean)

findAnyTransformationUnits

public ArrayList<TransformationUnit> findAnyTransformationUnits(ContentType sourceContentType,
                                                                ContentType targetContentType,
                                                                boolean createAndPublishCompositeTP)
Description copied from interface: TransformationsGraph
Finds Transformation Units from the sourceContentType to the targetContentType. Returns also generic Transformation Units.

Specified by:
findAnyTransformationUnits in interface TransformationsGraph
Parameters:
sourceContentType - The ContentType of the source DataElement.
targetContentType - The ContentType of the target DataElement.
createAndPublishCompositeTP - If true then a new composite TransformationProgram is created and published if no available TransformationProgram exists.
Returns:
The available TransformationUnits.
See Also:
TransformationsGraph.findAnyTransformationUnits(org.gcube.datatransformation.datatransformationlibrary.model.ContentType, org.gcube.datatransformation.datatransformationlibrary.model.ContentType, boolean)

findAvailableTargetContentTypes

public ArrayList<ContentType> findAvailableTargetContentTypes(ContentType sourceContentType)
Description copied from interface: TransformationsGraph
Finds the available target ContentTypes from the sourceContentType.

Specified by:
findAvailableTargetContentTypes in interface TransformationsGraph
Parameters:
sourceContentType - The ContentType of the source DataElement.
Returns:
The available target ContentTypes from the sourceContentType.
See Also:
TransformationsGraph.findAvailableTargetContentTypes(org.gcube.datatransformation.datatransformationlibrary.model.ContentType)


Copyright © 2013. All Rights Reserved.