Interface WeaveSampleDataResourcesService
- All Superinterfaces:
org.mule.dx.platform.api.component.ComponentLifecycle,LanguageServerLifecycle,WeaveService
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classDTO that represents an input sample data with a name and its uri. -
Method Summary
Modifier and TypeMethodDescriptiongetInputSampleData(String uri, String scenarioName, String inputFileName) The file where the input sample data should be stored.getInputSamples(String uri, String scenarioName) If there is a scenario defined for the URI it lists theWeaveSampleDataResourcesService.SampleInputfor every input sample defined or an empty list.The folder were sample data should be stored.listScenarios(String uri) For the given URI returns the list of names for each scenario defined.Methods inherited from interface org.mule.weave.extension.api.lifecycle.LanguageServerLifecycle
initialize, initialized, shutdownMethods inherited from interface org.mule.weave.extension.api.services.WeaveService
start, stop
-
Method Details
-
getSampleDataFolder
The folder were sample data should be stored.- Parameters:
uri- for the unique identifier of the element to get its sample data folder.- Returns:
Filethe folder were the sample data would be created. The folder is not created in the file system it is up to consumer to create it.
-
getInputSampleData
The file where the input sample data should be stored. In order to check if input sample data exists use theFile.exists()API.- Parameters:
uri- for the unique identifier of the element to get its sample data folder.scenarioName- the name of the scenario where the input is defined.inputFileName- the file name (with its extension, .json, .xml).- Returns:
Filethe file were the input sample data should be stored. The file is not created in the file system it is up to consumer to create it.
-
getInputSamples
Optional<List<WeaveSampleDataResourcesService.SampleInput>> getInputSamples(String uri, String scenarioName) If there is a scenario defined for the URI it lists theWeaveSampleDataResourcesService.SampleInputfor every input sample defined or an empty list.- Parameters:
uri- for the unique identifier of the element to get its sample data folder.scenarioName- the name of the scenario where the inputs are defined.- Returns:
ListofWeaveSampleDataResourcesService.SampleInputs for every input sample defined, or empty list. If there is no scenario defined for the given name an empty Optional.
-
listScenarios
For the given URI returns the list of names for each scenario defined.- Parameters:
uri- for the unique identifier of the element to get its sample data folder..- Returns:
Listof scenario names.
-