Class PipelineManager
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.extraction.execution.pipeline.PipelineManager
-
- All Implemented Interfaces:
LogEnabled
,Disposable
,Initializable
,Component
,Serviceable
public class PipelineManager extends AbstractLogEnabled implements Component, Serviceable, Initializable, Disposable
Manager ofPipelineDescriptor
s
-
-
Field Summary
Fields Modifier and Type Field Description private static String
__NO_OP_PIPELINE_ID
private Map<String,Long>
_lastReading
private PipelineDescriptor
_noOpPipelineDesc
private Map<String,PipelineDescriptor>
_pipelineDescCache
private SourceResolver
_resolver
private PipelineSerializerModelExtensionPoint
_serializerEP
static String
ROLE
The Avalon role.
-
Constructor Summary
Constructors Constructor Description PipelineManager()
-
Method Summary
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
__NO_OP_PIPELINE_ID
private static final String __NO_OP_PIPELINE_ID
-
_noOpPipelineDesc
private PipelineDescriptor _noOpPipelineDesc
-
_pipelineDescCache
private Map<String,PipelineDescriptor> _pipelineDescCache
-
_lastReading
private Map<String,Long> _lastReading
-
_resolver
private SourceResolver _resolver
-
_serializerEP
private PipelineSerializerModelExtensionPoint _serializerEP
-
-
Constructor Detail
-
PipelineManager
public PipelineManager()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
initialize
public void initialize() throws Exception
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceDisposable
-
has
public boolean has(String path) throws IOException
Returnstrue
if thePipelineDescriptor
for asked path exists- Parameters:
path
- The path of thePipelineDescriptor
- Returns:
true
if the asked pipeline exists- Throws:
IOException
- if an I/O exception occurred when accessing the root folder of pipeline files
-
get
public PipelineDescriptor get(Path path) throws IOException
Gets thePipelineDescriptor
for the given path- Parameters:
path
- The path of the pipeline- Returns:
- the request
PipelineDescriptor
, or null if not found - Throws:
IOException
- if an I/O exception occurred when accessing the root folder of pipeline files
-
get
public PipelineDescriptor get(String path) throws IOException
Gets thePipelineDescriptor
for the given path- Parameters:
path
- The path of the pipeline- Returns:
- the request
PipelineDescriptor
, or null if not found - Throws:
IOException
- if an I/O exception occurred when accessing the root folder of pipeline files
-
getAvailablePipelines
public Map<String,Object> getAvailablePipelines(String extractionId) throws IOException
Gets the available pipelines for the given extraction- Parameters:
extractionId
- the extraction's definition file name- Returns:
- the available pipelines
- Throws:
IOException
- if an I/O exception occurred when accessing the root folder of pipeline files
-
_getJsonEnumeration
private List<Map<String,Object>> _getJsonEnumeration(String extractionId) throws IOException
- Throws:
IOException
-
getDefaultPipeline
public String getDefaultPipeline()
Gets the id of the defaultPipelineDescriptor
- Returns:
- the id of the default
PipelineDescriptor
-
_readAndGetPipeline
private PipelineDescriptor _readAndGetPipeline(String path) throws IOException
- Throws:
IOException
-
_readAll
private void _readAll() throws IOException
- Throws:
IOException
-
_absolutePath
private Path _absolutePath(String relativePath) throws IOException
- Throws:
IOException
-
_readFromFolder
private Stream<Pair<String,PipelineDescriptor>> _readFromFolder(Path folderPath) throws IOException
- Throws:
IOException
-
_readFromFile
private Stream<Pair<String,PipelineDescriptor>> _readFromFile(Path path) throws IOException
- Throws:
IOException
-
_readPipeline
private Pair<String,PipelineDescriptor> _readPipeline(Path pipelinePath) throws IOException
- Throws:
IOException
-
_getPipelineIdFromAbsolutePath
private String _getPipelineIdFromAbsolutePath(Path pipelineAbsolutePath) throws IOException
- Throws:
IOException
-
-