Class VTLSessionImpl
- java.lang.Object
-
- it.bancaditalia.oss.vtl.impl.session.VTLSessionImpl
-
- All Implemented Interfaces:
TransformationScheme
,VTLSession
public class VTLSessionImpl extends Object implements VTLSession
-
-
Constructor Summary
Constructors Constructor Description VTLSessionImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VTLSessionImpl
addStatements(InputStream inputStream, Charset charset)
Adds some VTL statements to this session.VTLSessionImpl
addStatements(Reader reader)
Adds some VTL statements to this session.VTLSessionImpl
addStatements(String statements)
Adds some VTL statements to this session.VTLSessionImpl
addStatements(Path path, Charset charset)
Adds some VTL statements to this session.List<VTLValueMetadata>
compile()
Compile all the VTL code submitted to this session, and returns the metadata of all the objects contained in this session.boolean
contains(String alias)
Determine if an alias is defined in this TransformationScheme.Engine
getEngine()
VTLValueMetadata
getMetadata(String alias)
Searches and retrieves metadata for value, referred by an alias defined in this TransformationScheme.List<String>
getNodes()
MetadataRepository
getRepository()
Statement
getRule(String alias)
Returns astructure
a rule referred by an alias defined in this TransformationScheme.Map<String,String>
getStatements()
List<List<String>>
getTopology()
Workspace
getWorkspace()
Optional<Lineage>
linkLineage(String alias)
Tries to resolve a lineage link specified by a given alias for a VTL rule defined in this scheme.VTLValue
resolve(String alias)
Searches and retrieves a value, referred by an alias defined in this TransformationScheme.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface it.bancaditalia.oss.vtl.model.transform.TransformationScheme
eval, getParent, resolve
-
-
-
-
Method Detail
-
addStatements
public VTLSessionImpl addStatements(String statements)
Description copied from interface:VTLSession
Adds some VTL statements to this session. Code is parsed but not compiled.- Specified by:
addStatements
in interfaceVTLSession
- Parameters:
statements
- A string containing the statements to add- Returns:
this
instance.
-
addStatements
public VTLSessionImpl addStatements(Reader reader) throws IOException
Description copied from interface:VTLSession
Adds some VTL statements to this session. Code is parsed but not compiled. TheReader
will be consumed entirely and closed.- Specified by:
addStatements
in interfaceVTLSession
- Parameters:
reader
- aReader
which provides the VTL statements to add.- Returns:
this
instance.- Throws:
IOException
-
addStatements
public VTLSessionImpl addStatements(InputStream inputStream, Charset charset) throws IOException
Description copied from interface:VTLSession
Adds some VTL statements to this session. Code is parsed but not compiled. TheInputStream
will be consumed entirely and closed.- Specified by:
addStatements
in interfaceVTLSession
- Parameters:
inputStream
- anInputStream
which provides the VTL statements to addcharset
- aCharset
instance which will be used to interpret the stream contents.- Returns:
this
instance.- Throws:
IOException
-
addStatements
public VTLSessionImpl addStatements(Path path, Charset charset) throws IOException
Description copied from interface:VTLSession
Adds some VTL statements to this session. Code is parsed but not compiled.- Specified by:
addStatements
in interfaceVTLSession
- Parameters:
path
- aPath
describing the position of a local file which provides the VTL statements to addcharset
- aCharset
instance which will be used to interpret the file contents.- Returns:
this
instance.- Throws:
IOException
-
resolve
public VTLValue resolve(String alias)
Description copied from interface:TransformationScheme
Searches and retrieves a value, referred by an alias defined in this TransformationScheme.- Specified by:
resolve
in interfaceTransformationScheme
- Parameters:
alias
- The alias whose value is to be retrieved.- Returns:
- The
VTLValue
if the alias is found.
-
getMetadata
public VTLValueMetadata getMetadata(String alias)
Description copied from interface:TransformationScheme
Searches and retrieves metadata for value, referred by an alias defined in this TransformationScheme.- Specified by:
getMetadata
in interfaceTransformationScheme
- Parameters:
alias
- the alias whose value is to be retrieved.- Returns:
- the
metadata
of the value if the alias is found.
-
contains
public boolean contains(String alias)
Description copied from interface:TransformationScheme
Determine if an alias is defined in this TransformationScheme.- Specified by:
contains
in interfaceTransformationScheme
- Parameters:
alias
- the alias whose value is to be retrieved.- Returns:
- whether the alias is defined or not.
-
compile
public List<VTLValueMetadata> compile()
Description copied from interface:VTLSession
Compile all the VTL code submitted to this session, and returns the metadata of all the objects contained in this session.- Specified by:
compile
in interfaceVTLSession
- Returns:
- a
List
ofVTLValueMetadata
instances, describing a VTL object each.
-
getRule
public Statement getRule(String alias)
Description copied from interface:TransformationScheme
Returns astructure
a rule referred by an alias defined in this TransformationScheme.- Specified by:
getRule
in interfaceTransformationScheme
- Parameters:
alias
- the alias of the rule whose structure is to be retrieved.- Returns:
- a
Statement
instance describing the rule if found.
-
getRepository
public MetadataRepository getRepository()
- Specified by:
getRepository
in interfaceTransformationScheme
- Returns:
- The
MetadataRepository
instance used by this TransformationScheme.
-
getEngine
public Engine getEngine()
- Specified by:
getEngine
in interfaceVTLSession
- Returns:
- the computing
Engine
used by this session
-
getWorkspace
public Workspace getWorkspace()
- Specified by:
getWorkspace
in interfaceVTLSession
- Returns:
- the
Workspace
used by this session
-
linkLineage
public Optional<Lineage> linkLineage(String alias)
Description copied from interface:TransformationScheme
Tries to resolve a lineage link specified by a given alias for a VTL rule defined in this scheme.- Specified by:
linkLineage
in interfaceTransformationScheme
- Parameters:
alias
- The alias referring to a rule- Returns:
- The lineage link
-
-