<?xml version="1.0" encoding="UTF-8"?>
<FlowConfiguration>
	<id>geotiffFlow</id>
	<name>Prepare GeoTIFF and publish</name>
	<description>Create overviews, retile the image and publish on GeoServer</description>

	<autorun>true</autorun>

	<corePoolSize>10</corePoolSize>
	<maximumPoolSize>30</maximumPoolSize>
	<keepAliveTime>15</keepAliveTime> <!--seconds -->
	<workQueueSize>100</workQueueSize>

	<EventGeneratorConfiguration>
		<wildCard>*.*</wildCard>
		<watchDirectory>geotiffFlow/in</watchDirectory>
		<osType>OS_UNDEFINED</osType>
		<eventType>FILE_ADDED</eventType>
		<!--interval>0 * * * * ?</interval--> <!-- CRON: every minute at sec 0 -->
		<!-- <interval>20</interval> -->  <!--  each 20 sec -->
		<serviceID>fsEventGeneratorService</serviceID>
	</EventGeneratorConfiguration>

	<EventConsumerConfiguration>
		<id>geotiff_retile_overview_publish</id>
		
		<listenerId>GeoTIFFConsumerLogger0</listenerId>
		<listenerId>GeoTIFFCumulator0</listenerId>
		
		<performBackup>true</performBackup>
		<preserveInput>false</preserveInput>

		<GeotiffRetilerConfiguration>
			<id>GeoTiffRetiler</id>
			<description>Action to retile a geotif</description>
			<name>GeoTiffRetiler action</name>

			<listenerId>GeoTIFFStatusActionLogger0</listenerId>
			<listenerId>GeoTIFFActionLogger0</listenerId>

			<serviceID>GeotiffRetilerService</serviceID>
			<forceToBigTiff>false</forceToBigTiff>
			<tileH>256</tileH>
			<tileW>256</tileW>

		</GeotiffRetilerConfiguration>

		<GeotiffOverviewsEmbedderConfiguration>
			<id>GeoTiffOverviewsEmbedder</id>
			<description>Action to add overviews to a geotif</description>
			<name>GeotiffOverview embedder action</name>

			<listenerId>GeoTIFFStatusActionLogger0</listenerId>
			<listenerId>GeoTIFFActionLogger0</listenerId>

			<serviceID>GeotiffOverviewsEmbedderService</serviceID>

			<downsampleStep>2</downsampleStep>
			<scaleAlgorithm>Average</scaleAlgorithm>
			<numSteps>15</numSteps>
			<tileH>256</tileH>
			<tileW>256</tileW>

		</GeotiffOverviewsEmbedderConfiguration>

		<GeoServerActionConfiguration>
			<serviceID>GeotiffGeoServerService</serviceID>
			<id>geotiff</id>
			<description>Action to ingest GeoTIFF on GeoServer</description>
			<name>geotiff action</name>

			<listenerId>GeoTIFFStatusActionLogger0</listenerId>
			<listenerId>GeoTIFFActionLogger0</listenerId>

			<crs>EPSG:4326</crs>
			<title>title</title>
			<layerDescription>layerDescription</layerDescription>
			<layerAbstract>Abstract</layerAbstract>
			<defaultStyle>raster</defaultStyle>
			
			<envelope />
			<dataTransferMethod>EXTERNAL</dataTransferMethod>
			<geoserverPWD>geoserver</geoserverPWD>
			<geoserverUID>admin</geoserverUID>
			<geoserverURL>http://localhost:8081/geoserver</geoserverURL>
			<defaultNamespace>geosolutions</defaultNamespace>
			
			<styles />
		</GeoServerActionConfiguration>
	</EventConsumerConfiguration>

	<ListenerConfigurations>
		<StatusProgressListener>
			<serviceID>statusListenerService</serviceID>
			<id>GeoTIFFStatusActionLogger0</id>
		</StatusProgressListener>

		<LoggingProgressListener>
			<serviceID>loggingListenerService</serviceID>
			<id>GeoTIFFActionLogger0</id>

			<loggerName>GeoTIFFActionLogger0</loggerName>
		</LoggingProgressListener>

		<LoggingProgressListener>
			<serviceID>loggingListenerService</serviceID>
			<id>GeoTIFFConsumerLogger0</id>

			<loggerName>GeoTIFFConsumerLogger0</loggerName>
		</LoggingProgressListener>

		<CumulatingProgressListener>
			<serviceID>cumulatingListenerService</serviceID>
			<id>GeoTIFFCumulator0</id>
		</CumulatingProgressListener>
	</ListenerConfigurations>
</FlowConfiguration>
